diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2001-11-12 19:48:42 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2001-11-12 19:48:42 +0000 |
commit | 2dfb79dca84ba8d8c339f2886ca5039455dd4d78 (patch) | |
tree | 9ffbfb7f7e62fb88d098226b2fd02d0acd564e64 | |
parent | 4b29aac4d3d22d79ac6b141d7f7e920ec4966105 (diff) | |
download | ATCD-2dfb79dca84ba8d8c339f2886ca5039455dd4d78.tar.gz |
ChangeLogTag:Mon Nov 12 11:41:35 2001 Ossama Othman <ossama@uci.edu>
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-02a | 14 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 14 | ||||
-rw-r--r-- | ace/SSL/SSL_SOCK_Stream.cpp | 63 |
4 files changed, 94 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog index f4e66c8d75f..b6643df1eb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +Mon Nov 12 11:41:35 2001 Ossama Othman <ossama@uci.edu> + + * ace/SSL/SSL_SOCK_Stream.cpp (send, recv): + + In the va_arg versions of these methods, do not use + send/recv_n() to as the underlying send/recv() method. It + forces unnecessary blocking. + + Corrected return value semantics in versions of these methods + that use loop to send/receive multiple buffers. If data was + sent or received than do not return -1 on error. Instead return + the amount of bytes sent/received. This is necessary to allow + the caller to keep track of sent or received data. + Sun Nov 11 23:50:00 2001 Craig Rodrigues <crodrigu@bbn.com> * tests/Date_Time_Test.cpp: Remove argv variable from diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index f4e66c8d75f..b6643df1eb2 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,17 @@ +Mon Nov 12 11:41:35 2001 Ossama Othman <ossama@uci.edu> + + * ace/SSL/SSL_SOCK_Stream.cpp (send, recv): + + In the va_arg versions of these methods, do not use + send/recv_n() to as the underlying send/recv() method. It + forces unnecessary blocking. + + Corrected return value semantics in versions of these methods + that use loop to send/receive multiple buffers. If data was + sent or received than do not return -1 on error. Instead return + the amount of bytes sent/received. This is necessary to allow + the caller to keep track of sent or received data. + Sun Nov 11 23:50:00 2001 Craig Rodrigues <crodrigu@bbn.com> * tests/Date_Time_Test.cpp: Remove argv variable from diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index f4e66c8d75f..b6643df1eb2 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,17 @@ +Mon Nov 12 11:41:35 2001 Ossama Othman <ossama@uci.edu> + + * ace/SSL/SSL_SOCK_Stream.cpp (send, recv): + + In the va_arg versions of these methods, do not use + send/recv_n() to as the underlying send/recv() method. It + forces unnecessary blocking. + + Corrected return value semantics in versions of these methods + that use loop to send/receive multiple buffers. If data was + sent or received than do not return -1 on error. Instead return + the amount of bytes sent/received. This is necessary to allow + the caller to keep track of sent or received data. + Sun Nov 11 23:50:00 2001 Craig Rodrigues <crodrigu@bbn.com> * tests/Date_Time_Test.cpp: Remove argv variable from diff --git a/ace/SSL/SSL_SOCK_Stream.cpp b/ace/SSL/SSL_SOCK_Stream.cpp index 79ca5bc3a0a..5030e37ae3a 100644 --- a/ace/SSL/SSL_SOCK_Stream.cpp +++ b/ace/SSL/SSL_SOCK_Stream.cpp @@ -130,7 +130,7 @@ ACE_SSL_SOCK_Stream::recvv (iovec *io_vec, { ACE_TRACE ("ACE_SSL_SOCK_Stream::recvv"); - // From <ACE_SOCK_IO::recvv>. + // From ACE_SOCK_IO::recvv(). #if defined (FIONREAD) ACE_Handle_Set handle_set; handle_set.reset (); @@ -238,13 +238,23 @@ ACE_SSL_SOCK_Stream::send (size_t n, ...) const // scatter writes over SSL. for (size_t i = 0; i < total_tuples; ++i) { - ssize_t result = this->send_n (va_arg (argp, char *), - va_arg (argp, ssize_t)); + ssize_t result = this->send (va_arg (argp, char *), + va_arg (argp, ssize_t)); if (result == -1) { - va_end (argp); - return -1; + // There is a subtle difference in behaviour depending on + // whether or not any data was sent. If no data was sent, + // then always return -1. Otherwise return bytes_sent. + // This gives the caller an opportunity to keep track of + // which data was actually sent. + if (bytes_sent > 0) + break; + else + { + va_end (argp); + return -1; + } } else bytes_sent += result; @@ -269,13 +279,23 @@ ACE_SSL_SOCK_Stream::recv (size_t n, ...) const for (size_t i = 0; i < total_tuples; ++i) { - ssize_t result = this->recv_n (va_arg (argp, char *), - va_arg (argp, ssize_t)); + ssize_t result = this->recv (va_arg (argp, char *), + va_arg (argp, ssize_t)); if (result == -1) { - va_end (argp); - return -1; + // There is a subtle difference in behaviour depending on + // whether or not any data was received. If no data was + // received, then always return -1. Otherwise return + // bytes_received. This gives the caller an opportunity to + // keep track of which data was actually received. + if (bytes_recv > 0) + break; + else + { + va_end (argp); + return -1; + } } else bytes_recv += result; @@ -472,8 +492,19 @@ ACE_SSL_SOCK_Stream::sendv_n (const iovec iov[], size_t iovcnt) const ssize_t result = this->send_n (iov[i].iov_base, iov[i].iov_len); + if (result == -1) - return -1; + { + // There is a subtle difference in behaviour depending on + // whether or not any data was sent. If no data was sent, + // then always return -1. Otherwise return bytes_sent. + // This gives the caller an opportunity to keep track of + // which data was actually sent. + if (bytes_sent > 0) + break; + else + return -1; + } else bytes_sent += result; } @@ -494,7 +525,17 @@ ACE_SSL_SOCK_Stream::recvv_n (iovec iov[], size_t iovcnt) const iov[i].iov_len); if (result == -1) - return -1; + { + // There is a subtle difference in behaviour depending on + // whether or not any data was read. If no data was read, + // then always return -1. Otherwise return bytes_read. + // This gives the caller an opportunity to keep track of + // which data was actually read. + if (bytes_read > 0) + break; + else + return -1; + } else bytes_read += result; } |