diff options
author | Roger Dingledine <arma@torproject.org> | 2002-08-24 07:55:49 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2002-08-24 07:55:49 +0000 |
commit | b8b8ab2fd6753c3f8b1e20e43047e29b5e44aea1 (patch) | |
tree | 2e72985b0977fbd95ca50020c334c8ca35d86ee8 /src/or/connection_ap.c | |
parent | c040bbe053b53ed368a4fe2836ca401c87845090 (diff) | |
download | tor-b8b8ab2fd6753c3f8b1e20e43047e29b5e44aea1.tar tor-b8b8ab2fd6753c3f8b1e20e43047e29b5e44aea1.tar.gz |
port is now kept in host order except in sin_port
svn:r82
Diffstat (limited to 'src/or/connection_ap.c')
-rw-r--r-- | src/or/connection_ap.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/or/connection_ap.c b/src/or/connection_ap.c index 99c0932e8..9d96ae85b 100644 --- a/src/or/connection_ap.c +++ b/src/or/connection_ap.c @@ -125,7 +125,7 @@ int ap_handshake_process_ss(connection_t *conn) { if(connection_fetch_from_buf(conn->dest_port,conn->dest_port_len,conn) < 0) return -1; - log(LOG_DEBUG,"ap_handshake_process_ss(): Read dest_port (network order) '%s'.",conn->dest_port); + log(LOG_DEBUG,"ap_handshake_process_ss(): Read dest_port '%s'.",conn->dest_port); conn->dest_port_received = conn->dest_port_len; } @@ -202,7 +202,7 @@ int ap_handshake_establish_circuit(connection_t *conn, unsigned int *route, int circ->cpathlen = routelen; log(LOG_DEBUG,"ap_handshake_establish_circuit(): Looking for firsthop '%s:%u'", - firsthop->address,ntohs(firsthop->or_port)); + firsthop->address,firsthop->or_port); n_conn = connection_twin_get_by_addr_port(firsthop->addr,firsthop->or_port); if(!n_conn) { /* not currently connected */ circ->n_addr = firsthop->addr; @@ -257,7 +257,7 @@ int ap_handshake_send_onion(connection_t *ap_conn, connection_t *n_conn, circuit circ->n_aci = get_unique_aci_by_addr_port(circ->n_addr, circ->n_port, ACI_TYPE_BOTH); circ->n_conn = n_conn; - log(LOG_DEBUG,"ap_handshake_send_onion(): n_conn is %s:%u",n_conn->address,ntohs(n_conn->port)); + log(LOG_DEBUG,"ap_handshake_send_onion(): n_conn is %s:%u",n_conn->address,n_conn->port); /* deliver the onion as one or more create cells */ cell.command = CELL_CREATE; @@ -267,9 +267,7 @@ int ap_handshake_send_onion(connection_t *ap_conn, connection_t *n_conn, circuit tmpbuf = malloc(tmpbuflen); if(!tmpbuf) return -1; - circ->onionlen = htonl(circ->onionlen); - memcpy(tmpbuf,&circ->onionlen,4); - circ->onionlen = ntohl(circ->onionlen); + *(uint32_t*)tmpbuf = htonl(circ->onionlen); memcpy(tmpbuf+4, circ->onion, circ->onionlen); dataleft = tmpbuflen; |