//\r
// All boot informations are valid here.\r
//\r
- AsciiPrint ("\n URI: %a", Private->BootFileUri);\r
\r
//\r
// Update the device path to include the IP and boot URI information.\r
//\r
// All boot informations are valid here.\r
//\r
- AsciiPrint ("\n URI: %a", Private->BootFileUri);\r
+\r
//\r
// Update the device path to include the IP and boot URI information.\r
//\r
return Status;\r
}\r
\r
+/**\r
+ HttpIo Callback function which will be invoked when specified HTTP_IO_CALLBACK_EVENT happened.\r
+\r
+ @param[in] EventType Indicate the Event type that occurs in the current callback.\r
+ @param[in] Message HTTP message which will be send to, or just received from HTTP server.\r
+ @param[in] Context The Callback Context pointer.\r
+ \r
+ @retval EFI_SUCCESS Tells the HttpIo to continue the HTTP process.\r
+ @retval Others Tells the HttpIo to abort the current HTTP process.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+HttpBootHttpIoCallback (\r
+ IN HTTP_IO_CALLBACK_EVENT EventType,\r
+ IN EFI_HTTP_MESSAGE *Message,\r
+ IN VOID *Context\r
+ )\r
+{\r
+ HTTP_BOOT_PRIVATE_DATA *Private;\r
+ EFI_STATUS Status;\r
+ Private = (HTTP_BOOT_PRIVATE_DATA *) Context;\r
+ if (Private->HttpBootCallback != NULL) {\r
+ Status = Private->HttpBootCallback->Callback (\r
+ Private->HttpBootCallback,\r
+ EventType == HttpIoRequest ? HttpBootHttpRequest : HttpBootHttpResponse,\r
+ EventType == HttpIoRequest ? FALSE : TRUE,\r
+ sizeof (EFI_HTTP_MESSAGE),\r
+ (VOID *) Message\r
+ );\r
+ return Status;\r
+ }\r
+ return EFI_SUCCESS;\r
+}\r
+\r
/**\r
Create a HttpIo instance for the file download.\r
\r
Private->Controller,\r
Private->UsingIpv6 ? IP_VERSION_6 : IP_VERSION_4,\r
&ConfigData,\r
+ HttpBootHttpIoCallback,\r
+ (VOID *) Private,\r
&Private->HttpIo\r
);\r
if (EFI_ERROR (Status)) {\r
{\r
HTTP_BOOT_CALLBACK_DATA *CallbackData;\r
HTTP_BOOT_ENTITY_DATA *NewEntityData;\r
+ EFI_STATUS Status;\r
+ EFI_HTTP_BOOT_CALLBACK_PROTOCOL *HttpBootCallback;\r
\r
//\r
// We only care about the entity data.\r
}\r
\r
CallbackData = (HTTP_BOOT_CALLBACK_DATA *) Context;\r
+ HttpBootCallback = CallbackData->Private->HttpBootCallback;\r
+ if (HttpBootCallback != NULL) {\r
+ Status = HttpBootCallback->Callback (\r
+ HttpBootCallback,\r
+ HttpBootHttpEntityBody,\r
+ TRUE,\r
+ (UINT32)Length,\r
+ Data\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+ }\r
//\r
// Copy data if caller has provided a buffer.\r
//\r
Context.Buffer = Buffer;\r
Context.BufferSize = *BufferSize;\r
Context.Cache = Cache;\r
+ Context.Private = Private;\r
Status = HttpInitMsgParser (\r
HeaderOnly? HttpMethodHead : HttpMethodGet,\r
ResponseData->Response.StatusCode,\r
goto ERROR_6;\r
}\r
ReceivedSize += ResponseBody.BodyLength;\r
+ if (Private->HttpBootCallback != NULL) {\r
+ Status = Private->HttpBootCallback->Callback (\r
+ Private->HttpBootCallback,\r
+ HttpBootHttpEntityBody,\r
+ TRUE,\r
+ (UINT32)ResponseBody.BodyLength,\r
+ ResponseBody.Body\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ goto ERROR_6;\r
+ }\r
+ }\r
}\r
} else {\r
//\r