Ticket #15482: IsolateKeepAlive.patch

File IsolateKeepAlive.patch, 1.5 KB (added by cypherpunks, 4 years ago)

Add IsolateKeepAlive flag

  • src/or/circuituse.c

    diff --git a/src/or/circuituse.c b/src/or/circuituse.c
    index b54a4d2..b0358b6 100644
    a b connection_ap_handshake_attach_chosen_circuit(entry_connection_t *conn, 
    22642264
    22652265  base_conn->state = AP_CONN_STATE_CIRCUIT_WAIT;
    22662266
    2267   if (!circ->base_.timestamp_dirty)
    2268     circ->base_.timestamp_dirty = time(NULL);
     2267  if (!circ->base_.timestamp_dirty ||
     2268      (conn->entry_cfg.isolation_flags & ISO_KEEPALIVE))
     2269    circ->base_.timestamp_dirty = approx_time();
    22692270
    22702271  pathbias_count_use_attempt(circ);
    22712272
  • src/or/config.c

    diff --git a/src/or/config.c b/src/or/config.c
    index 1030448..8898d19 100644
    a b parse_port_config(smartlist_t *out, 
    61456145          isoflag = ISO_CLIENTPROTO;
    61466146        } else if (!strcasecmp(elt, "IsolateClientAddr")) {
    61476147          isoflag = ISO_CLIENTADDR;
     6148        } else if (!strcasecmp(elt, "IsolateKeepAlive")) {
     6149          isoflag = ISO_KEEPALIVE;
    61486150        } else {
    61496151          log_warn(LD_CONFIG, "Unrecognized %sPort option '%s'",
    61506152                   portname, escaped(elt_orig));
  • src/or/or.h

    diff --git a/src/or/or.h b/src/or/or.h
    index d9be1be..e8f8312 100644
    a b typedef enum invalid_router_usage_t { 
    33133313#define ISO_NYM_EPOCH   (1u<<6)
    33143314/** Isolate all streams (Internal only). */
    33153315#define ISO_STREAM      (1u<<7)
     3316/** Keep circuit alive as long as new streams get attached. */
     3317#define ISO_KEEPALIVE   (1u<<8)
    33163318/**@}*/
    33173319
    33183320/** Default isolation level for ports. */