diff options
author | Jiaxin Wu <jiaxin.wu@intel.com> | 2017-08-02 15:51:47 +0800 |
---|---|---|
committer | Jiaxin Wu <jiaxin.wu@intel.com> | 2017-08-07 09:03:50 +0800 |
commit | 97c567efd303f610ac16e12b4bf066d0240f6d0b (patch) | |
tree | 32968132932e4fd47390a7301681ce67f7668fee /NetworkPkg | |
parent | 1fceaddb12b59e5711b26f26859e324e7a8e212a (diff) | |
download | edk2-97c567efd303f610ac16e12b4bf066d0240f6d0b.tar.gz edk2-97c567efd303f610ac16e12b4bf066d0240f6d0b.tar.bz2 edk2-97c567efd303f610ac16e12b4bf066d0240f6d0b.zip |
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>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Diffstat (limited to 'NetworkPkg')
-rw-r--r-- | NetworkPkg/HttpDxe/HttpImpl.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index 8a9e57345a..e0fecac3d5 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.c +++ b/NetworkPkg/HttpDxe/HttpImpl.c @@ -276,10 +276,11 @@ 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;
}
@@ -299,14 +300,16 @@ EfiHttpRequest ( 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;
@@ -617,7 +620,7 @@ EfiHttpRequest ( //
// 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.
//
@@ -1113,7 +1116,7 @@ HttpResponseWorker ( 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.
|