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

Function HttpCleanProtocol

NetworkPkg/HttpDxe/HttpProto.c:833–943  ·  view source on GitHub ↗

Clean up the HTTP child, release all the resources used by it. @param[in] HttpInstance The HTTP child to clean up. **/

Source from the content-addressed store, hash-verified

831
832**/
833VOID
834HttpCleanProtocol (
835 IN HTTP_PROTOCOL *HttpInstance
836 )
837{
838 HttpCloseConnection (HttpInstance);
839
840 HttpCloseTcpConnCloseEvent (HttpInstance);
841
842 if (HttpInstance->TimeoutEvent != NULL) {
843 gBS->CloseEvent (HttpInstance->TimeoutEvent);
844 HttpInstance->TimeoutEvent = NULL;
845 }
846
847 if (HttpInstance->CacheBody != NULL) {
848 FreePool (HttpInstance->CacheBody);
849 HttpInstance->CacheBody = NULL;
850 HttpInstance->NextMsg = NULL;
851 }
852
853 if (HttpInstance->RemoteHost != NULL) {
854 FreePool (HttpInstance->RemoteHost);
855 HttpInstance->RemoteHost = NULL;
856 }
857
858 if (HttpInstance->MsgParser != NULL) {
859 HttpFreeMsgParser (HttpInstance->MsgParser);
860 HttpInstance->MsgParser = NULL;
861 }
862
863 if (HttpInstance->Url != NULL) {
864 FreePool (HttpInstance->Url);
865 HttpInstance->Url = NULL;
866 }
867
868 NetMapClean (&HttpInstance->TxTokens);
869 NetMapClean (&HttpInstance->RxTokens);
870
871 if (HttpInstance->TlsSb != NULL && HttpInstance->TlsChildHandle != NULL) {
872 //
873 // Destroy the TLS instance.
874 //
875 HttpInstance->TlsSb->DestroyChild (HttpInstance->TlsSb, HttpInstance->TlsChildHandle);
876 }
877
878 if (HttpInstance->Tcp4ChildHandle != NULL) {
879 gBS->CloseProtocol (
880 HttpInstance->Tcp4ChildHandle,
881 &gEfiTcp4ProtocolGuid,
882 HttpInstance->Service->Ip4DriverBindingHandle,
883 HttpInstance->Service->ControllerHandle
884 );
885
886 gBS->CloseProtocol (
887 HttpInstance->Tcp4ChildHandle,
888 &gEfiTcp4ProtocolGuid,
889 HttpInstance->Service->Ip4DriverBindingHandle,
890 HttpInstance->Handle

Callers 2

EfiHttpConfigureFunction · 0.85

Calls 7

HttpCloseConnectionFunction · 0.85
TlsCloseTxRxEventFunction · 0.85
FreePoolFunction · 0.50
HttpFreeMsgParserFunction · 0.50
NetMapCleanFunction · 0.50

Tested by

no test coverage detected