diff options
author | Alexander Færøy <ahf@torproject.org> | 2020-07-14 14:47:48 +0000 |
---|---|---|
committer | Alexander Færøy <ahf@torproject.org> | 2020-07-14 14:47:48 +0000 |
commit | 07f3345e11530b14c719f8a776f15b943d2fef91 (patch) | |
tree | 27ac4c7956414fa3171fae5ad97f180d2bab6786 /src/lib/tls | |
parent | 515d4f1e93bcf9160c8b41d5a90b3144388f706f (diff) | |
parent | 40eb6b19a33f1261168e5d64ba162d6f7d80e5a1 (diff) | |
download | tor-07f3345e11530b14c719f8a776f15b943d2fef91.tar.gz tor-07f3345e11530b14c719f8a776f15b943d2fef91.zip |
Merge remote-tracking branch 'tor-gitlab/merge-requests/43' into maint-0.4.4
Diffstat (limited to 'src/lib/tls')
-rw-r--r-- | src/lib/tls/tortls_nss.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/tls/tortls_nss.c b/src/lib/tls/tortls_nss.c index adbfcad0a4..c873367f6f 100644 --- a/src/lib/tls/tortls_nss.c +++ b/src/lib/tls/tortls_nss.c @@ -431,6 +431,16 @@ tor_tls_new(tor_socket_t sock, int is_server) return NULL; } + /* even if though the socket is already nonblocking, we need to tell NSS + * about the fact, so that it knows what to do when it says EAGAIN. */ + PRSocketOptionData data; + data.option = PR_SockOpt_Nonblocking; + data.value.non_blocking = 1; + if (PR_SetSocketOption(ssl, &data) != PR_SUCCESS) { + PR_Close(ssl); + return NULL; + } + tor_tls_t *tls = tor_malloc_zero(sizeof(tor_tls_t)); tls->magic = TOR_TLS_MAGIC; tls->context = ctx; |