public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] NetworkPkg/HttpDxe: Support HTTP Patch method
@ 2017-08-02  8:01 Jiaxin Wu
  2017-08-02  8:04 ` Fu, Siyuan
  2017-08-03  8:39 ` Ye, Ting
  0 siblings, 2 replies; 3+ messages in thread
From: Jiaxin Wu @ 2017-08-02  8:01 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ye Ting, Fu Siyuan, Wu Jiaxin

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>
---
 NetworkPkg/HttpDxe/HttpImpl.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index 8a9e573..e0fecac 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -274,14 +274,15 @@ EfiHttpRequest (
   }
 
   Request = HttpMsg->Data.Request;
 
   //
-  // Only support GET, HEAD, PUT and POST method in current implementation.
+  // Only support GET, HEAD, PATCH, PUT and POST method in current implementation.
   //
   if ((Request != NULL) && (Request->Method != HttpMethodGet) &&
-      (Request->Method != HttpMethodHead) && (Request->Method != HttpMethodPut) && (Request->Method != HttpMethodPost)) {
+      (Request->Method != HttpMethodHead) && (Request->Method != HttpMethodPut) && 
+      (Request->Method != HttpMethodPost) && (Request->Method != HttpMethodPatch)) {
     return EFI_UNSUPPORTED;
   }
 
   HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);
   ASSERT (HttpInstance != NULL);
