aboutsummaryrefslogtreecommitdiff
path: root/src/or/command.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2002-09-17 08:14:37 +0000
committerRoger Dingledine <arma@torproject.org>2002-09-17 08:14:37 +0000
commit09daf01e4a0f2faed10cab14fec5f7d32dc3bd31 (patch)
tree8bcbd9ac0f4a844bfb6e91b85285abea405d837e /src/or/command.c
parent6cb8a91d5cbb1217a43119cc0e98b14d2c565d37 (diff)
downloadtor-09daf01e4a0f2faed10cab14fec5f7d32dc3bd31.tar.gz
tor-09daf01e4a0f2faed10cab14fec5f7d32dc3bd31.zip
added 'connected' cell type
see http://archives.seul.org/or/dev/Sep-2002/msg00018.html svn:r103
Diffstat (limited to 'src/or/command.c')
-rw-r--r--src/or/command.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/or/command.c b/src/or/command.c
index 0e2d34c4b3..bbcb6d23fd 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -22,6 +22,9 @@ void command_process_cell(cell_t *cell, connection_t *conn) {
case CELL_SENDME:
command_process_sendme_cell(cell, conn);
break;
+ case CELL_CONNECTED:
+ command_process_connected_cell(cell, conn);
+ break;
default:
log(LOG_DEBUG,"Cell of unknown type (%d) received. Dropping.", cell->command);
break;
@@ -297,3 +300,22 @@ void command_process_destroy_cell(cell_t *cell, connection_t *conn) {
circuit_free(circ);
}
+void command_process_connected_cell(cell_t *cell, connection_t *conn) {
+ circuit_t *circ;
+
+ circ = circuit_get_by_aci_conn(cell->aci, conn);
+
+ if(!circ) {
+ log(LOG_DEBUG,"command_process_connected_cell(): unknown circuit %d. Dropping.", cell->aci);
+ return;
+ }
+
+ if(circ->n_conn != conn) {
+ log(LOG_WARNING,"command_process_connected_cell(): cell didn't come from n_conn! (aci %d)",cell->aci);
+ return;
+ }
+
+ log(LOG_DEBUG,"command_process_connected_cell(): Received for aci %d.",cell->aci);
+ connection_send_connected(circ->p_aci, circ->p_conn);
+}
+