NetworkPkg: Update HttpDxe driver to consume EFI_HTTP_UTILITIES_PROTOCOL
v2: * Register a notification function to be executed for Http utilities protocol in the drivers entry points. Since we add EFI_HTTP_UTILITIES_PROTOCOL support, HttpDxe driver should be updated to remove internal http utilities functions and consume this protocol directly. Cc: Ye Ting <ting.ye@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Samer El-Haj-Mahmoud <elhaj@hp.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18316 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -757,7 +757,8 @@ HttpBodyParserCallback (
|
||||
|
||||
@retval EFI_SUCCESS Allocation succeeded.
|
||||
@retval EFI_OUT_OF_RESOURCES Failed to complete the opration due to lack of resources.
|
||||
@retval EFI_NOT_READY Can't find a corresponding TxToken.
|
||||
@retval EFI_NOT_READY Can't find a corresponding TxToken or
|
||||
the EFI_HTTP_UTILITIES_PROTOCOL is not available.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -953,10 +954,25 @@ HttpResponseWorker (
|
||||
CopyMem (HeaderTmp, Tmp, SizeofHeaders);
|
||||
FreePool (HttpHeaders);
|
||||
HttpHeaders = HeaderTmp;
|
||||
|
||||
//
|
||||
// Check whether the EFI_HTTP_UTILITIES_PROTOCOL is available.
|
||||
//
|
||||
if (mHttpUtilities == NULL) {
|
||||
Status = EFI_NOT_READY;
|
||||
goto Error;
|
||||
}
|
||||
|
||||
//
|
||||
// Parse the HTTP header into array of key/value pairs.
|
||||
//
|
||||
Status = HttpUtilitiesParse (HttpHeaders, SizeofHeaders, &HttpMsg->Headers, &HttpMsg->HeaderCount);
|
||||
Status = mHttpUtilities->Parse (
|
||||
mHttpUtilities,
|
||||
HttpHeaders,
|
||||
SizeofHeaders,
|
||||
&HttpMsg->Headers,
|
||||
&HttpMsg->HeaderCount
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Error;
|
||||
}
|
||||
|
Reference in New Issue
Block a user