]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg/HttpDxe: Support HTTP Patch method
authorJiaxin Wu <jiaxin.wu@intel.com>
Wed, 2 Aug 2017 07:51:47 +0000 (15:51 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Mon, 7 Aug 2017 01:03:50 +0000 (09:03 +0800)
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
NetworkPkg/HttpDxe/HttpImpl.c

index 8a9e57345af8802f0e53b2db0ff380d92465cb2f..e0fecac3d56afb95ac5dc2c473bbc98b2b8ee26e 100644 (file)
@@ -276,10 +276,11 @@ EfiHttpRequest (
   Request = HttpMsg->Data.Request;\r
 \r
   //\r
-  // Only support GET, HEAD, PUT and POST method in current implementation.\r
+  // Only support GET, HEAD, PATCH, PUT and POST method in current implementation.\r
   //\r
   if ((Request != NULL) && (Request->Method != HttpMethodGet) &&\r
-      (Request->Method != HttpMethodHead) && (Request->Method != HttpMethodPut) && (Request->Method != HttpMethodPost)) {\r
+      (Request->Method != HttpMethodHead) && (Request->Method != HttpMethodPut) && \r
+      (Request->Method != HttpMethodPost) && (Request->Method != HttpMethodPatch)) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
@@ -299,14 +300,16 @@ EfiHttpRequest (
 \r
   if (Request == NULL) {\r
     //\r
-    // Request would be NULL only for PUT/POST operation (in the current implementation)\r
+    // Request would be NULL only for PUT/POST/PATCH operation (in the current implementation)\r
     //\r
-    if ((HttpInstance->Method != HttpMethodPut) && (HttpInstance->Method != HttpMethodPost)) {\r
+    if ((HttpInstance->Method != HttpMethodPut) && \r
+        (HttpInstance->Method != HttpMethodPost) && \r
+        (HttpInstance->Method != HttpMethodPatch)) {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
     //\r
-    // For PUT/POST, we need to have the TCP already configured. Bail out if it is not!\r
+    // For PUT/POST/PATCH, we need to have the TCP already configured. Bail out if it is not!\r
     //\r
     if (HttpInstance->State < HTTP_STATE_TCP_CONFIGED) {\r
       return EFI_INVALID_PARAMETER;\r
@@ -617,7 +620,7 @@ EfiHttpRequest (
 \r
   //\r
   // Every request we insert a TxToken and a response call would remove the TxToken.\r
-  // In cases of PUT/POST, after an initial request-response pair, we would do a\r
+  // In cases of PUT/POST/PATCH, after an initial request-response pair, we would do a\r
   // continuous request without a response call. So, in such cases, where Request\r
   // structure is NULL, we would not insert a TxToken.\r
   //\r
@@ -1113,7 +1116,7 @@ HttpResponseWorker (
     ValueInItem = NULL;\r
 \r
     //\r
-    // In cases of PUT/POST, after an initial request-response pair, we would do a\r
+    // In cases of PUT/POST/PATCH, after an initial request-response pair, we would do a\r
     // continuous request without a response call. So, we would not do an insert of\r
     // TxToken. After we have sent the complete file, we will call a response to get\r
     // a final response from server. In such a case, we would not have any TxTokens.\r