diff options
author | lpleahy leroy.p.leahy <lpleahy leroy.p.leahy@intel.com> | 2013-12-13 19:22:39 +0000 |
---|---|---|
committer | lpleahy <lpleahy@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-12-13 19:22:39 +0000 |
commit | ceecdc62ab73e5b726630345865a512c780c134e (patch) | |
tree | 4ea89896d73b05d38295db368d821e8c13ab75a3 /StdLib/EfiSocketLib | |
parent | daf705847f33db1f7a17c1c5b2a01d8f8ccba0ac (diff) | |
download | edk2-ceecdc62ab73e5b726630345865a512c780c134e.tar.gz edk2-ceecdc62ab73e5b726630345865a512c780c134e.tar.bz2 edk2-ceecdc62ab73e5b726630345865a512c780c134e.zip |
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 leroy.p.leahy@intel.com
Reviewed-by: Daniel Moura oxesoft@gmail.com
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14984 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'StdLib/EfiSocketLib')
-rw-r--r-- | StdLib/EfiSocketLib/Socket.c | 12 | ||||
-rw-r--r-- | StdLib/EfiSocketLib/Tcp4.c | 8 | ||||
-rw-r--r-- | StdLib/EfiSocketLib/Tcp6.c | 8 |
3 files changed, 16 insertions, 12 deletions
diff --git a/StdLib/EfiSocketLib/Socket.c b/StdLib/EfiSocketLib/Socket.c index b8011951b4..c7084a1a09 100644 --- a/StdLib/EfiSocketLib/Socket.c +++ b/StdLib/EfiSocketLib/Socket.c @@ -1825,15 +1825,7 @@ EslSocketConnect ( // 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 @@ EslSocketRxPoll ( <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>
diff --git a/StdLib/EfiSocketLib/Tcp4.c b/StdLib/EfiSocketLib/Tcp4.c index 4ef46283b4..7ece38d521 100644 --- a/StdLib/EfiSocketLib/Tcp4.c +++ b/StdLib/EfiSocketLib/Tcp4.c @@ -233,6 +233,13 @@ EslTcp4ConnectComplete ( 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 @@ EslTcp4ConnectPoll ( case EFI_SUCCESS:
pSocket->errno = 0;
- pSocket->bConfigured = TRUE;
break;
case EFI_TIMEOUT:
diff --git a/StdLib/EfiSocketLib/Tcp6.c b/StdLib/EfiSocketLib/Tcp6.c index b2e5538daf..21c4109d6e 100644 --- a/StdLib/EfiSocketLib/Tcp6.c +++ b/StdLib/EfiSocketLib/Tcp6.c @@ -239,6 +239,13 @@ EslTcp6ConnectComplete ( 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 @@ EslTcp6ConnectPoll ( case EFI_SUCCESS:
pSocket->errno = 0;
- pSocket->bConfigured = TRUE;
break;
case EFI_TIMEOUT:
|