]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpDxe/HttpImpl.c
NetworkPkg: Update HttpDxe driver to consume EFI_HTTP_UTILITIES_PROTOCOL
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpImpl.c
index 80e819201ec1b667dbf78d325b380b56df2763b1..5b3c5d058cb1de9fbaec6d43bb3f87dac2118d8f 100644 (file)
@@ -757,7 +757,8 @@ HttpBodyParserCallback (
 \r
   @retval EFI_SUCCESS             Allocation succeeded.\r
   @retval EFI_OUT_OF_RESOURCES    Failed to complete the opration due to lack of resources.\r
-  @retval EFI_NOT_READY           Can't find a corresponding TxToken.\r
+  @retval EFI_NOT_READY           Can't find a corresponding TxToken or \r
+                                  the EFI_HTTP_UTILITIES_PROTOCOL is not available.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -953,10 +954,25 @@ HttpResponseWorker (
     CopyMem (HeaderTmp, Tmp, SizeofHeaders);\r
     FreePool (HttpHeaders);\r
     HttpHeaders = HeaderTmp;\r
+\r
+    //\r
+    // Check whether the EFI_HTTP_UTILITIES_PROTOCOL is available.\r
+    //\r
+    if (mHttpUtilities == NULL) {\r
+      Status = EFI_NOT_READY;\r
+      goto Error;\r
+    }\r
+    \r
     //\r
     // Parse the HTTP header into array of key/value pairs.\r
     //\r
-    Status = HttpUtilitiesParse (HttpHeaders, SizeofHeaders, &HttpMsg->Headers, &HttpMsg->HeaderCount);\r
+    Status = mHttpUtilities->Parse (\r
+                               mHttpUtilities, \r
+                               HttpHeaders, \r
+                               SizeofHeaders, \r
+                               &HttpMsg->Headers, \r
+                               &HttpMsg->HeaderCount\r
+                               );\r
     if (EFI_ERROR (Status)) {\r
       goto Error;\r
     }\r