summaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-09-08 15:16:45 -0400
committerNick Mathewson <nickm@torproject.org>2014-09-08 15:16:45 -0400
commit2ecaa59bd794f1cba6a4ce3b82b73a8b4d27b2ab (patch)
treec718f598e33b4859b3ddb26925841415632e397b /src/or/control.c
parent781b477bc8af868661450473cdebb5d70312fd61 (diff)
parentd229025fefa6faa228d9154e391293d9d5b320d3 (diff)
downloadtor-2ecaa59bd794f1cba6a4ce3b82b73a8b4d27b2ab.tar.gz
tor-2ecaa59bd794f1cba6a4ce3b82b73a8b4d27b2ab.zip
Merge remote-tracking branch 'origin/maint-0.2.5'
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/control.c b/src/or/control.c
index cd2df5ac34..60aa869439 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -582,7 +582,7 @@ send_control_event_string,(uint16_t event, event_format_t which,
conn->state == CONTROL_CONN_STATE_OPEN) {
control_connection_t *control_conn = TO_CONTROL_CONN(conn);
- if (control_conn->event_mask & (1<<event)) {
+ if (control_conn->event_mask & (((event_mask_t)1)<<event)) {
int is_err = 0;
connection_write_to_buf(msg, strlen(msg), TO_CONN(control_conn));
if (event == EVENT_ERR_MSG)
@@ -950,7 +950,7 @@ handle_control_setevents(control_connection_t *conn, uint32_t len,
const char *body)
{
int event_code = -1;
- uint32_t event_mask = 0;
+ event_mask_t event_mask = 0;
smartlist_t *events = smartlist_new();
(void) len;
@@ -978,7 +978,7 @@ handle_control_setevents(control_connection_t *conn, uint32_t len,
return 0;
}
}
- event_mask |= (1 << event_code);
+ event_mask |= (((event_mask_t)1) << event_code);
}
SMARTLIST_FOREACH_END(ev);
SMARTLIST_FOREACH(events, char *, e, tor_free(e));
@@ -2884,7 +2884,7 @@ handle_control_resolve(control_connection_t *conn, uint32_t len,
int is_reverse = 0;
(void) len; /* body is nul-terminated; it's safe to ignore the length */
- if (!(conn->event_mask & ((uint32_t)1L<<EVENT_ADDRMAP))) {
+ if (!(conn->event_mask & (((event_mask_t)1)<<EVENT_ADDRMAP))) {
log_warn(LD_CONTROL, "Controller asked us to resolve an address, but "
"isn't listening for ADDRMAP events. It probably won't see "
"the answer.");