aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-04-08 22:31:48 +0000
committerRoger Dingledine <arma@torproject.org>2003-04-08 22:31:48 +0000
commit833f165d6898355f402697f591cb6960d5dfba5a (patch)
tree712a47ecca8a9acb9638712850fd32c14dac985f /src/or/connection_or.c
parentc2fa6f5c7d50f467cf2b37a7e95e52e2ce354a6c (diff)
downloadtor-833f165d6898355f402697f591cb6960d5dfba5a.tar
tor-833f165d6898355f402697f591cb6960d5dfba5a.tar.gz
bugfix: make onion proxies actually obey their requested bandwidth
svn:r229
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 8a7fd9a90..9cac2c9ca 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -266,14 +266,14 @@ connection_t *connection_or_connect_as_op(routerinfo_t *router) {
}
int or_handshake_op_send_keys(connection_t *conn) {
- //int x;
- uint32_t bandwidth = DEFAULT_BANDWIDTH_OP;
unsigned char message[36]; /* bandwidth(32bits), forward key(128bits), backward key(128bits) */
unsigned char cipher[128];
int retval;
assert(conn && conn->type == CONN_TYPE_OR);
+ conn->bandwidth = DEFAULT_BANDWIDTH_OP;
+
/* generate random keys */
if(crypto_cipher_generate_key(conn->f_crypto) ||
crypto_cipher_generate_key(conn->b_crypto)) {
@@ -282,7 +282,7 @@ int or_handshake_op_send_keys(connection_t *conn) {
}
log(LOG_DEBUG,"or_handshake_op_send_keys() : Generated 3DES keys.");
/* compose the message */
- *(uint32_t *)message = htonl(bandwidth);
+ *(uint32_t *)message = htonl(conn->bandwidth);
memcpy((void *)(message + 4), (void *)conn->f_crypto->key, 16);
memcpy((void *)(message + 20), (void *)conn->b_crypto->key, 16);