|
@@ -1743,6 +1743,26 @@ handle_control_takeownership(control_connection_t *conn, uint32_t len,
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ * as a non-owning connection, so that we will not exit if the connection
|
|
|
|
+ * closes. */
|
|
|
|
+static int
|
|
|
|
+handle_control_dropownership(control_connection_t *conn, uint32_t len,
|
|
|
|
+ const char *body)
|
|
|
|
+{
|
|
|
|
+ (void)len;
|
|
|
|
+ (void)body;
|
|
|
|
+
|
|
|
|
+ conn->is_owning_control_connection = 0;
|
|
|
|
+
|
|
|
|
+ log_info(LD_CONTROL, "Control connection %d has dropped ownership of this "
|
|
|
|
+ "Tor instance.",
|
|
|
|
+ (int)(conn->base_.s));
|
|
|
|
+
|
|
|
|
+ send_control_done(conn);
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
* containing funny characters. */
|
|
* containing funny characters. */
|
|
static int
|
|
static int
|
|
@@ -5550,6 +5570,9 @@ connection_control_process_inbuf(control_connection_t *conn)
|
|
} else if (!strcasecmp(conn->incoming_cmd, "TAKEOWNERSHIP")) {
|
|
} else if (!strcasecmp(conn->incoming_cmd, "TAKEOWNERSHIP")) {
|
|
if (handle_control_takeownership(conn, cmd_data_len, args))
|
|
if (handle_control_takeownership(conn, cmd_data_len, args))
|
|
return -1;
|
|
return -1;
|
|
|
|
+ } else if (!strcasecmp(conn->incoming_cmd, "DROPOWNERSHIP")) {
|
|
|
|
+ if (handle_control_dropownership(conn, cmd_data_len, args))
|
|
|
|
+ return -1;
|
|
} else if (!strcasecmp(conn->incoming_cmd, "MAPADDRESS")) {
|
|
} else if (!strcasecmp(conn->incoming_cmd, "MAPADDRESS")) {
|
|
if (handle_control_mapaddress(conn, cmd_data_len, args))
|
|
if (handle_control_mapaddress(conn, cmd_data_len, args))
|
|
return -1;
|
|
return -1;
|