Revision: 14984
          http://sourceforge.net/p/edk2/code/14984
Author:   lpleahy
Date:     2013-12-13 19:22:39 +0000 (Fri, 13 Dec 2013)
Log Message:
-----------
Fix the non-blocking behavior for connect.  The behavior was correct if the 
code polled the connect routine but was not correct when using select to 
complete the asynchronous request.  This change fixes the select case by moving 
where some of the operations performed upon the connection completion.

Signed-off-by: lpleahy  [email protected]
Reviewed-by: Daniel Moura  [email protected]

Modified Paths:
--------------
    trunk/edk2/StdLib/EfiSocketLib/Socket.c
    trunk/edk2/StdLib/EfiSocketLib/Tcp4.c
    trunk/edk2/StdLib/EfiSocketLib/Tcp6.c

Modified: trunk/edk2/StdLib/EfiSocketLib/Socket.c
===================================================================
--- trunk/edk2/StdLib/EfiSocketLib/Socket.c     2013-12-13 18:45:43 UTC (rev 
14983)
+++ trunk/edk2/StdLib/EfiSocketLib/Socket.c     2013-12-13 19:22:39 UTC (rev 
14984)
@@ -1825,15 +1825,7 @@
           //  Set the next state if connected
           //
           if ( EFI_NOT_READY != Status ) {
-            if ( !EFI_ERROR ( Status )) {
-              pSocket->State = SOCKET_STATE_CONNECTED;
-
-              //
-              //  Start the receive operations
-              //
-              EslSocketRxStart ( pSocket->pPortList );
-            }
-            else {
+            if ( EFI_ERROR ( Status )) {
               pSocket->State = SOCKET_STATE_BOUND;
             }
           }
@@ -5141,7 +5133,7 @@
   <ul>
     <li>::EslIp4Receive to restart the receive engine to release flow 
control.</li>
     <li>::EslIp4RxComplete to continue the operation of the receive engine if 
flow control is not being applied.</li>
-    <li>::EslIp4SocketIsConfigured to start the recevie engine for the new 
socket.</li>
+    <li>::EslIp4SocketIsConfigured to start the receive engine for the new 
socket.</li>
     <li>::EslTcp4ListenComplete to start the recevie engine for the new 
socket.</li>
     <li>::EslTcp4Receive to restart the receive engine to release flow 
control.</li>
     <li>::EslTcp4RxComplete to continue the operation of the receive engine if 
flow control is not being applied.</li>

Modified: trunk/edk2/StdLib/EfiSocketLib/Tcp4.c
===================================================================
--- trunk/edk2/StdLib/EfiSocketLib/Tcp4.c       2013-12-13 18:45:43 UTC (rev 
14983)
+++ trunk/edk2/StdLib/EfiSocketLib/Tcp4.c       2013-12-13 19:22:39 UTC (rev 
14984)
@@ -233,6 +233,13 @@
               pTcp4->ConfigData.AccessPoint.RemotePort ));
 
     //
+    //  Start the receive operations
+    //
+    pSocket->bConfigured = TRUE;
+    pSocket->State = SOCKET_STATE_CONNECTED;
+    EslSocketRxStart ( pPort );
+
+    //
     //  Remove the rest of the ports
     //
     bRemovePorts = TRUE;
@@ -416,7 +423,6 @@
 
     case EFI_SUCCESS:
       pSocket->errno = 0;
-      pSocket->bConfigured = TRUE;
       break;
 
     case EFI_TIMEOUT:

Modified: trunk/edk2/StdLib/EfiSocketLib/Tcp6.c
===================================================================
--- trunk/edk2/StdLib/EfiSocketLib/Tcp6.c       2013-12-13 18:45:43 UTC (rev 
14983)
+++ trunk/edk2/StdLib/EfiSocketLib/Tcp6.c       2013-12-13 19:22:39 UTC (rev 
14984)
@@ -239,6 +239,13 @@
               pTcp6->ConfigData.AccessPoint.RemotePort ));
 
     //
+    //  Start the receive operations
+    //
+    pSocket->bConfigured = TRUE;
+    pSocket->State = SOCKET_STATE_CONNECTED;
+    EslSocketRxStart ( pPort );
+
+    //
     //  Remove the rest of the ports
     //
     bRemovePorts = TRUE;
@@ -434,7 +441,6 @@
       
       case EFI_SUCCESS:
         pSocket->errno = 0;
-        pSocket->bConfigured = TRUE;
         break;
       
       case EFI_TIMEOUT:

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to