diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-07-29 04:03:25 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-07-29 04:03:25 +0000 |
commit | 964e4a305d1fbdfbfde3754845064f681dd38d5c (patch) | |
tree | 39e0f218375dee142012bc0cc1bef6d62fd3b856 | |
parent | 25bd4204d0f0db46fb81a12df475760f3a6fce68 (diff) | |
download | tor-964e4a305d1fbdfbfde3754845064f681dd38d5c.tar.gz tor-964e4a305d1fbdfbfde3754845064f681dd38d5c.zip |
r13972@catbus: nickm | 2007-07-29 00:01:38 -0400
Make our control events for multi-line async replies conform to our old grammar. Change back to the old grammar (which got "corrected" in r10931).
svn:r10964
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | doc/spec/control-spec.txt | 8 | ||||
-rw-r--r-- | src/or/control.c | 8 |
3 files changed, 12 insertions, 6 deletions
@@ -91,6 +91,8 @@ Changes in version 0.2.0.3-alpha - 2007-07-29 compatibility, ADDRMAP events only provide GMT expiry in an extended field. "GETINFO address-mappings" always does the right thing. - Use CRLF line endings properly in NS events. + - Terminate multi-line control events properly. (Original patch from tup.) + [Bugfix on 0.1.2.x-alpha] o Minor bugfixes (misc): - Choose perfectly fairly among routers when choosing by bandwidth and diff --git a/doc/spec/control-spec.txt b/doc/spec/control-spec.txt index df1d8752e7..d6564dce96 100644 --- a/doc/spec/control-spec.txt +++ b/doc/spec/control-spec.txt @@ -64,7 +64,7 @@ $Id$ Reply = SyncReply / AsyncReply SyncReply = *(MidReplyLine / DataReplyLine) EndReplyLine - AsyncReply = *MidReplyLine EndReplyLine / DataReplyLine + AsyncReply = *(MidReplyLine / DataReplyLine) EndReplyLine MidReplyLine = StatusCode "-" ReplyLine DataReplyLine = StatusCode "+" ReplyLine Data @@ -954,7 +954,7 @@ $Id$ The syntax is: "650" SP Severity SP ReplyText or - "650+" Severity CRLF Data + "650+" Severity CRLF Data 650 SP "OK" CRLF Severity = "DEBUG" / "INFO" / "NOTICE" / "WARN"/ "ERR" @@ -985,7 +985,7 @@ $Id$ Syntax: "650" "+" "AUTHDIR_NEWDESCS" CRLF Action CRLF Message CRLF - Descriptor CRLF "." CRLF + Descriptor CRLF "." CRLF "650" SP "OK" CRLF Action = "ACCEPTED" / "DROPPED" / "REJECTED" Message = Text @@ -1316,7 +1316,7 @@ $Id$ 4.1.12. Network status has changed Syntax: - "650" "+" "NS" CRLF 1*NetworkStatus "." CRLF + "650" "+" "NS" CRLF 1*NetworkStatus "." CRLF "650" SP "OK" CRLF [First added in 0.1.2.3-alpha] diff --git a/src/or/control.c b/src/or/control.c index 45ef63be73..61f642df05 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -3145,8 +3145,9 @@ control_event_or_authdir_new_descriptor(const char *action, strlcpy(buf, firstline, totallen); strlcpy(buf+strlen(firstline), esc, totallen); send_control_event_string(EVENT_AUTHDIR_NEWDESCS, ALL_NAMES|ALL_FORMATS, - buf); - + buf); + send_control_event_string(EVENT_AUTHDIR_NEWDESCS, ALL_NAMES|ALL_FORMATS, + "650 OK\r\n"); tor_free(esc); tor_free(buf); @@ -3178,6 +3179,9 @@ control_event_networkstatus_changed(smartlist_t *statuses) smartlist_free(strs); tor_free(s); send_control_event_string(EVENT_NS, ALL_NAMES|ALL_FORMATS, esc); + send_control_event_string(EVENT_NS, ALL_NAMES|ALL_FORMATS, + "650 OK\r\n"); + tor_free(esc); return 0; } |