summaryrefslogtreecommitdiff
path: root/StdLib/BsdSocketLib
diff options
context:
space:
mode:
authorlpleahy <lpleahy@6f19259b-4bc3-4df7-8a09-765794883524>2011-08-03 17:45:52 +0000
committerlpleahy <lpleahy@6f19259b-4bc3-4df7-8a09-765794883524>2011-08-03 17:45:52 +0000
commit486aace42ca6fd9bd80f80197f0bb24cec99f3b6 (patch)
tree858a7ee19744ce0c0745905b07ca47cde83d1db2 /StdLib/BsdSocketLib
parent1e2b43f1e25fe15a54bb412e6d01fd3607f5eeae (diff)
downloadedk2-platforms-486aace42ca6fd9bd80f80197f0bb24cec99f3b6.tar.xz
Fix send to properly wait while long transmits are in progress
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12083 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'StdLib/BsdSocketLib')
-rw-r--r--StdLib/BsdSocketLib/send.c50
-rw-r--r--StdLib/BsdSocketLib/sendto.c2
2 files changed, 3 insertions, 49 deletions
diff --git a/StdLib/BsdSocketLib/send.c b/StdLib/BsdSocketLib/send.c
index e0ec64367c..f3f739cb6f 100644
--- a/StdLib/BsdSocketLib/send.c
+++ b/StdLib/BsdSocketLib/send.c
@@ -44,54 +44,8 @@ send (
int flags
)
{
- ssize_t LengthInBytes;
- CONST UINT8 * pData;
- struct __filedes * pDescriptor;
- EFI_SOCKET_PROTOCOL * pSocketProtocol;
- EFI_STATUS Status;
-
- //
- // Assume failure
- //
- LengthInBytes = -1;
-
- //
- // Locate the context for this socket
- //
- pSocketProtocol = BslFdToSocketProtocol ( s,
- &pDescriptor,
- &errno );
- if ( NULL != pSocketProtocol ) {
- //
- // Send the data using the socket
- //
- pData = buffer;
- do {
- errno = 0;
- Status = pSocketProtocol->pfnSend ( pSocketProtocol,
- flags,
- length,
- pData,
- (size_t *)&LengthInBytes,
- NULL,
- 0,
- &errno );
- if ( EFI_ERROR ( Status )) {
- LengthInBytes = -1;
- break;
- }
-
- //
- // Account for the data sent
- //
- pData += LengthInBytes;
- length -= LengthInBytes;
- // TODO: Add non-blocking check
- } while (( 0 != length ) && ( EFI_NOT_READY == Status ));
- }
-
//
- // Return the number of data bytes sent, -1 for errors
+ // Send the data
//
- return (INT32)LengthInBytes;
+ return sendto ( s, buffer, length, flags, NULL, 0 );
}
diff --git a/StdLib/BsdSocketLib/sendto.c b/StdLib/BsdSocketLib/sendto.c
index 338eb36eb9..aa6ea8c14a 100644
--- a/StdLib/BsdSocketLib/sendto.c
+++ b/StdLib/BsdSocketLib/sendto.c
@@ -82,7 +82,7 @@ sendto (
to,
tolen,
&errno );
- if ( EFI_ERROR ( Status )) {
+ if ( EFI_ERROR ( Status ) && ( EFI_NOT_READY != Status )) {
LengthInBytes = -1;
break;
}