From 97c567efd303f610ac16e12b4bf066d0240f6d0b Mon Sep 17 00:00:00 2001 From: Jiaxin Wu Date: Wed, 2 Aug 2017 15:51:47 +0800 Subject: NetworkPkg/HttpDxe: Support HTTP Patch method Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Reviewed-by: Fu Siyuan Reviewed-by: Ye Ting --- NetworkPkg/HttpDxe/HttpImpl.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'NetworkPkg/HttpDxe') 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. -- cgit v1.2.3