|  | @@ -458,20 +458,24 @@ circuit_get_by_edge_conn(connection_t *conn)
 | 
	
		
			
				|  |  |    return circ;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -/** Return a new list of all circuits that have <b>conn</b> as n_conn or
 | 
	
		
			
				|  |  | - * p_conn, including those marked for close.
 | 
	
		
			
				|  |  | +/** For each circuits that have <b>conn</b> as n_conn or p_conn, unlink the
 | 
	
		
			
				|  |  | + * circuit from the orconn,circid map, and mark it for close if it hasn't
 | 
	
		
			
				|  |  | + * been marked already.
 | 
	
		
			
				|  |  |   */
 | 
	
		
			
				|  |  | -smartlist_t *
 | 
	
		
			
				|  |  | -circuit_get_all_on_orconn(connection_t *conn)
 | 
	
		
			
				|  |  | +void
 | 
	
		
			
				|  |  | +circuit_unlink_all_from_or_conn(connection_t *conn)
 | 
	
		
			
				|  |  |  {
 | 
	
		
			
				|  |  | -  smartlist_t *res = smartlist_create();
 | 
	
		
			
				|  |  |    circuit_t *circ;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -  for (circ=global_circuitlist;circ;circ = circ->next) {
 | 
	
		
			
				|  |  | -    if (circ->p_conn == conn || circ->n_conn == conn)
 | 
	
		
			
				|  |  | -      smartlist_add(res, circ);
 | 
	
		
			
				|  |  | +  for (circ = global_circuitlist; circ; circ = circ->next) {
 | 
	
		
			
				|  |  | +    if (circ->n_conn == conn || circ->p_conn == conn) {
 | 
	
		
			
				|  |  | +      if (circ->n_conn == conn)
 | 
	
		
			
				|  |  | +        circuit_set_circid_orconn(circ, 0, NULL, N_CONN_CHANGED);
 | 
	
		
			
				|  |  | +      if (circ->p_conn == conn)
 | 
	
		
			
				|  |  | +        circuit_set_circid_orconn(circ, 0, NULL, P_CONN_CHANGED);
 | 
	
		
			
				|  |  | +      if (!circ->marked_for_close)
 | 
	
		
			
				|  |  | +        circuit_mark_for_close(circ);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | -  return res;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  /** Return a circ such that:
 |