]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpDxe/HttpImpl.c
MdeModulePkg/EmmcDxe: demote DEBUG print to DEBUG_BLKIO
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpImpl.c
index 57fa39f094e8b8a5d0377272fa0421d767362809..a2af59674a3c7dd4426424f9e638f8de32802f86 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implementation of EFI_HTTP_PROTOCOL protocol interfaces.\r
 \r
-  Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
   (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>\r
 \r
   This program and the accompanying materials\r
@@ -65,7 +65,6 @@ EfiHttpGetModeData (
   }\r
 \r
   HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);\r
-  ASSERT (HttpInstance != NULL);\r
 \r
   if ((HttpConfigData->AccessPoint.IPv6Node == NULL) ||\r
       (HttpConfigData->AccessPoint.IPv4Node == NULL)) {\r
@@ -149,7 +148,7 @@ EfiHttpConfigure (
   }\r
 \r
   HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);\r
-  ASSERT (HttpInstance != NULL && HttpInstance->Service != NULL);\r
+  ASSERT (HttpInstance->Service != NULL);\r
 \r
   if (HttpConfigData != NULL) {\r
 \r
@@ -282,16 +281,16 @@ EfiHttpRequest (
   Request = HttpMsg->Data.Request;\r
 \r
   //\r
-  // Only support GET, HEAD, PATCH, PUT and POST method in current implementation.\r
+  // Only support GET, HEAD, DELETE, PATCH, PUT and POST method in current implementation.\r
   //\r
   if ((Request != NULL) && (Request->Method != HttpMethodGet) &&\r
-      (Request->Method != HttpMethodHead) && (Request->Method != HttpMethodPut) && \r
-      (Request->Method != HttpMethodPost) && (Request->Method != HttpMethodPatch)) {\r
+      (Request->Method != HttpMethodHead) && (Request->Method != HttpMethodDelete) && \r
+      (Request->Method != HttpMethodPut) && (Request->Method != HttpMethodPost) && \r
+      (Request->Method != HttpMethodPatch)) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
   HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);\r
-  ASSERT (HttpInstance != NULL);\r
 \r
   //\r
   // Capture the method into HttpInstance.\r
@@ -472,6 +471,8 @@ EfiHttpRequest (
 \r
           FreePool (HostName);\r
 \r
+          HttpUrlFreeParser (UrlParser);\r
+\r
           //\r
           // Queue the HTTP token and return.\r
           //\r
@@ -623,8 +624,6 @@ EfiHttpRequest (
     goto Error3;\r
   }\r
 \r
-  ASSERT (RequestMsg != NULL);\r
-\r
   //\r
   // Every request we insert a TxToken and a response call would remove the TxToken.\r
   // In cases of PUT/POST/PATCH, after an initial request-response pair, we would do a\r
@@ -656,6 +655,10 @@ EfiHttpRequest (
   if (HostName != NULL) {\r
     FreePool (HostName);\r
   }\r
+\r
+  if (UrlParser != NULL) {\r
+    HttpUrlFreeParser (UrlParser);\r
+  }\r
   \r
   return EFI_SUCCESS;\r
 \r
@@ -699,7 +702,7 @@ Error1:
   if (Wrap != NULL) {\r
     FreePool (Wrap);\r
   }\r
-  if (UrlParser!= NULL) {\r
+  if (UrlParser != NULL) {\r
     HttpUrlFreeParser (UrlParser);\r
   }\r
 \r
@@ -881,7 +884,6 @@ EfiHttpCancel (
   }\r
 \r
   HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);\r
-  ASSERT (HttpInstance != NULL);\r
 \r
   if (HttpInstance->State != HTTP_STATE_TCP_CONNECTED) {\r
     return EFI_NOT_STARTED;\r
@@ -1539,7 +1541,6 @@ EfiHttpResponse (
   }\r
   \r
   HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);\r
-  ASSERT (HttpInstance != NULL);\r
 \r
   if (HttpInstance->State != HTTP_STATE_TCP_CONNECTED) {\r
     return EFI_NOT_STARTED;\r
@@ -1635,7 +1636,6 @@ EfiHttpPoll (
   }\r
 \r
   HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);\r
-  ASSERT (HttpInstance != NULL);\r
 \r
   if (HttpInstance->State != HTTP_STATE_TCP_CONNECTED) {\r
     return EFI_NOT_STARTED;\r