mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Merge branch 'tor-github/pr/1944'
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
o Major bugfix (TLS, buffer):
|
||||
- When attempting to read N bytes on a TLS connection, really try to read
|
||||
those N bytes. Before that, Tor would stop reading after the first TLS
|
||||
record which can be smaller than N bytes even though more data was waiting
|
||||
on the TLS connection socket. The remaining data would have been read at
|
||||
the next mainloop event. Fixes bug 40006; bugfix on 0.1.0.5-rc.
|
||||
@@ -59,6 +59,9 @@ read_to_chunk_tls(buf_t *buf, chunk_t *chunk, tor_tls_t *tls,
|
||||
* Second, the TLS stream's events do not correspond directly to network
|
||||
* events: sometimes, before a TLS stream can read, the network must be
|
||||
* ready to write -- or vice versa.
|
||||
*
|
||||
* On success, return the number of bytes read. On error, a TOR_TLS_* negative
|
||||
* code is returned (expect any of them except TOR_TLS_DONE).
|
||||
*/
|
||||
int
|
||||
buf_read_from_tls(buf_t *buf, tor_tls_t *tls, size_t at_most)
|
||||
@@ -92,8 +95,6 @@ buf_read_from_tls(buf_t *buf, tor_tls_t *tls, size_t at_most)
|
||||
return r; /* Error */
|
||||
tor_assert(total_read+r <= BUF_MAX_LEN);
|
||||
total_read += r;
|
||||
if ((size_t)r < readlen) /* eof, block, or no more to read. */
|
||||
break;
|
||||
}
|
||||
return (int)total_read;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user