From 3d4ccb781ae5d74f0e16a63c89e08459d15cccf1 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 25 Sep 2003 05:17:11 +0000 Subject: 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 --- src/or/connection_or.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/or/connection_or.c') 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); -- cgit v1.2.3-54-g00ecf