Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2016-04-15 23:12:19 +0300
committerAdam Langley <agl@google.com>2016-04-15 23:31:05 +0300
commit26993ad55eda0763990fdd11db929043761b56e1 (patch)
treebeaef4d27d8306c4b2ca65457ae2ef96037363c6 /crypto/bio
parent919610b4c43ab394977eba70ceec66aaa0070472 (diff)
Only use recv/send for socket BIOs on Windows.
In OpenSSL, socket BIOs only used recv/send on Windows and read/write on POSIX. Align our socket BIOs with that behavior. This should be a no-op, but avoids frustrating consumers overly sensitive to the syscalls used now that SSL_set_fd has switched to socket BIOs to align with OpenSSL. b/28138582. Change-Id: Id4870ef8e668e587d6ef51c5b5f21e03af66a288 Reviewed-on: https://boringssl-review.googlesource.com/7686 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/socket.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/bio/socket.c b/crypto/bio/socket.c
index 98f32a62..3ef69674 100644
--- a/crypto/bio/socket.c
+++ b/crypto/bio/socket.c
@@ -110,7 +110,11 @@ static int sock_read(BIO *b, char *out, int outl) {
}
bio_clear_socket_error();
+#if defined(OPENSSL_WINDOWS)
ret = recv(b->num, out, outl, 0);
+#else
+ ret = read(b->num, out, outl);
+#endif
BIO_clear_retry_flags(b);
if (ret <= 0) {
if (bio_fd_should_retry(ret)) {
@@ -124,7 +128,11 @@ static int sock_write(BIO *b, const char *in, int inl) {
int ret;
bio_clear_socket_error();
+#if defined(OPENSSL_WINDOWS)
ret = send(b->num, in, inl, 0);
+#else
+ ret = write(b->num, in, inl);
+#endif
BIO_clear_retry_flags(b);
if (ret <= 0) {
if (bio_fd_should_retry(ret)) {