• Home
  • Raw
  • Download

Lines Matching refs:HttpInstance

56   HTTP_PROTOCOL                 *HttpInstance;  in EfiHttpGetModeData()  local
65 HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This); in EfiHttpGetModeData()
66 ASSERT (HttpInstance != NULL); in EfiHttpGetModeData()
68 if ((HttpInstance->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IPv6Node == NULL) || in EfiHttpGetModeData()
69 (!HttpInstance->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IPv4Node == NULL)) { in EfiHttpGetModeData()
73 if (HttpInstance->State < HTTP_STATE_HTTP_CONFIGED) { in EfiHttpGetModeData()
77 HttpConfigData->HttpVersion = HttpInstance->HttpVersion; in EfiHttpGetModeData()
78 HttpConfigData->TimeOutMillisec = HttpInstance->TimeOutMillisec; in EfiHttpGetModeData()
79 HttpConfigData->LocalAddressIsIPv6 = HttpInstance->LocalAddressIsIPv6; in EfiHttpGetModeData()
81 if (HttpInstance->LocalAddressIsIPv6) { in EfiHttpGetModeData()
84 &HttpInstance->Ipv6Node, in EfiHttpGetModeData()
85 sizeof (HttpInstance->Ipv6Node) in EfiHttpGetModeData()
90 &HttpInstance->IPv4Node, in EfiHttpGetModeData()
91 sizeof (HttpInstance->IPv4Node) in EfiHttpGetModeData()
136 HTTP_PROTOCOL *HttpInstance; in EfiHttpConfigure() local
149 HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This); in EfiHttpConfigure()
150 ASSERT (HttpInstance != NULL && HttpInstance->Service != NULL); in EfiHttpConfigure()
157 if (HttpInstance->State != HTTP_STATE_UNCONFIGED) { in EfiHttpConfigure()
161 HttpInstance->HttpVersion = HttpConfigData->HttpVersion; in EfiHttpConfigure()
162 HttpInstance->TimeOutMillisec = HttpConfigData->TimeOutMillisec; in EfiHttpConfigure()
163 HttpInstance->LocalAddressIsIPv6 = HttpConfigData->LocalAddressIsIPv6; in EfiHttpConfigure()
167 &HttpInstance->Ipv6Node, in EfiHttpConfigure()
169 sizeof (HttpInstance->Ipv6Node) in EfiHttpConfigure()
173 &HttpInstance->IPv4Node, in EfiHttpConfigure()
175 sizeof (HttpInstance->IPv4Node) in EfiHttpConfigure()
182 Status = HttpInitProtocol (HttpInstance, HttpInstance->LocalAddressIsIPv6); in EfiHttpConfigure()
187 HttpInstance->State = HTTP_STATE_HTTP_CONFIGED; in EfiHttpConfigure()
194 HttpCleanProtocol (HttpInstance); in EfiHttpConfigure()
195 HttpInstance->State = HTTP_STATE_UNCONFIGED; in EfiHttpConfigure()
241 HTTP_PROTOCOL *HttpInstance; in EfiHttpRequest() local
285 HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This); in EfiHttpRequest()
286 ASSERT (HttpInstance != NULL); in EfiHttpRequest()
292 HttpInstance->Method = Request->Method; in EfiHttpRequest()
295 if (HttpInstance->State < HTTP_STATE_HTTP_CONFIGED) { in EfiHttpRequest()
303 if ((HttpInstance->Method != HttpMethodPut) && (HttpInstance->Method != HttpMethodPost)) { in EfiHttpRequest()
310 if (HttpInstance->State < HTTP_STATE_TCP_CONFIGED) { in EfiHttpRequest()
330 if (EFI_ERROR (NetMapIterate (&HttpInstance->TxTokens, HttpTokenExist, Token))) { in EfiHttpRequest()
337 Url = HttpInstance->Url; in EfiHttpRequest()
344 FreePool (HttpInstance->Url); in EfiHttpRequest()
345 HttpInstance->Url = Url; in EfiHttpRequest()
355 HttpInstance->UseHttps = IsHttpsUrl (Url); in EfiHttpRequest()
360 if (HttpInstance->UseHttps && HttpInstance->TlsChildHandle == NULL) { in EfiHttpRequest()
364 HttpInstance->TlsChildHandle = TlsCreateChild ( in EfiHttpRequest()
365 HttpInstance->Service->ImageHandle, in EfiHttpRequest()
366 &(HttpInstance->Tls), in EfiHttpRequest()
367 &(HttpInstance->TlsConfiguration) in EfiHttpRequest()
369 if (HttpInstance->TlsChildHandle == NULL) { in EfiHttpRequest()
390 if (HttpInstance->UseHttps) { in EfiHttpRequest()
404 if (HttpInstance->RemoteHost == NULL) { in EfiHttpRequest()
410 if ((HttpInstance->RemotePort == RemotePort) && in EfiHttpRequest()
411 (AsciiStrCmp (HttpInstance->RemoteHost, HostName) == 0) && in EfiHttpRequest()
412 (!HttpInstance->UseHttps || (HttpInstance->UseHttps && in EfiHttpRequest()
414HttpInstance->TlsSessionState == EfiTlsSessionDataTransferring))) { in EfiHttpRequest()
421 if (EFI_ERROR (NetMapIterate (&HttpInstance->TxTokens, HttpTcpNotReady, NULL))) { in EfiHttpRequest()
432 Wrap->HttpInstance = HttpInstance; in EfiHttpRequest()
439 Status = NetMapInsertTail (&HttpInstance->TxTokens, Token, Wrap); in EfiHttpRequest()
463 if (HttpInstance->RemoteHost != NULL) { in EfiHttpRequest()
464 FreePool (HttpInstance->RemoteHost); in EfiHttpRequest()
465 HttpInstance->RemoteHost = NULL; in EfiHttpRequest()
466 HttpInstance->RemotePort = 0; in EfiHttpRequest()
476 if (!HttpInstance->LocalAddressIsIPv6) { in EfiHttpRequest()
477 Status = NetLibAsciiStrToIp4 (HostName, &HttpInstance->RemoteAddr); in EfiHttpRequest()
479 Status = HttpUrlGetIp6 (Url, UrlParser, &HttpInstance->RemoteIpv6Addr); in EfiHttpRequest()
491 if (!HttpInstance->LocalAddressIsIPv6) { in EfiHttpRequest()
492 Status = HttpDns4 (HttpInstance, HostNameStr, &HttpInstance->RemoteAddr); in EfiHttpRequest()
494 Status = HttpDns6 (HttpInstance, HostNameStr, &HttpInstance->RemoteIpv6Addr); in EfiHttpRequest()
506 ASSERT (HttpInstance->RemoteHost == NULL); in EfiHttpRequest()
507 HttpInstance->RemotePort = RemotePort; in EfiHttpRequest()
508 HttpInstance->RemoteHost = HostName; in EfiHttpRequest()
516 if (!HttpInstance->LocalAddressIsIPv6) { in EfiHttpRequest()
517 ASSERT (HttpInstance->Tcp4 != NULL); in EfiHttpRequest()
519 ASSERT (HttpInstance->Tcp6 != NULL); in EfiHttpRequest()
522 if (HttpInstance->UseHttps && !TlsConfigure) { in EfiHttpRequest()
523 Status = TlsCloseSession (HttpInstance); in EfiHttpRequest()
528 TlsCloseTxRxEvent (HttpInstance); in EfiHttpRequest()
531 HttpCloseConnection (HttpInstance); in EfiHttpRequest()
545 Wrap->HttpInstance = HttpInstance; in EfiHttpRequest()
551 HttpInstance, in EfiHttpRequest()
607 Status = NetMapInsertTail (&HttpInstance->TxTokens, Token, Wrap); in EfiHttpRequest()
617 HttpInstance, in EfiHttpRequest()
640 NetMapRemoveTail (&HttpInstance->TxTokens, NULL); in EfiHttpRequest()
649 if (HttpInstance->UseHttps) { in EfiHttpRequest()
650 TlsCloseSession (HttpInstance); in EfiHttpRequest()
651 TlsCloseTxRxEvent (HttpInstance); in EfiHttpRequest()
655 HttpCloseConnection (HttpInstance); in EfiHttpRequest()
657 HttpCloseTcpConnCloseEvent (HttpInstance); in EfiHttpRequest()
703 HTTP_PROTOCOL *HttpInstance; in HttpCancelTokens() local
717 HttpInstance = Wrap->HttpInstance; in HttpCancelTokens()
719 if (!HttpInstance->LocalAddressIsIPv6) { in HttpCancelTokens()
724 HttpInstance->Tcp4->Cancel (HttpInstance->Tcp4, &Wrap->TcpWrap.Rx4Token.CompletionToken); in HttpCancelTokens()
736 HttpInstance->Tcp6->Cancel (HttpInstance->Tcp6, &Wrap->TcpWrap.Rx6Token.CompletionToken); in HttpCancelTokens()
772 IN HTTP_PROTOCOL *HttpInstance, in HttpCancel() argument
781 Status = NetMapIterate (&HttpInstance->TxTokens, HttpCancelTokens, Token); in HttpCancel()
792 if (!HttpInstance->UseHttps) { in HttpCancel()
796 Status = NetMapIterate (&HttpInstance->RxTokens, HttpCancelTokens, Token); in HttpCancel()
809 if (!HttpInstance->LocalAddressIsIPv6) { in HttpCancel()
810HttpInstance->Tcp4->Cancel (HttpInstance->Tcp4, &HttpInstance->Tcp4TlsRxToken.CompletionToken); in HttpCancel()
812HttpInstance->Tcp6->Cancel (HttpInstance->Tcp6, &HttpInstance->Tcp6TlsRxToken.CompletionToken); in HttpCancel()
849 HTTP_PROTOCOL *HttpInstance; in EfiHttpCancel() local
855 HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This); in EfiHttpCancel()
856 ASSERT (HttpInstance != NULL); in EfiHttpCancel()
858 if (HttpInstance->State != HTTP_STATE_TCP_CONNECTED) { in EfiHttpCancel()
862 return HttpCancel (HttpInstance, Token); in EfiHttpCancel()
905 Wrap->HttpInstance->NextMsg = Data; in HttpBodyParserCallback()
907 Wrap->HttpInstance->NextMsg = NULL; in HttpBodyParserCallback()
946 HTTP_PROTOCOL *HttpInstance; in HttpResponseWorker() local
953 if (Wrap == NULL || Wrap->HttpInstance == NULL) { in HttpResponseWorker()
957 HttpInstance = Wrap->HttpInstance; in HttpResponseWorker()
961 HttpInstance->EndofHeader = NULL; in HttpResponseWorker()
962 HttpInstance->HttpHeaders = NULL; in HttpResponseWorker()
976 if ((HttpInstance->CacheBody != NULL) && (HttpInstance->NextMsg != NULL)) { in HttpResponseWorker()
980 HdrLen = HttpInstance->CacheBody + HttpInstance->CacheLen - HttpInstance->NextMsg; in HttpResponseWorker()
987 CopyMem (HttpHeaders, HttpInstance->NextMsg, HdrLen); in HttpResponseWorker()
988 FreePool (HttpInstance->CacheBody); in HttpResponseWorker()
989 HttpInstance->CacheBody = NULL; in HttpResponseWorker()
990 HttpInstance->NextMsg = NULL; in HttpResponseWorker()
991 HttpInstance->CacheOffset = 0; in HttpResponseWorker()
993 BufferSize = HttpInstance->CacheLen; in HttpResponseWorker()
1001 HttpInstance->EndofHeader = &EndofHeader; in HttpResponseWorker()
1002 HttpInstance->HttpHeaders = &HttpHeaders; in HttpResponseWorker()
1005 if (HttpInstance->TimeoutEvent == NULL) { in HttpResponseWorker()
1014 &HttpInstance->TimeoutEvent in HttpResponseWorker()
1024 …Status = gBS->SetTimer (HttpInstance->TimeoutEvent, TimerRelative, HTTP_RESPONSE_TIMEOUT * TICKS_P… in HttpResponseWorker()
1029 …Status = HttpTcpReceiveHeader (HttpInstance, &SizeofHeaders, &BufferSize, HttpInstance->TimeoutEve… in HttpResponseWorker()
1031 gBS->SetTimer (HttpInstance->TimeoutEvent, TimerCancel, 0); in HttpResponseWorker()
1044 if (HttpInstance->CacheBody != NULL) { in HttpResponseWorker()
1045 FreePool (HttpInstance->CacheBody); in HttpResponseWorker()
1048 HttpInstance->CacheBody = AllocateZeroPool (BodyLen); in HttpResponseWorker()
1049 if (HttpInstance->CacheBody == NULL) { in HttpResponseWorker()
1054 CopyMem (HttpInstance->CacheBody, EndofHeader, BodyLen); in HttpResponseWorker()
1055 HttpInstance->CacheLen = BodyLen; in HttpResponseWorker()
1092 HttpInstance->StatusCode = StatusCode; in HttpResponseWorker()
1104 if (!NetMapIsEmpty (&HttpInstance->TxTokens)) { in HttpResponseWorker()
1105 NetMapRemoveHead (&HttpInstance->TxTokens, (VOID**) &ValueInItem); in HttpResponseWorker()
1159 HttpInstance->Method, in HttpResponseWorker()
1165 &HttpInstance->MsgParser in HttpResponseWorker()
1174 if (HttpInstance->CacheBody != NULL) { in HttpResponseWorker()
1175 …Status = HttpParseMessageBody (HttpInstance->MsgParser, HttpInstance->CacheLen, HttpInstance->Cach… in HttpResponseWorker()
1180 if (HttpIsMessageComplete (HttpInstance->MsgParser)) { in HttpResponseWorker()
1184 HttpFreeMsgParser (HttpInstance->MsgParser); in HttpResponseWorker()
1185 HttpInstance->MsgParser = NULL; in HttpResponseWorker()
1204 if (HttpInstance->CacheBody != NULL) { in HttpResponseWorker()
1208 if (HttpInstance->NextMsg != NULL) { in HttpResponseWorker()
1212 BodyLen = HttpInstance->NextMsg - (HttpInstance->CacheBody + HttpInstance->CacheOffset); in HttpResponseWorker()
1214 BodyLen = HttpInstance->CacheLen - HttpInstance->CacheOffset; in HttpResponseWorker()
1222 … CopyMem (HttpMsg->Body, HttpInstance->CacheBody + HttpInstance->CacheOffset, HttpMsg->BodyLength); in HttpResponseWorker()
1223 HttpInstance->CacheOffset = HttpInstance->CacheOffset + HttpMsg->BodyLength; in HttpResponseWorker()
1228 CopyMem (HttpMsg->Body, HttpInstance->CacheBody + HttpInstance->CacheOffset, BodyLen); in HttpResponseWorker()
1229 HttpInstance->CacheOffset = BodyLen + HttpInstance->CacheOffset; in HttpResponseWorker()
1232 if (HttpInstance->NextMsg == NULL) { in HttpResponseWorker()
1236 FreePool (HttpInstance->CacheBody); in HttpResponseWorker()
1237 HttpInstance->CacheBody = NULL; in HttpResponseWorker()
1238 HttpInstance->NextMsg = NULL; in HttpResponseWorker()
1239 HttpInstance->CacheOffset = 0; in HttpResponseWorker()
1249 if (BodyLen == 0 && HttpInstance->MsgParser == NULL) { in HttpResponseWorker()
1259 ASSERT (HttpInstance->MsgParser != NULL); in HttpResponseWorker()
1264 if (!HttpInstance->UseHttps) { in HttpResponseWorker()
1272 if (HttpInstance->TimeoutEvent == NULL) { in HttpResponseWorker()
1281 &HttpInstance->TimeoutEvent in HttpResponseWorker()
1291 …Status = gBS->SetTimer (HttpInstance->TimeoutEvent, TimerRelative, HTTP_RESPONSE_TIMEOUT * TICKS_P… in HttpResponseWorker()
1296 Status = HttpsReceive (HttpInstance, &Fragment, HttpInstance->TimeoutEvent); in HttpResponseWorker()
1298 gBS->SetTimer (HttpInstance->TimeoutEvent, TimerCancel, 0); in HttpResponseWorker()
1308 HttpInstance->MsgParser, in HttpResponseWorker()
1316 if (HttpIsMessageComplete (HttpInstance->MsgParser)) { in HttpResponseWorker()
1320 HttpFreeMsgParser (HttpInstance->MsgParser); in HttpResponseWorker()
1321 HttpInstance->MsgParser = NULL; in HttpResponseWorker()
1327 if (HttpInstance->NextMsg != NULL) { in HttpResponseWorker()
1328 …HttpMsg->BodyLength = MIN ((UINTN) (HttpInstance->NextMsg - (CHAR8 *) Fragment.Bulk), HttpMsg->Bod… in HttpResponseWorker()
1331 HttpInstance->CacheLen = Fragment.Len - HttpMsg->BodyLength; in HttpResponseWorker()
1332 if (HttpInstance->CacheLen != 0) { in HttpResponseWorker()
1333 if (HttpInstance->CacheBody != NULL) { in HttpResponseWorker()
1334 FreePool (HttpInstance->CacheBody); in HttpResponseWorker()
1337 HttpInstance->CacheBody = AllocateZeroPool (HttpInstance->CacheLen); in HttpResponseWorker()
1338 if (HttpInstance->CacheBody == NULL) { in HttpResponseWorker()
1343 … CopyMem (HttpInstance->CacheBody, Fragment.Bulk + HttpMsg->BodyLength, HttpInstance->CacheLen); in HttpResponseWorker()
1344 HttpInstance->CacheOffset = 0; in HttpResponseWorker()
1346HttpInstance->NextMsg = HttpInstance->CacheBody + (UINTN) (HttpInstance->NextMsg - (CHAR8 *) (Frag… in HttpResponseWorker()
1351 HttpInstance->CacheLen = Fragment.Len - HttpMsg->BodyLength; in HttpResponseWorker()
1352 if (HttpInstance->CacheLen != 0) { in HttpResponseWorker()
1353 if (HttpInstance->CacheBody != NULL) { in HttpResponseWorker()
1354 FreePool (HttpInstance->CacheBody); in HttpResponseWorker()
1357 HttpInstance->CacheBody = AllocateZeroPool (HttpInstance->CacheLen); in HttpResponseWorker()
1358 if (HttpInstance->CacheBody == NULL) { in HttpResponseWorker()
1363 … CopyMem (HttpInstance->CacheBody, Fragment.Bulk + HttpMsg->BodyLength, HttpInstance->CacheLen); in HttpResponseWorker()
1364 HttpInstance->CacheOffset = 0; in HttpResponseWorker()
1379 Item = NetMapFindKey (&Wrap->HttpInstance->RxTokens, Wrap->HttpToken); in HttpResponseWorker()
1381 NetMapRemoveItem (&Wrap->HttpInstance->RxTokens, Item, NULL); in HttpResponseWorker()
1384 if (HttpInstance->StatusCode >= HTTP_ERROR_OR_NOT_SUPPORT_STATUS_CODE) { in HttpResponseWorker()
1397 NetMapInsertHead (&HttpInstance->TxTokens, ValueInItem->HttpToken, ValueInItem); in HttpResponseWorker()
1401 Item = NetMapFindKey (&Wrap->HttpInstance->RxTokens, Wrap->HttpToken); in HttpResponseWorker()
1403 NetMapRemoveItem (&Wrap->HttpInstance->RxTokens, Item, NULL); in HttpResponseWorker()
1406 if (!HttpInstance->UseHttps) { in HttpResponseWorker()
1427 if (HttpInstance->CacheBody != NULL) { in HttpResponseWorker()
1428 FreePool (HttpInstance->CacheBody); in HttpResponseWorker()
1429 HttpInstance->CacheBody = NULL; in HttpResponseWorker()
1432 if (HttpInstance->StatusCode >= HTTP_ERROR_OR_NOT_SUPPORT_STATUS_CODE) { in HttpResponseWorker()
1501 HTTP_PROTOCOL *HttpInstance; in EfiHttpResponse() local
1513 HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This); in EfiHttpResponse()
1514 ASSERT (HttpInstance != NULL); in EfiHttpResponse()
1516 if (HttpInstance->State != HTTP_STATE_TCP_CONNECTED) { in EfiHttpResponse()
1523 if (EFI_ERROR (NetMapIterate (&HttpInstance->RxTokens, HttpTokenExist, Token))) { in EfiHttpResponse()
1532 Wrap->HttpInstance = HttpInstance; in EfiHttpResponse()
1540 if (!HttpInstance->UseHttps) { in EfiHttpResponse()
1547 Status = NetMapInsertTail (&HttpInstance->RxTokens, Token, Wrap); in EfiHttpResponse()
1555 if (NetMapGetCount (&HttpInstance->RxTokens) > 1) { in EfiHttpResponse()
1603 HTTP_PROTOCOL *HttpInstance; in EfiHttpPoll() local
1609 HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This); in EfiHttpPoll()
1610 ASSERT (HttpInstance != NULL); in EfiHttpPoll()
1612 if (HttpInstance->State != HTTP_STATE_TCP_CONNECTED) { in EfiHttpPoll()
1616 if (HttpInstance->LocalAddressIsIPv6) { in EfiHttpPoll()
1617 if (HttpInstance->Tcp6 == NULL) { in EfiHttpPoll()
1620 Status = HttpInstance->Tcp6->Poll (HttpInstance->Tcp6); in EfiHttpPoll()
1622 if (HttpInstance->Tcp4 == NULL) { in EfiHttpPoll()
1625 Status = HttpInstance->Tcp4->Poll (HttpInstance->Tcp4); in EfiHttpPoll()