diff options
author | Roger Dingledine <arma@torproject.org> | 2004-07-20 23:31:00 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-07-20 23:31:00 +0000 |
commit | 0da256ef976076709f7bbf503e6b6bc50a403380 (patch) | |
tree | 531b978e13bf5925c3cc91ed2f4aea3cd3bed2f0 /src/or/command.c | |
parent | 18d752e518c41f7190b77dc36d22150e89ffc115 (diff) | |
download | tor-0da256ef976076709f7bbf503e6b6bc50a403380.tar.gz tor-0da256ef976076709f7bbf503e6b6bc50a403380.zip |
when we get a sigint, don't accept new connections/circuits,
but delay 30 seconds until exiting.
if we get a second sigint, exit immediately.
svn:r2070
Diffstat (limited to 'src/or/command.c')
-rw-r--r-- | src/or/command.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/command.c b/src/or/command.c index d65f8c309b..284c4c6a9c 100644 --- a/src/or/command.c +++ b/src/or/command.c @@ -16,6 +16,7 @@ #include "or.h" extern or_options_t options; /* command-line and config-file options */ +extern int shutting_down; /* whether we should refuse create cells */ /** Keep statistics about how many of each type of cell we've received. */ unsigned long stats_n_padding_cells_processed = 0; @@ -126,6 +127,12 @@ void command_process_cell(cell_t *cell, connection_t *conn) { static void command_process_create_cell(cell_t *cell, connection_t *conn) { circuit_t *circ; + if(shutting_down) { + log_fn(LOG_INFO,"Received create cell but we're shutting down. Sending back destroy."); + connection_send_destroy(cell->circ_id, conn); + return; + } + circ = circuit_get_by_circ_id_conn(cell->circ_id, conn); if(circ) { |