Commit c7471de0 by Michael Pastushkov

fix

parent 06c2d634
...@@ -356,7 +356,7 @@ int use(void) ...@@ -356,7 +356,7 @@ int use(void)
FD_ZERO(&io); FD_ZERO(&io);
FD_SET(rc.client_socket, &io); FD_SET(rc.client_socket, &io);
FD_SET(rc.remote_socket, &io); FD_SET(rc.remote_socket, &io);
int max_fd = (rc.client_socket > rc.remote_socket) ? rc.client_socket : rc.remote_socket; //int max_fd = (rc.client_socket > rc.remote_socket) ? rc.client_socket : rc.remote_socket;
/* Waiting for data */ /* Waiting for data */
// if (select(max_fd+1, &io, NULL, NULL, NULL) < 0) { // if (select(max_fd+1, &io, NULL, NULL, NULL) < 0) {
...@@ -393,12 +393,12 @@ int use(void) ...@@ -393,12 +393,12 @@ int use(void)
decode(buffer, count_recv) : decode(buffer, count_recv) :
encode(buffer, count_recv); encode(buffer, count_recv);
/* count_sent */ = (options.proto == SOCK_DGRAM) ? /* count_sent = */(options.proto == SOCK_DGRAM) ?
sendto(rc.remote_socket, buffer, count_recv, 0, (struct sockaddr *)&rc.remote_addr, sizeof(rc.remote_addr)) : sendto(rc.remote_socket, buffer, count_recv, 0, (struct sockaddr *)&rc.remote_addr, sizeof(rc.remote_addr)) :
send(rc.remote_socket, buffer, count_recv, 0); send(rc.remote_socket, buffer, count_recv, 0);
if (options.log > 1) if (options.log > 1)
printf("sent %d\t%s:%d\tpid: %d\n", count_recv, inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port), getpid()); printf("recv %d\t%s:%d\tpid: %d\n", count_recv, inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port), getpid());
} }
FD_ZERO(&io); FD_ZERO(&io);
...@@ -434,7 +434,7 @@ int use(void) ...@@ -434,7 +434,7 @@ int use(void)
send(rc.client_socket, buffer, count_recv, 0); send(rc.client_socket, buffer, count_recv, 0);
if (options.log > 1) if (options.log > 1)
printf("sent %d\t%s:%d\tpid:\n", count_recv, inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port), getpid()); printf("sent %d\t%s:%d\tpid: %d\n", count_recv, inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port), getpid());
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment