diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-08-12 16:11:28 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-08-12 16:11:28 -0400 |
commit | 7f145b54afb2cb1d9390a65bf31e2dddeb5b87da (patch) | |
tree | f184f7c342e95e36a6b80e2c7fddde7f76c3aa7e /src/test/test_oom.c | |
parent | 14d58bbb4a9f08d51a58ea0a75d5535a05bfc9e8 (diff) | |
parent | bbc9cbd95839380a45ec9ff11a7f7b99bbe923b0 (diff) | |
download | tor-7f145b54afb2cb1d9390a65bf31e2dddeb5b87da.tar.gz tor-7f145b54afb2cb1d9390a65bf31e2dddeb5b87da.zip |
Merge remote-tracking branch 'public/Fix_19450'
Diffstat (limited to 'src/test/test_oom.c')
-rw-r--r-- | src/test/test_oom.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/test/test_oom.c b/src/test/test_oom.c index a944464051..6102af01f5 100644 --- a/src/test/test_oom.c +++ b/src/test/test_oom.c @@ -77,14 +77,14 @@ dummy_origin_circuit_new(int n_cells) } static void -add_bytes_to_buf(generic_buffer_t *buf, size_t n_bytes) +add_bytes_to_buf(buf_t *buf, size_t n_bytes) { char b[3000]; while (n_bytes) { size_t this_add = n_bytes > sizeof(b) ? sizeof(b) : n_bytes; crypto_rand(b, this_add); - generic_buffer_add(buf, b, this_add); + write_to_buf(b, this_add, buf); n_bytes -= this_add; } } @@ -94,20 +94,15 @@ dummy_edge_conn_new(circuit_t *circ, int type, size_t in_bytes, size_t out_bytes) { edge_connection_t *conn; - generic_buffer_t *inbuf, *outbuf; + buf_t *inbuf, *outbuf; if (type == CONN_TYPE_EXIT) conn = edge_connection_new(type, AF_INET); else conn = ENTRY_TO_EDGE_CONN(entry_connection_new(type, AF_INET)); -#ifdef USE_BUFFEREVENTS - inbuf = bufferevent_get_input(TO_CONN(conn)->bufev); - outbuf = bufferevent_get_output(TO_CONN(conn)->bufev); -#else inbuf = TO_CONN(conn)->inbuf; outbuf = TO_CONN(conn)->outbuf; -#endif /* We add these bytes directly to the buffers, to avoid all the * edge connection read/write machinery. */ |