From 2c0f4a5abbc5663417d1390f658b387378e28978 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 23 Feb 2013 14:28:33 +0100 Subject: Use fastd_peer_t instead of fastd_peer_config_t in handshake code Directly using the peers allows us to get rid of the inefficient get_peer() function and is necessary for adding support for unknown peers. --- src/handshake.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/handshake.c') diff --git a/src/handshake.c b/src/handshake.c index 860ec1b..d28ebad 100644 --- a/src/handshake.c +++ b/src/handshake.c @@ -180,7 +180,7 @@ static fastd_string_stack_t* parse_string_list(uint8_t *data, size_t len) { return ret; } -void fastd_handshake_handle(fastd_context_t *ctx, fastd_socket_t *sock, const fastd_peer_address_t *address, const fastd_peer_config_t *peer_conf, fastd_buffer_t buffer) { +void fastd_handshake_handle(fastd_context_t *ctx, fastd_socket_t *sock, const fastd_peer_address_t *address, fastd_peer_t *peer, fastd_buffer_t buffer) { if (buffer.len < sizeof(fastd_packet_t)) { pr_warn(ctx, "received a short handshake from %I", address); goto end_free; @@ -307,7 +307,7 @@ void fastd_handshake_handle(fastd_context_t *ctx, fastd_socket_t *sock, const fa fastd_send_handshake(ctx, sock, address, reply_buffer); } else { - ctx->conf->protocol->handshake_handle(ctx, sock, address, peer_conf, &handshake, method); + ctx->conf->protocol->handshake_handle(ctx, sock, address, peer, &handshake, method); } } else { @@ -334,7 +334,7 @@ void fastd_handshake_handle(fastd_context_t *ctx, fastd_socket_t *sock, const fa goto end_free; } - ctx->conf->protocol->handshake_handle(ctx, sock, address, peer_conf, &handshake, method); + ctx->conf->protocol->handshake_handle(ctx, sock, address, peer, &handshake, method); } else { const char *error_field_str; -- cgit v1.2.3