diff options
author | Nick Mathewson <nickm@torproject.org> | 2003-09-25 05:17:11 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2003-09-25 05:17:11 +0000 |
commit | 3d4ccb781ae5d74f0e16a63c89e08459d15cccf1 (patch) | |
tree | 3e9f214701c4a09bc45b453374bd6806f253a1a4 /src/or/connection_or.c | |
parent | a3bd8b5483bfb3813ba814c8d73840ca993e0298 (diff) | |
download | tor-3d4ccb781ae5d74f0e16a63c89e08459d15cccf1.tar.gz tor-3d4ccb781ae5d74f0e16a63c89e08459d15cccf1.zip |
Refactor buffers; implement descriptors.
'buf_t' is now an opaque type defined in buffers.c .
Router descriptors now include all keys; routers generate keys as
needed on startup (in a newly defined "data directory"), and generate
their own descriptors. Descriptors are now self-signed.
Implementation is not complete: descriptors are never published; and
upon receiving a descriptor, the directory doesn't do anything with
it.
At least "routers.or" and orkeygen are now obsolete, BTW.
svn:r483
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r-- | src/or/connection_or.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 026de91de0..6859cff6e1 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -99,7 +99,8 @@ connection_t *connection_or_connect(routerinfo_t *router) { conn->addr = router->addr; conn->port = router->or_port; conn->bandwidth = router->bandwidth; - conn->pkey = crypto_pk_dup_key(router->pkey); + conn->onion_pkey = crypto_pk_dup_key(router->onion_pkey); + conn->link_pkey = crypto_pk_dup_key(router->link_pkey); conn->address = strdup(router->address); if(connection_add(conn) < 0) { /* no space, forget it */ @@ -148,9 +149,9 @@ int connection_write_cell_to_buf(const cell_t *cellp, connection_t *conn) { int connection_process_cell_from_inbuf(connection_t *conn) { char buf[CELL_NETWORK_SIZE]; cell_t cell; - - log_fn(LOG_DEBUG,"%d: starting, inbuf_datalen %d.",conn->s,conn->inbuf_datalen); - if(conn->inbuf_datalen < CELL_NETWORK_SIZE) /* entire response available? */ + + log_fn(LOG_DEBUG,"%d: starting, inbuf_datalen %d.",conn->s,buf_datalen(conn->inbuf)); + if(buf_datalen(conn->inbuf) < CELL_NETWORK_SIZE) /* entire response available? */ return 0; /* not yet */ connection_fetch_from_buf(buf, CELL_NETWORK_SIZE, conn); |