summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
Diffstat (limited to 'src/or')
-rw-r--r--src/or/command.c3
-rw-r--r--src/or/transports.c13
2 files changed, 4 insertions, 12 deletions
diff --git a/src/or/command.c b/src/or/command.c
index fb281a7f93..ca3c341037 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -591,7 +591,6 @@ command_process_destroy_cell(cell_t *cell, or_connection_t *conn)
int reason;
circ = circuit_get_by_circid_orconn(cell->circ_id, conn);
- reason = (uint8_t)cell->payload[0];
if (!circ) {
log_info(LD_OR,"unknown circuit %d on connection from %s:%d. Dropping.",
cell->circ_id, conn->_base.address, conn->_base.port);
@@ -599,6 +598,8 @@ command_process_destroy_cell(cell_t *cell, or_connection_t *conn)
}
log_debug(LD_OR,"Received for circID %d.",cell->circ_id);
+ reason = (uint8_t)cell->payload[0];
+
if (!CIRCUIT_IS_ORIGIN(circ) &&
cell->circ_id == TO_OR_CIRCUIT(circ)->p_circ_id) {
/* the destroy came from behind */
diff --git a/src/or/transports.c b/src/or/transports.c
index 5f650d107a..a20decfc03 100644
--- a/src/or/transports.c
+++ b/src/or/transports.c
@@ -119,10 +119,6 @@ static INLINE void free_execve_args(char **arg);
#define PROTO_CMETHODS_DONE "CMETHODS DONE"
#define PROTO_SMETHODS_DONE "SMETHODS DONE"
-/* The smallest valid managed proxy protocol line that can
- appear. It's the size of "VERSION 1" */
-#define SMALLEST_MANAGED_LINE_SIZE 9
-
/** Number of environment variables for managed proxy clients/servers. */
#define ENVIRON_SIZE_CLIENT 3
#define ENVIRON_SIZE_SERVER 7 /* XXX known to be too high, but that's ok */
@@ -633,12 +629,6 @@ handle_proxy_line(const char *line, managed_proxy_t *mp)
log_info(LD_GENERAL, "Got a line from managed proxy '%s': (%s)",
mp->argv[0], line);
- if (strlen(line) < SMALLEST_MANAGED_LINE_SIZE) {
- log_warn(LD_GENERAL, "Managed proxy configuration line is too small. "
- "Discarding");
- goto err;
- }
-
if (!strcmpstart(line, PROTO_ENV_ERROR)) {
if (mp->conf_state != PT_PROTO_LAUNCHED)
goto err;
@@ -712,7 +702,8 @@ handle_proxy_line(const char *line, managed_proxy_t *mp)
return;
}
- log_warn(LD_CONFIG, "Unknown line received by managed proxy. (%s)", line);
+ log_notice(LD_GENERAL, "Unknown line received by managed proxy (%s).", line);
+ return;
err:
mp->conf_state = PT_PROTO_BROKEN;