]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg:Missing CloseEvent() in HttpResponseWorker
authorNagaraj Hegde <nagaraj-p.hegde@hpe.com>
Fri, 6 Nov 2015 09:35:09 +0000 (09:35 +0000)
committerluobozhang <luobozhang@Edk2>
Fri, 6 Nov 2015 09:35:09 +0000 (09:35 +0000)
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..

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Nagaraj Hegde <nagaraj-p.hegde@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18735 6f19259b-4bc3-4df7-8a09-765794883524

NetworkPkg/HttpDxe/HttpImpl.c

index 30944004ae2a41b0ea3f7627a2f9e38a075d539a..f1e3e5341136b28b5a0ee962041deb806af254a2 100644 (file)
@@ -1130,6 +1130,18 @@ Exit:
   }\r
   Token->Status = Status;\r
   gBS->SignalEvent (Token->Event);\r
+\r
+  if (Wrap != NULL) {\r
+    if (Wrap->TcpWrap.RxToken.CompletionToken.Event != NULL) {\r
+      gBS->CloseEvent (Wrap->TcpWrap.RxToken.CompletionToken.Event);\r
+    }\r
+  }\r
+  \r
+  if (HttpInstance->RxToken.CompletionToken.Event != NULL) {\r
+    gBS->CloseEvent (HttpInstance->RxToken.CompletionToken.Event);\r
+    HttpInstance->RxToken.CompletionToken.Event = NULL;\r
+  }  \r
+  \r
   FreePool (Wrap);\r
   return Status;\r
 \r