From ba82c72fc4d4f9230d3bf5d0a69b14e44d5105cf Mon Sep 17 00:00:00 2001 From: Nagaraj Hegde Date: Wed, 18 Nov 2015 08:34:44 +0000 Subject: NetworkPkg:Missing CloseEvent() in HttpResponseWorker Two additional scenarios in which CloseEvent() needs to be called: When sending a request to http server using HTTP Head method, if the process is success, we did a response call, and then go to exit without close the event in Rxtoken in wrap structure and in httpinstance struceure, so another call() to response using http get method to receive http header, those events are not closed either.. (Sync patch r18735 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Nagaraj Hegde Reviewed-by: Fu Siyuan Reviewed-by: Zhang Lubo git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18873 6f19259b-4bc3-4df7-8a09-765794883524 --- NetworkPkg/HttpDxe/HttpImpl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'NetworkPkg') diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index 09ee379150..de3ec9c284 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.c +++ b/NetworkPkg/HttpDxe/HttpImpl.c @@ -1131,6 +1131,18 @@ Exit: } Token->Status = Status; gBS->SignalEvent (Token->Event); + + if (Wrap != NULL) { + if (Wrap->TcpWrap.RxToken.CompletionToken.Event != NULL) { + gBS->CloseEvent (Wrap->TcpWrap.RxToken.CompletionToken.Event); + } + } + + if (HttpInstance->RxToken.CompletionToken.Event != NULL) { + gBS->CloseEvent (HttpInstance->RxToken.CompletionToken.Event); + HttpInstance->RxToken.CompletionToken.Event = NULL; + } + FreePool (Wrap); return Status; -- cgit v1.2.3