Commit dd41fe9e by Michael Pastushkov

fix

parent 7d496dba
...@@ -359,13 +359,17 @@ int use(void) ...@@ -359,13 +359,17 @@ int use(void)
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) {
perror("use: select()"); // perror("use: select()");
break; // break;
} // }
FD_ZERO(&io); FD_ZERO(&io);
FD_SET(rc.client_socket, &io); FD_SET(rc.client_socket, &io);
if (select(rc.client_socket+1, &io, NULL, NULL, NULL) < 0) {
perror("use: select 1()");
break;
}
if (FD_ISSET(rc.client_socket, &io)) if (FD_ISSET(rc.client_socket, &io))
{ {
/* Processing request from local, sending it to remote*/ /* Processing request from local, sending it to remote*/
...@@ -399,6 +403,10 @@ int use(void) ...@@ -399,6 +403,10 @@ int use(void)
FD_ZERO(&io); FD_ZERO(&io);
FD_SET(rc.remote_socket, &io); FD_SET(rc.remote_socket, &io);
if (select(rc.remote_socket+1, &io, NULL, NULL, NULL) < 0) {
perror("use: select 2()");
break;
}
if (FD_ISSET(rc.remote_socket, &io)) if (FD_ISSET(rc.remote_socket, &io))
{ {
/* Processing response from remote, sending it back to local */ /* Processing response from remote, sending it back to local */
......
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