diff options
author | Roger Dingledine <arma@torproject.org> | 2003-09-17 20:09:06 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2003-09-17 20:09:06 +0000 |
commit | b97945e41156f1da022c118d934e79c375d2a44e (patch) | |
tree | 8f9c7b4ec90bb60aa73c886e18f225c5b8e385a1 /src/or/connection.c | |
parent | a66669859e61ea3555dee60a77b11a3475bc7d6b (diff) | |
download | tor-b97945e41156f1da022c118d934e79c375d2a44e.tar tor-b97945e41156f1da022c118d934e79c375d2a44e.tar.gz |
add in directory 'post' support
svn:r471
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 2f723ae2b..5dead3f56 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -230,7 +230,7 @@ static int connection_init_accepted_conn(connection_t *conn) { conn->state = AP_CONN_STATE_SOCKS_WAIT; break; case CONN_TYPE_DIR: - conn->state = DIR_CONN_STATE_COMMAND_WAIT; + conn->state = DIR_CONN_STATE_SERVER_COMMAND_WAIT; break; } return 0; @@ -438,7 +438,8 @@ int connection_handle_read(connection_t *conn) { } if(connection_read_to_buf(conn) < 0) { - if(conn->type == CONN_TYPE_DIR && conn->state == DIR_CONN_STATE_CONNECTING) { + if(conn->type == CONN_TYPE_DIR && + (conn->state == DIR_CONN_STATE_CONNECTING_GET || DIR_CONN_STATE_CONNECTING_POST)) { /* it's a directory server and connecting failed: forget about this router */ /* XXX I suspect pollerr may make Windows not get to this point. :( */ router_forget_router(conn->addr,conn->port); @@ -526,6 +527,13 @@ int connection_fetch_from_buf(char *string, int len, connection_t *conn) { return fetch_from_buf(string, len, &conn->inbuf, &conn->inbuflen, &conn->inbuf_datalen); } +int connection_fetch_from_buf_http(connection_t *conn, + char *headers_out, int max_headerlen, + char *body_out, int max_bodylen) { + return fetch_from_buf_http(conn->inbuf,&conn->inbuf_datalen, + headers_out, max_headerlen, body_out, max_bodylen); +} + int connection_find_on_inbuf(char *string, int len, connection_t *conn) { return find_on_inbuf(string, len, conn->inbuf, conn->inbuf_datalen); } |