@@ -297,18 +298,20 @@ EfiHttpRequest (
     return EFI_NOT_STARTED;
   }
 
   if (Request == NULL) {
     //
-    // Request would be NULL only for PUT/POST operation (in the current implementation)
+    // Request would be NULL only for PUT/POST/PATCH operation (in the current implementation)
     //
-    if ((HttpInstance->Method != HttpMethodPut) && (HttpInstance->Method != HttpMethodPost)) {
+    if ((HttpInstance->Method != HttpMethodPut) && 
+        (HttpInstance->Method != HttpMethodPost) && 
+        (HttpInstance->Method != HttpMethodPatch)) {
       return EFI_INVALID_PARAMETER;
     }
 
     //
-    // For PUT/POST, we need to have the TCP already configured. Bail out if it is not!
+    // For PUT/POST/PATCH, we need to have the TCP already configured. Bail out if it is not!
     //
     if (HttpInstance->State < HTTP_STATE_TCP_CONFIGED) {
       return EFI_INVALID_PARAMETER;
     }
 
@@ -615,11 +618,11 @@ EfiHttpRequest (
 
   ASSERT (RequestMsg != NULL);
 
   //
   // Every request we insert a TxToken and a response call would remove the TxToken.
-  // In cases of PUT/POST, after an initial request-response pair, we would do a
+  // In cases of PUT/POST/PATCH, after an initial request-response pair, we would do a
   // continuous request without a response call. So, in such cases, where Request
   // structure is NULL, we would not insert a TxToken.
   //
   if (Request != NULL) {
     Status = NetMapInsertTail (&HttpInstance->TxTokens, Token, Wrap);
@@ -1111,11 +1114,11 @@ HttpResponseWorker (
 
     Status = EFI_NOT_READY;
     ValueInItem = NULL;
 
     //
-    // In cases of PUT/POST, after an initial request-response pair, we would do a
+    // In cases of PUT/POST/PATCH, after an initial request-response pair, we would do a
     // continuous request without a response call. So, we would not do an insert of
     // TxToken. After we have sent the complete file, we will call a response to get
     // a final response from server. In such a case, we would not have any TxTokens.
     // Hence, check that case before doing a NetMapRemoveHead.
     //
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Patch] NetworkPkg/HttpDxe: Support HTTP Patch method
  2017-08-02  8:01 [Patch] NetworkPkg/HttpDxe: Support HTTP Patch method Jiaxin Wu
@ 2017-08-02  8:04 ` Fu, Siyuan
  2017-08-03  8:39 ` Ye, Ting
  1 sibling, 0 replies; 3+ messages in thread
From: Fu, Siyuan @ 2017-08-02  8:04 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Ye, Ting

Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>


-----Original Message-----
From: Wu, Jiaxin 
Sent: Wednesday, August 2, 2017 4:01 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [Patch] NetworkPkg/HttpDxe: Support HTTP Patch method

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>
---
 NetworkPkg/HttpDxe/HttpImpl.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index 8a9e573..e0fecac 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -274,14 +274,15 @@ EfiHttpRequest (
   }
 
   Request = HttpMsg->Data.Request;
 
   //
-  // Only support GET, HEAD, PUT and POST method in current implementation.
+  // Only support GET, HEAD, PATCH, PUT and POST method in current implementation.
   //
   if ((Request != NULL) && (Request->Method != HttpMethodGet) &&
-      (Request->Method != HttpMethodHead) && (Request->Method != HttpMethodPut) && (Request->Method != HttpMethodPost)) {
+      (Request->Method != HttpMethodHead) && (Request->Method != HttpMethodPut) && 
+      (Request->Method != HttpMethodPost) && (Request->Method != HttpMethodPatch)) {
     return EFI_UNSUPPORTED;
   }
 
   HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);
   ASSERT (HttpInstance != NULL);
@@ -297,18 +298,20 @@ EfiHttpRequest (
     return EFI_NOT_STARTED;
   }
 
   if (Request == NULL) {
     //
-    // Request would be NULL only for PUT/POST operation (in the current implementation)
+    // Request would be NULL only for PUT/POST/PATCH operation (in the current implementation)
     //
-    if ((HttpInstance->Method != HttpMethodPut) && (HttpInstance->Method != HttpMethodPost)) {
+    if ((HttpInstance->Method != HttpMethodPut) && 
+        (HttpInstance->Method != HttpMethodPost) && 
+        (HttpInstance->Method != HttpMethodPatch)) {
       return EFI_INVALID_PARAMETER;
     }
 
     //
-    // For PUT/POST, we need to have the TCP already configured. Bail out if it is not!
+    // For PUT/POST/PATCH, we need to have the TCP already configured. Bail out if it is not!
     //
     if (HttpInstance->State < HTTP_STATE_TCP_CONFIGED) {
       return EFI_INVALID_PARAMETER;
     }
 
@@ -615,11 +618,11 @@ EfiHttpRequest (
 
   ASSERT (RequestMsg != NULL);
 
   //
   // Every request we insert a TxToken and a response call would remove the TxToken.
-  // In cases of PUT/POST, after an initial request-response pair, we would do a
+  // In cases of PUT/POST/PATCH, after an initial request-response pair, we would do a
   // continuous request without a response call. So, in such cases, where Request
   // structure is NULL, we would not insert a TxToken.
   //
   if (Request != NULL) {
     Status = NetMapInsertTail (&HttpInstance->TxTokens, Token, Wrap);
@@ -1111,11 +1114,11 @@ HttpResponseWorker (
 
     Status = EFI_NOT_READY;
     ValueInItem = NULL;
 
     //
-    // In cases of PUT/POST, after an initial request-response pair, we would do a
+    // In cases of PUT/POST/PATCH, after an initial request-response pair, we would do a
     // continuous request without a response call. So, we would not do an insert of
     // TxToken. After we have sent the complete file, we will call a response to get
     // a final response from server. In such a case, we would not have any TxTokens.
     // Hence, check that case before doing a NetMapRemoveHead.
     //
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Patch] NetworkPkg/HttpDxe: Support HTTP Patch method
  2017-08-02  8:01 [Patch] NetworkPkg/HttpDxe: Support HTTP Patch method Jiaxin Wu
  2017-08-02  8:04 ` Fu, Siyuan
@ 2017-08-03  8:39 ` Ye, Ting
  1 sibling, 0 replies; 3+ messages in thread
From: Ye, Ting @ 2017-08-03  8:39 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Fu, Siyuan

Reviewed-by: Ye Ting <ting.ye@intel.com> 

-----Original Message-----
From: Wu, Jiaxin 
Sent: Wednesday, August 02, 2017 4:01 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [Patch] NetworkPkg/HttpDxe: Support HTTP Patch method

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>
---
 NetworkPkg/HttpDxe/HttpImpl.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index 8a9e573..e0fecac 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -274,14 +274,15 @@ EfiHttpRequest (
   }
 
   Request = HttpMsg->Data.Request;
 
   //
-  // Only support GET, HEAD, PUT and POST method in current implementation.
+  // Only support GET, HEAD, PATCH, PUT and POST method in current implementation.
   //
   if ((Request != NULL) && (Request->Method != HttpMethodGet) &&
-      (Request->Method != HttpMethodHead) && (Request->Method != HttpMethodPut) && (Request->Method != HttpMethodPost)) {
+      (Request->Method != HttpMethodHead) && (Request->Method != HttpMethodPut) && 
+      (Request->Method != HttpMethodPost) && (Request->Method != 
+ HttpMethodPatch)) {
     return EFI_UNSUPPORTED;
   }
 
   HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);
   ASSERT (HttpInstance != NULL);
@@ -297,18 +298,20 @@ EfiHttpRequest (
     return EFI_NOT_STARTED;
   }
 
   if (Request == NULL) {
     //
-    // Request would be NULL only for PUT/POST operation (in the current implementation)
+    // Request would be NULL only for PUT/POST/PATCH operation (in the 
+ current implementation)
     //
-    if ((HttpInstance->Method != HttpMethodPut) && (HttpInstance->Method != HttpMethodPost)) {
+    if ((HttpInstance->Method != HttpMethodPut) && 
+        (HttpInstance->Method != HttpMethodPost) && 
+        (HttpInstance->Method != HttpMethodPatch)) {
       return EFI_INVALID_PARAMETER;
     }
 
     //
-    // For PUT/POST, we need to have the TCP already configured. Bail out if it is not!
+    // For PUT/POST/PATCH, we need to have the TCP already configured. Bail out if it is not!
     //
     if (HttpInstance->State < HTTP_STATE_TCP_CONFIGED) {
       return EFI_INVALID_PARAMETER;
     }
 
@@ -615,11 +618,11 @@ EfiHttpRequest (
 
   ASSERT (RequestMsg != NULL);
 
   //
   // Every request we insert a TxToken and a response call would remove the TxToken.
-  // In cases of PUT/POST, after an initial request-response pair, we would do a
+  // In cases of PUT/POST/PATCH, after an initial request-response 
+ pair, we would do a
   // continuous request without a response call. So, in such cases, where Request
   // structure is NULL, we would not insert a TxToken.
   //
   if (Request != NULL) {
     Status = NetMapInsertTail (&HttpInstance->TxTokens, Token, Wrap); @@ -1111,11 +1114,11 @@ HttpResponseWorker (
 
     Status = EFI_NOT_READY;
     ValueInItem = NULL;
 
     //
-    // In cases of PUT/POST, after an initial request-response pair, we would do a
+    // In cases of PUT/POST/PATCH, after an initial request-response 
+ pair, we would do a
     // continuous request without a response call. So, we would not do an insert of
     // TxToken. After we have sent the complete file, we will call a response to get
     // a final response from server. In such a case, we would not have any TxTokens.
     // Hence, check that case before doing a NetMapRemoveHead.
     //
--
1.9.5.msysgit.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-03  8:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-02  8:01 [Patch] NetworkPkg/HttpDxe: Support HTTP Patch method Jiaxin Wu
2017-08-02  8:04 ` Fu, Siyuan
2017-08-03  8:39 ` Ye, Ting

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox