mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 23:21:38 +01:00
Repair wide lines from previous commit.
This commit is contained in:
parent
4a7e90adc5
commit
d61da9e61f
5 changed files with 20 additions and 13 deletions
|
@ -551,8 +551,9 @@ read_to_chunk(buf_t *buf, chunk_t *chunk, tor_socket_t fd, size_t at_most,
|
||||||
*/
|
*/
|
||||||
/* XXXX indicate "read blocked" somehow? */
|
/* XXXX indicate "read blocked" somehow? */
|
||||||
int
|
int
|
||||||
buf_read_from_socket(tor_socket_t s, size_t at_most, buf_t *buf, int *reached_eof,
|
buf_read_from_socket(tor_socket_t s, size_t at_most, buf_t *buf,
|
||||||
int *socket_error)
|
int *reached_eof,
|
||||||
|
int *socket_error)
|
||||||
{
|
{
|
||||||
/* XXXX It's stupid to overload the return values for these functions:
|
/* XXXX It's stupid to overload the return values for these functions:
|
||||||
* "error status" and "number of bytes read" are not mutually exclusive.
|
* "error status" and "number of bytes read" are not mutually exclusive.
|
||||||
|
@ -637,7 +638,8 @@ flush_chunk(tor_socket_t s, buf_t *buf, chunk_t *chunk, size_t sz,
|
||||||
* -1 on failure. Return 0 if write() would block.
|
* -1 on failure. Return 0 if write() would block.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
buf_flush_to_socket(tor_socket_t s, buf_t *buf, size_t sz, size_t *buf_flushlen)
|
buf_flush_to_socket(tor_socket_t s, buf_t *buf, size_t sz,
|
||||||
|
size_t *buf_flushlen)
|
||||||
{
|
{
|
||||||
/* XXXX It's stupid to overload the return values for these functions:
|
/* XXXX It's stupid to overload the return values for these functions:
|
||||||
* "error status" and "number of bytes flushed" are not mutually exclusive.
|
* "error status" and "number of bytes flushed" are not mutually exclusive.
|
||||||
|
|
|
@ -35,10 +35,12 @@ size_t buf_slack(const buf_t *buf);
|
||||||
uint32_t buf_get_oldest_chunk_timestamp(const buf_t *buf, uint32_t now);
|
uint32_t buf_get_oldest_chunk_timestamp(const buf_t *buf, uint32_t now);
|
||||||
size_t buf_get_total_allocation(void);
|
size_t buf_get_total_allocation(void);
|
||||||
|
|
||||||
int buf_read_from_socket(tor_socket_t s, size_t at_most, buf_t *buf, int *reached_eof,
|
int buf_read_from_socket(tor_socket_t s, size_t at_most, buf_t *buf,
|
||||||
int *socket_error);
|
int *reached_eof,
|
||||||
|
int *socket_error);
|
||||||
|
|
||||||
int buf_flush_to_socket(tor_socket_t s, buf_t *buf, size_t sz, size_t *buf_flushlen);
|
int buf_flush_to_socket(tor_socket_t s, buf_t *buf, size_t sz,
|
||||||
|
size_t *buf_flushlen);
|
||||||
|
|
||||||
int buf_add(const char *string, size_t string_len, buf_t *buf);
|
int buf_add(const char *string, size_t string_len, buf_t *buf);
|
||||||
int buf_add_compress(buf_t *buf, struct tor_compress_state_t *state,
|
int buf_add_compress(buf_t *buf, struct tor_compress_state_t *state,
|
||||||
|
|
|
@ -131,8 +131,8 @@ flush_chunk_tls(tor_tls_t *tls, buf_t *buf, chunk_t *chunk,
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** As buf_flush_to_socket(), but writes data to a TLS connection. Can write more than
|
/** As buf_flush_to_socket(), but writes data to a TLS connection. Can write
|
||||||
* <b>flushlen</b> bytes.
|
* more than <b>flushlen</b> bytes.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
buf_flush_to_tls(tor_tls_t *tls, buf_t *buf, size_t flushlen,
|
buf_flush_to_tls(tor_tls_t *tls, buf_t *buf, size_t flushlen,
|
||||||
|
|
|
@ -127,8 +127,9 @@ static int connection_finished_flushing(connection_t *conn);
|
||||||
static int connection_flushed_some(connection_t *conn);
|
static int connection_flushed_some(connection_t *conn);
|
||||||
static int connection_finished_connecting(connection_t *conn);
|
static int connection_finished_connecting(connection_t *conn);
|
||||||
static int connection_reached_eof(connection_t *conn);
|
static int connection_reached_eof(connection_t *conn);
|
||||||
static int connection_buf_read_from_socket(connection_t *conn, ssize_t *max_to_read,
|
static int connection_buf_read_from_socket(connection_t *conn,
|
||||||
int *socket_error);
|
ssize_t *max_to_read,
|
||||||
|
int *socket_error);
|
||||||
static int connection_process_inbuf(connection_t *conn, int package_partial);
|
static int connection_process_inbuf(connection_t *conn, int package_partial);
|
||||||
static void client_check_address_changed(tor_socket_t sock);
|
static void client_check_address_changed(tor_socket_t sock);
|
||||||
static void set_constrained_socket_buffers(tor_socket_t sock, int size);
|
static void set_constrained_socket_buffers(tor_socket_t sock, int size);
|
||||||
|
@ -3630,8 +3631,9 @@ connection_buf_read_from_socket(connection_t *conn, ssize_t *max_to_read,
|
||||||
/* !connection_speaks_cells, !conn->linked_conn. */
|
/* !connection_speaks_cells, !conn->linked_conn. */
|
||||||
int reached_eof = 0;
|
int reached_eof = 0;
|
||||||
CONN_LOG_PROTECT(conn,
|
CONN_LOG_PROTECT(conn,
|
||||||
result = buf_read_from_socket(conn->s, at_most, conn->inbuf, &reached_eof,
|
result = buf_read_from_socket(conn->s, at_most, conn->inbuf,
|
||||||
socket_error));
|
&reached_eof,
|
||||||
|
socket_error));
|
||||||
if (reached_eof)
|
if (reached_eof)
|
||||||
conn->inbuf_reached_eof = 1;
|
conn->inbuf_reached_eof = 1;
|
||||||
|
|
||||||
|
|
|
@ -855,7 +855,8 @@ conn_close_if_marked(int i)
|
||||||
} else
|
} else
|
||||||
retval = -1; /* never flush non-open broken tls connections */
|
retval = -1; /* never flush non-open broken tls connections */
|
||||||
} else {
|
} else {
|
||||||
retval = buf_flush_to_socket(conn->s, conn->outbuf, sz, &conn->outbuf_flushlen);
|
retval = buf_flush_to_socket(conn->s, conn->outbuf, sz,
|
||||||
|
&conn->outbuf_flushlen);
|
||||||
}
|
}
|
||||||
if (retval >= 0 && /* Technically, we could survive things like
|
if (retval >= 0 && /* Technically, we could survive things like
|
||||||
TLS_WANT_WRITE here. But don't bother for now. */
|
TLS_WANT_WRITE here. But don't bother for now. */
|
||||||
|
|
Loading…
Add table
Reference in a new issue