/* returns 1 if the connection should be serviced again immediately, 0 if there
is no data waiting, or < 0 if it should be closed */
-static int service_connection(curl_socket_t msgsock,
+static int service_connection(curl_socket_t *msgsock,
struct sws_httprequest *req,
curl_socket_t listensock,
const char *connecthost,
return -1;
while(!req->done_processing) {
- int rc = sws_get_request(msgsock, req);
+ int rc = sws_get_request(*msgsock, req);
if(rc <= 0) {
/* Nothing further to read now, possibly because the socket was closed */
return rc;
}
}
- sws_send_doc(msgsock, req);
+ sws_send_doc(*msgsock, req);
if(got_exit_signal)
return -1;
return 1;
}
else {
- http_connect(&msgsock, listensock, connecthost, req->connect_port,
+ http_connect(msgsock, listensock, connecthost, req->connect_port,
keepalive_secs);
return -1;
}
/* Service this connection until it has nothing available */
do {
- rc = service_connection(all_sockets[socket_idx], req, sock,
+ rc = service_connection(&all_sockets[socket_idx], req, sock,
connecthost, keepalive_secs);
if(got_exit_signal)
goto sws_cleanup;