]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpDxe/HttpProto.h
NetworkPkg: HttpDxe response/cancel issue fix
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpProto.h
index e43a2dc01c54e669a9cd4c887117f8d61a8d7716..e1fd785b2cefe2d01c0f70c05e5cacefa8fe8f60 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
   The header files of miscellaneous routines for HttpDxe driver.\r
 \r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -46,6 +47,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define HTTP_BUFFER_SIZE_DEAULT      65535\r
 #define HTTP_MAX_SYN_BACK_LOG        5\r
 #define HTTP_CONNECTION_TIMEOUT      60\r
+#define HTTP_RESPONSE_TIMEOUT        5\r
 #define HTTP_DATA_RETRIES            12\r
 #define HTTP_FIN_TIMEOUT             2\r
 #define HTTP_KEEP_ALIVE_PROBES       6\r
@@ -89,6 +91,11 @@ typedef struct _HTTP_PROTOCOL {
   LIST_ENTRY                    Link;   // Link to all HTTP instance from the service.\r
   BOOLEAN                       InDestroy;\r
   INTN                          State;\r
+  EFI_HTTP_METHOD               Method;\r
+\r
+  UINTN                         StatusCode;\r
+\r
+  EFI_EVENT                     TimeoutEvent;\r
 \r
   EFI_HANDLE                    Tcp4ChildHandle;\r
   EFI_TCP4_PROTOCOL             *Tcp4;\r
@@ -113,9 +120,7 @@ typedef struct _HTTP_PROTOCOL {
   EFI_TCP6_CLOSE_TOKEN          Tcp6CloseToken;\r
   BOOLEAN                       IsTcp6CloseDone;\r
   EFI_IPv6_ADDRESS              RemoteIpv6Addr;\r
-\r
-\r
-  \r
\r
   //\r
   // Rx4Token or Rx6Token used for receiving HTTP header.\r
   //\r
@@ -396,20 +401,6 @@ HttpTransmitTcp (
   IN  UINTN            TxStringLen\r
   );\r
 \r
-/**\r
-  Translate the status code in HTTP message to EFI_HTTP_STATUS_CODE defined \r
-  in UEFI 2.5 specification.\r
-\r
-  @param[in]  StatusCode         The status code value in HTTP message.\r
-\r
-  @return                        Value defined in EFI_HTTP_STATUS_CODE .\r
-\r
-**/\r
-EFI_HTTP_STATUS_CODE\r
-HttpMappingToStatusCode (\r
-  IN UINTN                  StatusCode\r
-  );\r
-\r
 /**\r
   Check whether the user's token or event has already\r
   been enqueue on HTTP Tx or Rx Token list.\r
@@ -515,6 +506,7 @@ HttpTcpReceive (
   @param[in]       HttpInstance    The HTTP instance private data.\r
   @param[in, out]  SizeofHeaders   The HTTP header length.\r
   @param[in, out]  BufferSize      The size of buffer to cacahe the header message.\r
+  @param[in]       Timeout         The time to wait for receiving the header packet.\r
 \r
   @retval EFI_SUCCESS              The HTTP header is received.                          \r
   @retval Others                   Other errors as indicated.\r
@@ -524,7 +516,8 @@ EFI_STATUS
 HttpTcpReceiveHeader (\r
   IN  HTTP_PROTOCOL         *HttpInstance,\r
   IN  OUT UINTN             *SizeofHeaders,\r
-  IN  OUT UINTN             *BufferSize\r
+  IN  OUT UINTN             *BufferSize,\r
+  IN  EFI_EVENT             Timeout\r
   );\r
 \r
 /**\r
@@ -554,24 +547,6 @@ HttpTcpTokenCleanup (
   IN  HTTP_TOKEN_WRAP      *Wrap\r
   );\r
 \r
-/**\r
-  Generate HTTP request string.\r
-\r
-  @param[in]  HttpInstance       Pointer to HTTP_PROTOCOL structure.\r
-  @param[in]  Message            Pointer to storage containing HTTP message data.\r
-  @param[in]  Url                The URL of a remote host.\r
-\r
-  @return     Pointer to the created HTTP request string.\r
-  @return     NULL if any error occured.\r
-\r
-**/\r
-CHAR8 *\r
-HttpGenRequestString (\r
-  IN  HTTP_PROTOCOL        *HttpInstance,\r
-  IN  EFI_HTTP_MESSAGE     *Message,\r
-  IN  CHAR8                *Url\r
-  );\r
-\r
 /**\r
   The work function of EfiHttpResponse().\r
 \r