connection_or_write_cell_to_buf(&cell, circ->p_conn);
log_fn(LOG_DEBUG,"Finished sending 'created' cell.");
+ if (!is_local_IP(circ->p_conn->addr)) {
+ /* record that we could process create cells; presumably this means
+ that create cells can reach us too. */
+ log_fn(LOG_NOTICE,"Your ORPort is reachable from the outside. Excellent.");
+ router_orport_found_reachable();
+ }
+
return 0;
}
/** A testing circuit has completed. Take whatever stats we want. */
static void
circuit_testing_opened(circuit_t *circ) {
-
/* For now, we only use testing circuits to see if our ORPort is
- reachable. So, if this circuit ends at us, remember that. */
- routerinfo_t *exit = router_get_by_digest(circ->build_state->chosen_exit_digest);
- if (exit && router_is_me(exit)) {
- log_fn(LOG_NOTICE,"Your ORPort is reachable from the outside. Excellent.");
- router_orport_found_reachable();
- }
+ reachable. But we remember reachability in onionskin_answer(),
+ so there's no need to record anything here. Just close the circ. */
circuit_mark_for_close(circ);
}
if (!at_last_hop)
circuit_launch_by_identity(CIRCUIT_PURPOSE_TESTING, me->identity_digest, 0, 0, 1);
else
- log_fn(LOG_NOTICE,"The testing circuit has failed. Guess you're not reachable yet.");
+ log_fn(LOG_INFO,"Our testing circuit (to see if your ORPort is reachable) has failed. I'll try again later.");
}
/** The circuit <b>circ</b> has just become open. Take the next
*/
/** Whether we can reach our ORPort from the outside. */
-static int can_reach_or_port = 1;
+static int can_reach_or_port = 0;
/** Whether we can reach our DirPort from the outside. */
-static int can_reach_dir_port = 1;
+static int can_reach_dir_port = 0;
void consider_testing_reachability(void) {
routerinfo_t *me = router_get_my_routerinfo();
/** Our router has just moved to a new IP. Reset stats. */
void server_has_changed_ip(void) {
stats_n_seconds_working = 0;
-// can_reach_or_port = 0;
-// can_reach_dir_port = 0;
+ can_reach_or_port = 0;
+ can_reach_dir_port = 0;
mark_my_descriptor_dirty();
}