39 PRInt32 size, PRIntervalTime
timeout);
41 PRInt32 amount, PRIntn flags,
44 PRIntn flags, PRIntervalTime
timeout);
92 #define INC_READ(fd, n) STMT_BEGIN \
93 get_counts(fd)->n_read += (n); \
97 #define INC_WRITTEN(fd, n) STMT_BEGIN \
98 get_counts(fd)->n_written += (n); \
123 PRInt32 result = (fd->lower->methods->read)(fd->lower, buf, amount);
136 PRInt32 result = (fd->lower->methods->write)(fd->lower, buf, amount);
145 PRInt32 size, PRIntervalTime
timeout)
150 PRInt32 result = (fd->lower->methods->writev)(fd->lower, iov, size,
timeout);
159 PRInt32 amount, PRIntn flags, PRIntervalTime
timeout)
164 PRInt32 result = (fd->lower->methods->send)(fd->lower, buf, amount, flags,
174 PRIntn flags, PRIntervalTime
timeout)
179 PRInt32 result = (fd->lower->methods->recv)(fd->lower, buf, amount, flags,
204 newfd->secret = (PRFilePrivate *)bytecounts;
210 PRStatus status = PR_PushIOLayer(stack, PR_TOP_IO_LAYER, newfd);
226 uint64_t *n_read_out,
227 uint64_t *n_written_out)
235 if (BUG(bclayer == NULL))
240 *n_read_out =
counts->n_read;
241 *n_written_out =
counts->n_written;
static conn_counts_t counts
Headers for util_malloc.c.
int tor_get_prfiledesc_byte_counts(PRFileDesc *fd, uint64_t *n_read_out, uint64_t *n_written_out)
static bool countbytes_initialized
void tor_nss_countbytes_init(void)
static PRInt32 countbytes_write_fn(PRFileDesc *fd, const void *buf, PRInt32 amount)
static PRInt32 countbytes_recv_fn(PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRIntervalTime timeout)
static PRInt32 countbytes_writev_fn(PRFileDesc *fd, const PRIOVec *iov, PRInt32 size, PRIntervalTime timeout)
static PRDescIdentity countbytes_layer_id
static tor_nss_bytecounts_t * get_counts(PRFileDesc *fd)
PRFileDesc * tor_wrap_prfiledesc_with_byte_counter(PRFileDesc *stack)
static PRInt32 countbytes_send_fn(PRFileDesc *fd, const void *buf, PRInt32 amount, PRIntn flags, PRIntervalTime timeout)
#define INC_WRITTEN(fd, n)
static PRInt32 countbytes_read_fn(PRFileDesc *fd, void *buf, PRInt32 amount)
static PRStatus(* default_close_fn)(PRFileDesc *fd)
static PRIOMethods countbytes_methods
static PRStatus countbytes_close_fn(PRFileDesc *fd)
Header for nss_countbytes.c, which lets us count the number of bytes actually written on a PRFileDesc...
Macros to manage assertions, fatal and non-fatal.