From b25c44bf6c8bfa862a5e1c64a6d76479e51928c0 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 21 Oct 2008 19:31:04 +0200 Subject: [PATCH] Fixed another bug. tcp data transfer is working --- fwp/lib/core/fwp_endpoint.c | 4 +++- fwp/lib/core/tests/fwp_prototest/fwp_sendrecv_test2.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fwp/lib/core/fwp_endpoint.c b/fwp/lib/core/fwp_endpoint.c index 79c53f7..940dbbc 100644 --- a/fwp/lib/core/fwp_endpoint.c +++ b/fwp/lib/core/fwp_endpoint.c @@ -391,15 +391,17 @@ int fwp_recv_conn(fwp_endpoint_d_t epointd, void *buffer, { fwp_endpoint_t *fwp_epoint = epointd; fwp_sockaddr_t *peer = &fwp_epoint->peer; - fd_set fdset; + fd_set fdset = fwp_epoint->fdset; ssize_t len; int i; + FWP_DEBUG("Checking for tcp data\n"); for (i = 0; i < fwp_epoint->nr_connections; i++) { if (!FD_ISSET(fwp_epoint->c_sockd[i], &fdset)) { continue; } + FWP_DEBUG("Prepare to receive tcp data\n"); peer->addrlen = sizeof(struct sockaddr_in); len = _fwp_recvfrom(fwp_epoint->c_sockd[i], buffer, buffer_size,0, peer); diff --git a/fwp/lib/core/tests/fwp_prototest/fwp_sendrecv_test2.c b/fwp/lib/core/tests/fwp_prototest/fwp_sendrecv_test2.c index f905d3d..0999da9 100644 --- a/fwp/lib/core/tests/fwp_prototest/fwp_sendrecv_test2.c +++ b/fwp/lib/core/tests/fwp_prototest/fwp_sendrecv_test2.c @@ -1,5 +1,5 @@ /** - * \file fwp_sendrecv_test1.c + * \file fwp_sendrecv_test2.c * * This a test application that: * - creates vres without negotiation @@ -18,6 +18,8 @@ #include #include +#define MSGN 2 + fwp_endpoint_attr_t attr; void* receiver(void* arg) @@ -34,7 +36,7 @@ void* receiver(void* arg) } FWP_DEBUG("Receive endpoint created \n"); - for (i = 0; i < 3; i++) { + for (i = 0; i < MSGN; i++) { if ((len = fwp_recv(repoint_d1, buffer, sizeof(buffer), &from, 0)) < 0) { perror("Error while receiving data::"); -- 2.39.2