diff options
author | Roger Dingledine <arma@torproject.org> | 2004-11-09 10:08:42 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-11-09 10:08:42 +0000 |
commit | dd3a12c92921b34db93b04bc7240b7e1a1e17f0f (patch) | |
tree | eb44ceb8639538bfa4c6d24771f1e6f3872f7f7d /src/or | |
parent | 6483f95ce722c1c8ae15d8e7134fc521fac896a5 (diff) | |
download | tor-dd3a12c92921b34db93b04bc7240b7e1a1e17f0f.tar tor-dd3a12c92921b34db93b04bc7240b7e1a1e17f0f.tar.gz |
fix a memory-squashing bug that was causing an infinite loop
svn:r2741
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/control.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/control.c b/src/or/control.c index 6a714c1ed..bdce4e240 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -146,10 +146,10 @@ send_control_message(connection_t *conn, uint16_t type, uint16_t len, { char buf[4]; tor_assert(conn); - tor_assert(len || !body || !strlen(body)); + tor_assert(len || !body); tor_assert(type <= _CONTROL_CMD_MAX_RECOGNIZED); - set_uint32(buf, htons(len)); - set_uint32(buf+2, htons(type)); + set_uint16(buf, htons(len)); + set_uint16(buf+2, htons(type)); connection_write_to_buf(buf, 4, conn); if (len) connection_write_to_buf(body, len, conn); @@ -544,7 +544,7 @@ control_event_bandwidth_used(uint32_t n_read, uint32_t n_written) return 0; set_uint32(buf, htonl(n_read)); - set_uint32(buf+4, htonl(n_read)); + set_uint32(buf+4, htonl(n_written)); send_control_event(EVENT_BANDWIDTH_USED, 8, buf); return 0; |