Skip to content

Commit

Permalink
do tcp timeout & cleanup same as tls
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Mauchle committed May 12, 2017
1 parent 0f342f7 commit 5f70899
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,20 @@ void *tcpclientrd(void *arg) {
for (;;) {
/* yes, lastconnecttry is really necessary */
lastconnecttry = server->lastconnecttry;
buf = radtcpget(server->sock, 0);
buf = radtcpget(server->sock, server->dynamiclookuparg ? IDLE_TIMEOUT : 0);
if (!buf) {
if (server->dynamiclookuparg)
break;
tcpconnect(server, &lastconnecttry, 0, "tcpclientrd");
continue;
}

replyh(server, buf);
}
server->clientrdgone = 1;
pthread_mutex_lock(&server->newrq_mutex);
pthread_cond_signal(&server->newrq_cond);
pthread_mutex_unlock(&server->newrq_mutex);
return NULL;
}

Expand Down

0 comments on commit 5f70899

Please sign in to comment.