浏览代码

remove some dead code. some of it was tickling coverity.

Roger Dingledine 15 年之前
父节点
当前提交
746a19e84d
共有 2 个文件被更改,包括 0 次插入21 次删除
  1. 0 2
      ChangeLog
  2. 0 19
      src/or/connection_edge.c

+ 0 - 2
ChangeLog

@@ -25,8 +25,6 @@ Changes in version 0.2.2.4-alpha - 2009-10-??
       on 0.2.2.1-alpha.
     - Fix two memory leaks in the error case of
       circuit_build_times_parse_state. Bugfix on 0.2.2.2-alpha.
-    - Make it explicit that we can't overflow in
-      connection_ap_handshake_send_resolve. Bugfix on 0.0.7.1.
     - Don't count one-hop circuits when we're estimating how long it
       takes circuits to build on average. Otherwise we'll set our circuit
       build timeout lower than we should. Bugfix on 0.2.2.2-alpha.

+ 0 - 19
src/or/connection_edge.c

@@ -1547,18 +1547,6 @@ connection_ap_handshake_rewrite_and_attach(edge_connection_t *conn,
       uint32_t answer;
       struct in_addr in;
       /* Reply to resolves immediately if we can. */
-      if (strlen(socks->address) > RELAY_PAYLOAD_SIZE) {
-        log_warn(LD_APP,"Address to be resolved is too large. Failing.");
-        control_event_client_status(LOG_WARN, "SOCKS_BAD_HOSTNAME HOSTNAME=%s",
-                                    escaped(socks->address));
-        connection_ap_handshake_socks_resolved(conn,
-                                               RESOLVED_TYPE_ERROR_TRANSIENT,
-                                               0,NULL,-1,TIME_MAX);
-        connection_mark_unattached_ap(conn,
-                                END_STREAM_REASON_SOCKSPROTOCOL |
-                                END_STREAM_REASON_FLAG_ALREADY_SOCKS_REPLIED);
-        return -1;
-      }
       if (tor_inet_aton(socks->address, &in)) { /* see if it's an IP already */
         /* leave it in network order */
         answer = in.s_addr;
@@ -2156,13 +2144,6 @@ connection_ap_handshake_send_resolve(edge_connection_t *ap_conn)
     tor_assert(payload_len <= (int)sizeof(inaddr_buf));
   }
 
-  if (payload_len > MAX_SOCKS_ADDR_LEN) {
-    /* This should be impossible: we don't accept addresses this big. */
-    /* XXX Should we log a bug here? */
-    connection_mark_unattached_ap(ap_conn, END_STREAM_REASON_INTERNAL);
-    return -1;
-  }
-
   log_debug(LD_APP,
             "Sending relay cell to begin stream %d.", ap_conn->stream_id);