Przeglądaj źródła

the spec called it a GUARDS event, but the code called
it a GUARD event. standardize on GUARD, but support people
asking for GUARDS too. reported by daejees.

backport candidate.


svn:r9817

Roger Dingledine 18 lat temu
rodzic
commit
5740071674
2 zmienionych plików z 6 dodań i 3 usunięć
  1. 2 2
      doc/spec/control-spec.txt
  2. 4 1
      src/or/control.c

+ 2 - 2
doc/spec/control-spec.txt

@@ -194,7 +194,7 @@ $Id$
      EventCode = "CIRC" / "STREAM" / "ORCONN" / "BW" / "DEBUG" /
          "INFO" / "NOTICE" / "WARN" / "ERR" / "NEWDESC" / "ADDRMAP" /
          "AUTHDIR_NEWDESCS" / "DESCCHANGED" / "STATUS_GENERAL" /
-         "STATUS_CLIENT" / "STATUS_SERVER" / "GUARDS" / "NS" / "STREAM_BW"
+         "STATUS_CLIENT" / "STATUS_SERVER" / "GUARD" / "NS" / "STREAM_BW"
 
   Any events *not* listed in the SETEVENTS line are turned off; thus, sending
   SETEVENTS with an empty body turns off all event reporting.
@@ -1263,7 +1263,7 @@ $Id$
 4.1.11. Our set of guard nodes has changed
 
   Syntax:
-     "650" SP "GUARDS" SP Type SP Name SP Status ... CRLF
+     "650" SP "GUARD" SP Type SP Name SP Status ... CRLF
      Type = "ENTRY"
      Name = The (possibly verbose) nickname of the guard affected.
      Status = "NEW" | "UP" | "DOWN" | "BAD" | "GOOD" | "DROPPED"

+ 4 - 1
src/or/control.c

@@ -882,7 +882,10 @@ handle_control_setevents(control_connection_t *conn, uint32_t len,
           event_code = EVENT_STATUS_SERVER;
         else if (!strcasecmp(ev, "GUARD"))
           event_code = EVENT_GUARD;
-        else if (!strcasecmp(ev, "STREAM_BW"))
+        else if (!strcasecmp(ev, "GUARDS")) {
+          /* XXX tolerate buggy spec in 0.1.2.5-alpha through 0.1.2.10-rc */
+          event_code = EVENT_GUARD;
+        } else if (!strcasecmp(ev, "STREAM_BW"))
           event_code = EVENT_STREAM_BANDWIDTH_USED;
         else {
           connection_printf_to_buf(conn, "552 Unrecognized event \"%s\"\r\n",