[tor-commits] [tor/master] Rename TYPE to TRANSPORT in PT STATUS messages.

nickm at torproject.org nickm at torproject.org
Thu Jan 17 17:04:57 UTC 2019


commit 59a88b3c3a31d2fc195d199f6c7aa62a8764e6dc
Author: Alexander Færøy <ahf at torproject.org>
Date:   Mon Jan 14 17:59:59 2019 +0100

    Rename TYPE to TRANSPORT in PT STATUS messages.
    
    See: https://bugs.torproject.org/28181
---
 src/feature/client/transports.c | 12 ++++++------
 src/test/test_pt.c              | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/feature/client/transports.c b/src/feature/client/transports.c
index 8a8bcd9f7..a961b2189 100644
--- a/src/feature/client/transports.c
+++ b/src/feature/client/transports.c
@@ -1236,13 +1236,13 @@ parse_status_line(const char *line, managed_proxy_t *mp)
     goto done;
   }
 
-  /* We check if we received the TYPE parameter, which is the only *required*
-   * value. */
-  const config_line_t *type = config_line_find(values, "TYPE");
+  /* We check if we received the TRANSPORT parameter, which is the only
+   * *required* value. */
+  const config_line_t *type = config_line_find(values, "TRANSPORT");
 
   if (! type) {
     log_warn(LD_PT, "Managed proxy \"%s\" wrote a STATUS line without "
-                    "TYPE: %s", mp->argv[0], escaped(data));
+                    "TRANSPORT: %s", mp->argv[0], escaped(data));
     goto done;
   }
 
@@ -1250,8 +1250,8 @@ parse_status_line(const char *line, managed_proxy_t *mp)
   config_line_prepend(&values, "PT", mp->argv[0]);
   status_message = kvline_encode(values, KV_QUOTED);
 
-  /* We have checked that TYPE is there, we can now emit the STATUS event via
-   * the control port. */
+  /* We have checked that TRANSPORT is there, we can now emit the STATUS event
+   * via the control port. */
   control_event_pt_status(status_message);
 
  done:
diff --git a/src/test/test_pt.c b/src/test/test_pt.c
index 60a044aec..5edf85815 100644
--- a/src/test/test_pt.c
+++ b/src/test/test_pt.c
@@ -311,9 +311,9 @@ process_read_stdout_replacement(process_t *process, buf_t *buffer)
     buf_add_string(buffer, "LOG SEVERITY=info MESSAGE=\"info msg\"\n");
     buf_add_string(buffer, "LOG SEVERITY=debug MESSAGE=\"debug msg\"\n");
   } else if (times_called <= 8) {
-    buf_add_string(buffer, "STATUS TYPE=a K_1=a K_2=b K_3=\"foo bar\"\n");
-    buf_add_string(buffer, "STATUS TYPE=b K_1=a K_2=b K_3=\"foo bar\"\n");
-    buf_add_string(buffer, "STATUS TYPE=c K_1=a K_2=b K_3=\"foo bar\"\n");
+    buf_add_string(buffer, "STATUS TRANSPORT=a K_1=a K_2=b K_3=\"foo bar\"\n");
+    buf_add_string(buffer, "STATUS TRANSPORT=b K_1=a K_2=b K_3=\"foo bar\"\n");
+    buf_add_string(buffer, "STATUS TRANSPORT=c K_1=a K_2=b K_3=\"foo bar\"\n");
   }
 
   return (int)buf_datalen(buffer);
@@ -445,13 +445,13 @@ test_pt_configure_proxy(void *arg)
 
   tt_str_op(smartlist_get(controlevent_msgs, 10), OP_EQ,
             "650 PT_STATUS "
-            "PT=<testcase> TYPE=a K_1=a K_2=b K_3=\"foo bar\"\r\n");
+            "PT=<testcase> TRANSPORT=a K_1=a K_2=b K_3=\"foo bar\"\r\n");
   tt_str_op(smartlist_get(controlevent_msgs, 11), OP_EQ,
             "650 PT_STATUS "
-            "PT=<testcase> TYPE=b K_1=a K_2=b K_3=\"foo bar\"\r\n");
+            "PT=<testcase> TRANSPORT=b K_1=a K_2=b K_3=\"foo bar\"\r\n");
   tt_str_op(smartlist_get(controlevent_msgs, 12), OP_EQ,
             "650 PT_STATUS "
-            "PT=<testcase> TYPE=c K_1=a K_2=b K_3=\"foo bar\"\r\n");
+            "PT=<testcase> TRANSPORT=c K_1=a K_2=b K_3=\"foo bar\"\r\n");
 
   { /* check that the transport info were saved properly in the tor state */
     config_line_t *transport_in_state = NULL;





More information about the tor-commits mailing list