diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-05-31 18:48:28 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-05-31 18:48:28 +0000 |
commit | 77502ac82dd4a2e6adfd954db5ee00042ea7dc0c (patch) | |
tree | 416e475fe1623d55ffa94c2b60726f6feee07259 /src/or/control.c | |
parent | 4061b2cbd1ef476ed0bbf2193a6bb69581a83b4d (diff) | |
download | tor-77502ac82dd4a2e6adfd954db5ee00042ea7dc0c.tar.gz tor-77502ac82dd4a2e6adfd954db5ee00042ea7dc0c.zip |
r13102@catbus: nickm | 2007-05-31 13:56:25 -0400
Make "authdir_newdesc rejected" work again.
svn:r10421
Diffstat (limited to 'src/or/control.c')
-rw-r--r-- | src/or/control.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/or/control.c b/src/or/control.c index fe1710b44e..2683be1987 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -35,7 +35,7 @@ const char control_c_id[] = #define EVENT_WARN_MSG 0x000A #define EVENT_ERR_MSG 0x000B #define EVENT_ADDRMAP 0x000C -#define EVENT_AUTHDIR_NEWDESCS 0x000D +// #define EVENT_AUTHDIR_NEWDESCS 0x000D #define EVENT_DESCCHANGED 0x000E #define EVENT_NS 0x000F #define EVENT_STATUS_CLIENT 0x0010 @@ -248,6 +248,16 @@ control_adjust_event_log_severity(void) control_event_logmsg); } +/** Return true iff the event with code <b>c</b> is being sent to any current + * control connection. This is useful if the amount of work needed to prepare + * to call the appropriate control_event_...() function is high. + */ +int +control_event_is_interesting(int event) +{ + return EVENT_IS_INTERESTING(event); +} + /** Append a NUL-terminated string <b>s</b> to the end of * <b>conn</b>-\>outbuf */ @@ -3032,7 +3042,7 @@ control_event_address_mapped(const char *from, const char *to, time_t expires) * been done with it, and also optionally give an explanation/reason. */ int control_event_or_authdir_new_descriptor(const char *action, - signed_descriptor_t *desc, + const char *desc, size_t desclen, const char *msg) { char firstline[1024]; @@ -3050,8 +3060,7 @@ control_event_or_authdir_new_descriptor(const char *action, msg ? msg : ""); /* Escape the server descriptor properly */ - esclen = write_escaped_data(desc->signed_descriptor_body, - desc->signed_descriptor_len, 1, &esc); + esclen = write_escaped_data(desc, desclen, 1, &esc); totallen = strlen(firstline) + esclen + 1; buf = tor_malloc(totallen); |