aboutsummaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2002-11-27 04:08:20 +0000
committerRoger Dingledine <arma@torproject.org>2002-11-27 04:08:20 +0000
commit8f18647a33eedb1f579d67563fa29fefdb52400a (patch)
treecf70437a4865057c57d655db32066c7577580739 /src/or/or.h
parent147879ab17801d44098d19ec94e705f890070a81 (diff)
downloadtor-8f18647a33eedb1f579d67563fa29fefdb52400a.tar
tor-8f18647a33eedb1f579d67563fa29fefdb52400a.tar.gz
create cells are now queued and processed only when idle
we also queue data cells destined for a circuit that is pending, and process them once the circuit opens destroys reach into the queue and remove the pending onion, along with its collected data cells svn:r142
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 222e6b0f2..172955d67 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -114,12 +114,13 @@
#define DIR_CONN_STATE_COMMAND_WAIT 3
#define DIR_CONN_STATE_WRITING 4
-#define CIRCUIT_STATE_OPEN_WAIT 0 /* receiving/processing the onion */
-#define CIRCUIT_STATE_OR_WAIT 1 /* I'm at the beginning of the path, my firsthop is still connecting */
-#define CIRCUIT_STATE_OPEN 2 /* onion processed, ready to send data along the connection */
-#define CIRCUIT_STATE_CLOSE_WAIT1 3 /* sent two "destroy" signals, waiting for acks */
-#define CIRCUIT_STATE_CLOSE_WAIT2 4 /* received one ack, waiting for one more
- (or if just one was sent, waiting for that one */
+#define CIRCUIT_STATE_ONION_WAIT 0 /* receiving the onion */
+#define CIRCUIT_STATE_ONION_PENDING 1 /* waiting to process the onion */
+#define CIRCUIT_STATE_OR_WAIT 2 /* I'm at the beginning of the path, my firsthop is still connecting */
+#define CIRCUIT_STATE_OPEN 3 /* onion processed, ready to send data along the connection */
+//#define CIRCUIT_STATE_CLOSE_WAIT1 4 /* sent two "destroy" signals, waiting for acks */
+//#define CIRCUIT_STATE_CLOSE_WAIT2 5 /* received one ack, waiting for one more
+// (or if just one was sent, waiting for that one */
//#define CIRCUIT_STATE_CLOSE 4 /* both acks received, connection is dead */ /* NOT USED */
/* available cipher functions */
@@ -378,7 +379,7 @@ typedef struct
int DirRebuildPeriod;
int DirFetchPeriod;
int KeepalivePeriod;
- int OnionsPerSecond;
+ int MaxOnionsPending;
int Role;
int loglevel;
} or_options_t;
@@ -656,7 +657,11 @@ int main(int argc, char *argv[]);
int decide_aci_type(uint32_t local_addr, uint16_t local_port,
uint32_t remote_addr, uint16_t remote_port);
-int process_onion(circuit_t *circ, connection_t *conn);
+int onion_pending_add(circuit_t *circ);
+int onion_pending_check(void);
+void onion_pending_process_one(void);
+void onion_pending_remove(circuit_t *circ);
+void onion_pending_data_add(circuit_t *circ, cell_t *cell);
/* uses a weighted coin with weight cw to choose a route length */
int chooselen(double cw);