MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / EfiHttpRequest

Function EfiHttpRequest

NetworkPkg/HttpDxe/HttpImpl.c:226–717  ·  view source on GitHub ↗

The Request() function queues an HTTP request to this HTTP instance. Similar to Transmit() function in the EFI TCP driver. When the HTTP request is sent successfully, or if there is an error, Status in token will be updated and Event will be signaled. @param[in] This Pointer to EFI_HTTP_PROTOCOL instance. @param[in] Token Pointer to storage contain

Source from the content-addressed store, hash-verified

224 Request()has not been completed successfully.
225**/
226EFI_STATUS
227EFIAPI
228EfiHttpRequest (
229 IN EFI_HTTP_PROTOCOL *This,
230 IN EFI_HTTP_TOKEN *Token
231 )
232{
233 EFI_HTTP_MESSAGE *HttpMsg;
234 EFI_HTTP_REQUEST_DATA *Request;
235 VOID *UrlParser;
236 EFI_STATUS Status;
237 CHAR8 *HostName;
238 UINTN HostNameSize;
239 UINT16 RemotePort;
240 HTTP_PROTOCOL *HttpInstance;
241 BOOLEAN Configure;
242 BOOLEAN ReConfigure;
243 BOOLEAN TlsConfigure;
244 CHAR8 *RequestMsg;
245 CHAR8 *Url;
246 UINTN UrlLen;
247 CHAR16 *HostNameStr;
248 HTTP_TOKEN_WRAP *Wrap;
249 CHAR8 *FileUrl;
250 UINTN RequestMsgSize;
251 EFI_HANDLE ImageHandle;
252
253 //
254 // Initializations
255 //
256 Url = NULL;
257 UrlParser = NULL;
258 RemotePort = 0;
259 HostName = NULL;
260 RequestMsg = NULL;
261 HostNameStr = NULL;
262 Wrap = NULL;
263 FileUrl = NULL;
264 TlsConfigure = FALSE;
265
266 if ((This == NULL) || (Token == NULL)) {
267 return EFI_INVALID_PARAMETER;
268 }
269
270 HttpMsg = Token->Message;
271 if (HttpMsg == NULL) {
272 return EFI_INVALID_PARAMETER;
273 }
274
275 Request = HttpMsg->Data.Request;
276
277 //
278 // Only support GET, HEAD, DELETE, PATCH, PUT and POST method in current implementation.
279 //
280 if ((Request != NULL) && (Request->Method != HttpMethodGet) &&
281 (Request->Method != HttpMethodHead) && (Request->Method != HttpMethodDelete) &&
282 (Request->Method != HttpMethodPut) && (Request->Method != HttpMethodPost) &&
283 (Request->Method != HttpMethodPatch)) {

Callers

nothing calls this directly

Calls 15

IsHttpsUrlFunction · 0.85
TlsCreateChildFunction · 0.85
AsciiStrLenFunction · 0.85
AsciiStrSizeFunction · 0.85
AsciiStrCmpFunction · 0.85
HttpCreateTcpTxEventFunction · 0.85
AsciiStrToUnicodeStrSFunction · 0.85
HttpDns4Function · 0.85
HttpDns6Function · 0.85
TlsCloseSessionFunction · 0.85
TlsCloseTxRxEventFunction · 0.85
HttpCloseConnectionFunction · 0.85

Tested by

no test coverage detected