[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r10964: Make our control events for multi-line async replies conform (in tor/trunk: . doc/spec src/or)



Author: nickm
Date: 2007-07-29 00:03:25 -0400 (Sun, 29 Jul 2007)
New Revision: 10964

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/doc/spec/control-spec.txt
   tor/trunk/src/or/control.c
Log:
 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).



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r13972] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-07-29 02:55:24 UTC (rev 10963)
+++ tor/trunk/ChangeLog	2007-07-29 04:03:25 UTC (rev 10964)
@@ -91,6 +91,8 @@
       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

Modified: tor/trunk/doc/spec/control-spec.txt
===================================================================
--- tor/trunk/doc/spec/control-spec.txt	2007-07-29 02:55:24 UTC (rev 10963)
+++ tor/trunk/doc/spec/control-spec.txt	2007-07-29 04:03:25 UTC (rev 10964)
@@ -64,7 +64,7 @@
 
     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 @@
   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 @@
 
   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 @@
 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]
 

Modified: tor/trunk/src/or/control.c
===================================================================
--- tor/trunk/src/or/control.c	2007-07-29 02:55:24 UTC (rev 10963)
+++ tor/trunk/src/or/control.c	2007-07-29 04:03:25 UTC (rev 10964)
@@ -3145,8 +3145,9 @@
   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 @@
   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;
 }