Bug 948725 - Invoke |QuitPumpingEvent| after response packet is received. r=jduell
authorShih-Chiang Chien <schien@mozilla.com>
Thu, 30 Jan 2014 10:59:15 -0500
changeset 181994 c113e2615e8f9d8fd0d76ff8d5f16b3b991f642a
parent 181993 1a4489b84a4e940e6b40548af14a150334203932
child 181995 11fe654f16d844f16ba922beaaf52bab01c450ce
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell
bugs948725
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 948725 - Invoke |QuitPumpingEvent| after response packet is received. r=jduell
netwerk/test/TestUDPSocket.cpp
--- a/netwerk/test/TestUDPSocket.cpp
+++ b/netwerk/test/TestUDPSocket.cpp
@@ -109,16 +109,17 @@ UDPClientListener::OnPacketReceived(nsIU
     printf("*** Attempting to write response 0x%x to server by SendWithAddr...\n", RESPONSE);
     mResult = socket->SendWithAddr(fromAddr, (const uint8_t*)&data,
                                    sizeof(uint32_t), &count);
     if (mResult == NS_OK && count == sizeof(uint32_t)) {
       passed("Response written");
     } else {
       fail("Response written");
     }
+    return NS_OK;
   } else if (TEST_OUTPUT_STREAM != phase || !CheckMessageContent(message, RESPONSE)) {
     mResult = NS_ERROR_FAILURE;
   }
 
   // Notify thread
   QuitPumpingEvents();
   return NS_OK;
 }
@@ -173,20 +174,23 @@ UDPServerListener::OnPacketReceived(nsIU
     printf("*** Attempting to write response 0x%x to client by OutputStream...\n", RESPONSE);
     mResult = outstream->Write((const char*)&data, sizeof(uint32_t), &count);
 
     if (mResult == NS_OK && count == sizeof(uint32_t)) {
       passed("Response written");
     } else {
       fail("Response written");
     }
+    return NS_OK;
   } else if (TEST_SEND_API != phase || !CheckMessageContent(message, RESPONSE)) {
     mResult = NS_ERROR_FAILURE;
   }
 
+  // Notify thread
+  QuitPumpingEvents();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 UDPServerListener::OnStopListening(nsIUDPSocket*, nsresult)
 {
   QuitPumpingEvents();
   return NS_OK;