Tor
0.4.7.0-alpha-dev
|
Header file for buffers_net.c. More...
Go to the source code of this file.
Functions | |
int | buf_read_from_socket (struct buf_t *buf, tor_socket_t s, size_t at_most, int *reached_eof, int *socket_error) |
int | buf_flush_to_socket (struct buf_t *buf, tor_socket_t s, size_t sz) |
int | buf_read_from_pipe (struct buf_t *buf, int fd, size_t at_most, int *reached_eof, int *socket_error) |
int | buf_flush_to_pipe (struct buf_t *buf, int fd, size_t sz) |
Header file for buffers_net.c.
Definition in file buffers_net.h.
int buf_flush_to_pipe | ( | buf_t * | buf, |
int | fd, | ||
size_t | sz | ||
) |
Write data from buf to the pipe fd. Write at most sz bytes, decrement *buf_flushlen by the number of bytes actually written, and remove the written bytes from the buffer. Return the number of bytes written on success, -1 on failure. Return 0 if write() would block.
Definition at line 249 of file buffers_net.c.
int buf_flush_to_socket | ( | buf_t * | buf, |
tor_socket_t | s, | ||
size_t | sz | ||
) |
Write data from buf to the socket s. Write at most sz bytes, decrement *buf_flushlen by the number of bytes actually written, and remove the written bytes from the buffer. Return the number of bytes written on success, -1 on failure. Return 0 if write() would block.
Definition at line 224 of file buffers_net.c.
int buf_read_from_pipe | ( | buf_t * | buf, |
int | fd, | ||
size_t | at_most, | ||
int * | reached_eof, | ||
int * | socket_error | ||
) |
Read from pipe fd, writing onto end of buf. Read at most at_most bytes, growing the buffer as necessary. If read() returns 0 (because of EOF), set *reached_eof to 1 and return 0. Return -1 on error; else return the number of bytes read.
Definition at line 260 of file buffers_net.c.
Referenced by process_unix_read_handle().
int buf_read_from_socket | ( | buf_t * | buf, |
tor_socket_t | s, | ||
size_t | at_most, | ||
int * | reached_eof, | ||
int * | socket_error | ||
) |
Read from socket s, writing onto end of buf. Read at most at_most bytes, growing the buffer as necessary. If recv() returns 0 (because of EOF), set *reached_eof to 1 and return 0. Return -1 on error; else return the number of bytes read.
Definition at line 235 of file buffers_net.c.