]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge branch 'optimistic-client'
authorNick Mathewson <nickm@torproject.org>
Wed, 20 Jul 2011 13:50:53 +0000 (09:50 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 20 Jul 2011 13:50:53 +0000 (09:50 -0400)
The conflicts are with the proposal 171 circuit isolation code, and
they're all trivial: they're just a matter of both branches adding
some unrelated code in the same places.

Conflicts:
src/or/circuituse.c
src/or/connection.c

1  2 
src/or/buffers.c
src/or/circuituse.c
src/or/connection.c
src/or/connection_edge.c
src/or/or.h

Simple merge
index b4860440cb0c0ff3e54e0db628b6634b5cf83243,3c8cacb2cda5fd407f08151cbb683eb7218c990f..1bc518b7d45bc66aefa033279f8929acd9e57cf9
@@@ -1568,8 -1472,23 +1571,26 @@@ link_apconn_to_circ(edge_connection_t *
      apconn->cpath_layer = circ->cpath->prev;
    }
  
 +  circ->isolation_any_streams_attached = 1;
 +  connection_edge_update_circuit_isolation(apconn, circ, 0);
++
+   /* See if we can use optimistic data on this circuit */
+   if (apconn->cpath_layer->extend_info &&
+       (exitnode = node_get_by_id(
+                      apconn->cpath_layer->extend_info->identity_digest)) &&
+       exitnode->rs) {
+     /* Okay; we know what exit node this is. */
+     if (circ->_base.purpose == CIRCUIT_PURPOSE_C_GENERAL &&
+         exitnode->rs->version_supports_optimistic_data)
+       apconn->exit_allows_optimistic_data = 1;
+     else
+       apconn->exit_allows_optimistic_data = 0;
+     log_info(LD_APP, "Looks like completed circuit to %s %s allow "
+              "optimistic data for connection to %s",
+              safe_str_client(node_describe(exitnode)),
+              apconn->exit_allows_optimistic_data ? "does" : "doesn't",
+              safe_str_client(apconn->socks_request->address));
+   }
  }
  
  /** Return true iff <b>address</b> is matched by one of the entries in
index 59a7b80deb11b8be859d91ee481bcccf35ab6da5,1ccd2b6608755eb68015fffd253fa8e7edf43045..3950f901525cc377a6b88449753bdbe1f4700d7d
@@@ -467,9 -442,14 +467,15 @@@ _connection_free(connection_t *conn
    if (CONN_IS_EDGE(conn)) {
      edge_connection_t *edge_conn = TO_EDGE_CONN(conn);
      tor_free(edge_conn->chosen_exit_name);
 +    tor_free(edge_conn->original_dest_address);
      if (edge_conn->socks_request)
        socks_request_free(edge_conn->socks_request);
+     if (edge_conn->pending_optimistic_data) {
+       generic_buffer_free(edge_conn->pending_optimistic_data);
+     }
+     if (edge_conn->sending_optimistic_data) {
+       generic_buffer_free(edge_conn->sending_optimistic_data);
+     }
      rend_data_free(edge_conn->rend_data);
    }
    if (conn->type == CONN_TYPE_CONTROL) {
Simple merge
diff --cc src/or/or.h
Simple merge