diff options
author | Roger Dingledine <arma@torproject.org> | 2002-07-02 09:36:58 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2002-07-02 09:36:58 +0000 |
commit | d982925593dbb724e4c8ebeb4f945c2184f11831 (patch) | |
tree | c3f22938ad261f3c45ed2744ae0950388c1c04e8 /src/or/connection_exit.c | |
parent | b34fad4d38ac9c45eb2112fa9dde26e499ccdcc5 (diff) | |
download | tor-d982925593dbb724e4c8ebeb4f945c2184f11831.tar tor-d982925593dbb724e4c8ebeb4f945c2184f11831.tar.gz |
Integrated onion proxy into or/
The 'or' process can now be told (by the global_role variable) what
roles this server should play -- connect to all ORs, listen for ORs,
listen for OPs, listen for APs, or any combination.
* everything in /src/op/ is now obsolete.
* connection_ap.c now handles all interactions with application proxies
* "port" is now or_port, op_port, ap_port. But routers are still always
referenced (say, in conn_get_by_addr_port()) by addr / or_port. We
should make routers.c actually read these new ports (currently I've
kludged it so op_port = or_port+10, ap_port=or_port+20)
* circuits currently know if they're at the beginning of the path because
circ->cpath is set. They use this instead for crypts (both ways),
if it's set.
* I still obey the "send a 0 back to the AP when you're ready" protocol,
but I think we should phase it out. I can simply not read from the AP
socket until I'm ready.
I need to do a lot of cleanup work here, but the code appears to work, so
now's a good time for a checkin.
svn:r22
Diffstat (limited to 'src/or/connection_exit.c')
-rw-r--r-- | src/or/connection_exit.c | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/src/or/connection_exit.c b/src/or/connection_exit.c index 99a6760bc..eec917a8e 100644 --- a/src/or/connection_exit.c +++ b/src/or/connection_exit.c @@ -18,53 +18,12 @@ int connection_exit_process_inbuf(connection_t *conn) { log(LOG_DEBUG,"connection_exit_process_inbuf(): text from server while in 'connecting' state. Leaving it on buffer."); return 0; case EXIT_CONN_STATE_OPEN: - return connection_exit_package_inbuf(conn); + return connection_package_raw_inbuf(conn); } return 0; } -int connection_exit_package_inbuf(connection_t *conn) { - int amount_to_process; - cell_t cell; - circuit_t *circ; - - assert(conn && conn->type == CONN_TYPE_EXIT); - - amount_to_process = conn->inbuf_datalen; - - if(!amount_to_process) - return 0; - - if(amount_to_process > CELL_PAYLOAD_SIZE) { - cell.length = CELL_PAYLOAD_SIZE; - } else { - cell.length = amount_to_process; - } - - if(connection_fetch_from_buf(cell.payload, cell.length, conn) < 0) { - return -1; - } - - circ = circuit_get_by_conn(conn); - if(!circ) { - log(LOG_DEBUG,"connection_exit_package_inbuf(): conn has no circuits!"); - return -1; - } - - log(LOG_DEBUG,"connection_exit_package_inbuf(): Packaging %d bytes.",cell.length); - cell.aci = circ->p_aci; - cell.command = CELL_DATA; - if(circuit_deliver_data_cell(&cell, circ, circ->p_conn, 'e') < 0) { - log(LOG_DEBUG,"connection_exit_package_inbuf(): circuit_deliver_data_cell (backward) failed. Closing."); - circuit_close(circ); - return 0; - } - if(amount_to_process > CELL_PAYLOAD_SIZE) - return(connection_exit_package_inbuf(conn)); - return 0; -} - int connection_exit_finished_flushing(connection_t *conn) { int e, len=sizeof(e); |