summaryrefslogtreecommitdiff
path: root/src/test/test.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-06-29 12:31:17 -0400
committerNick Mathewson <nickm@torproject.org>2011-06-29 13:08:46 -0400
commit2e6604f42ee614156ceeb29bdcab5c78cc1d84ba (patch)
tree47cf86914ee90bf09bbc56a78366ee9edde013db /src/test/test.c
parent204bce7e3ca0f60cfec1d8be700848309f605abd (diff)
downloadtor-2e6604f42ee614156ceeb29bdcab5c78cc1d84ba.tar.gz
tor-2e6604f42ee614156ceeb29bdcab5c78cc1d84ba.zip
Record username/password data in socks_request_t
This change also requires us to add and use a pair of allocator/deallocator functions for socks_request_t, instead of using tor_malloc_zero/tor_free directly.
Diffstat (limited to 'src/test/test.c')
-rw-r--r--src/test/test.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/test/test.c b/src/test/test.c
index d0e24d1b91..38729cf2aa 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -627,54 +627,54 @@ test_buffers(void)
/* Test fetch_from_buf_socks() */
buf = buf_new_with_capacity(256);
- socks = tor_malloc_zero(sizeof(socks_request_t));;
+ socks = socks_request_new();
config_register_addressmaps(get_options());
/* Sending auth credentials before we've negotiated a method */
test_buffers_socks5_auth_before_negotiation_helper(cp, buf, socks);
- tor_free(socks);
+ socks_request_free(socks);
buf_free(buf);
buf = NULL;
buf = buf_new_with_capacity(256);
- socks = tor_malloc_zero(sizeof(socks_request_t));;
+ socks = socks_request_new();
/* A SOCKS 5 client that only supports authentication */
test_buffers_socks5_authenticate_helper(cp, buf, socks);
test_buffers_socks5_supported_commands_helper(cp, buf, socks);
test_buffers_socks5_unsupported_commands_helper(cp, buf, socks);
- tor_free(socks);
+ socks_request_free(socks);
buf_free(buf);
buf = NULL;
buf = buf_new_with_capacity(256);
- socks = tor_malloc_zero(sizeof(socks_request_t));;
+ socks = socks_request_new();
/* A SOCKS 5 client that sends credentials and data in one go */
test_buffers_socks5_authenticate_with_data_helper(cp, buf, socks);
- tor_free(socks);
+ socks_request_free(socks);
buf_free(buf);
buf = NULL;
buf = buf_new_with_capacity(256);
- socks = tor_malloc_zero(sizeof(socks_request_t));;
+ socks = socks_request_new();
/* A SOCKS 5 client that doesn't want authentication */
test_buffers_socks5_no_authenticate_helper(cp, buf, socks);
test_buffers_socks5_supported_commands_helper(cp, buf, socks);
test_buffers_socks5_unsupported_commands_helper(cp, buf, socks);
- tor_free(socks);
+ socks_request_free(socks);
buf_free(buf);
buf = NULL;
buf = buf_new_with_capacity(256);
- socks = tor_malloc_zero(sizeof(socks_request_t));;
+ socks = socks_request_new();
/* A SOCKS 4(a) client */
test_buffers_socks4_supported_commands_helper(cp, buf, socks);
test_buffers_socks4_unsupported_commands_helper(cp, buf, socks);
- tor_free(socks);
+ socks_request_free(socks);
buf_free(buf);
buf = NULL;