diff options
author | Roger Dingledine <arma@torproject.org> | 2003-10-19 00:39:48 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2003-10-19 00:39:48 +0000 |
commit | ec96419109aa0a53d3f2fe2fe9f41bb590115109 (patch) | |
tree | e8ee2b70b8953d85475e29458b9554a9d6d476dd /src/common/tortls.c | |
parent | c627ba26323f236afd549fefeb9dd52263065902 (diff) | |
download | tor-ec96419109aa0a53d3f2fe2fe9f41bb590115109.tar.gz tor-ec96419109aa0a53d3f2fe2fe9f41bb590115109.zip |
let tls tolerate reallocing the buf
and also remember the params for ssl_write if it returns wantread.
svn:r626
Diffstat (limited to 'src/common/tortls.c')
-rw-r--r-- | src/common/tortls.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c index 138ff85871..75a7f7704a 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -263,7 +263,8 @@ tor_tls_context_new(crypto_pk_env_t *rsa, crypto_dh_free(dh); SSL_CTX_set_verify(result->ctx, SSL_VERIFY_PEER, always_accept_verify_cb); - + /* let us realloc bufs that we're writing from */ + SSL_CTX_set_mode(result->ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER); global_tls_context = result; return 0; @@ -358,8 +359,8 @@ tor_tls_write(tor_tls *tls, char *cp, int n) if (err == TOR_TLS_DONE) { return r; } - if (err == TOR_TLS_WANTWRITE) { - log_fn(LOG_INFO,"wantwrite. remembering the number %d.",n); + if (err == TOR_TLS_WANTWRITE || err == TOR_TLS_WANTREAD) { + log_fn(LOG_INFO,"wantwrite or wantread. remembering the number %d.",n); tls->wantwrite_n = n; } return err; |