From: Fabian Keil Date: Fri, 23 Apr 2010 11:53:48 +0000 (+0000) Subject: Rename socket_is_still_usable() to socket_is_still_alive(). X-Git-Tag: v_3_0_17~161 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=05dd2cc7b727e9600f3808d9156d94d1a3396155 Rename socket_is_still_usable() to socket_is_still_alive(). The fact that a socket is still alive doesn't mean that it's still (re)usable and given that the function only checks the former, the previous name was a bit misleading. --- diff --git a/gateway.c b/gateway.c index 30495309..b3dff394 100644 --- a/gateway.c +++ b/gateway.c @@ -1,4 +1,4 @@ -const char gateway_rcs[] = "$Id: gateway.c,v 1.63 2009/10/01 16:07:33 fabiankeil Exp $"; +const char gateway_rcs[] = "$Id: gateway.c,v 1.64 2009/10/03 10:37:49 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/gateway.c,v $ @@ -444,7 +444,7 @@ int close_unusable_connections(void) close_socket(reusable_connection[slot].sfd); mark_connection_closed(&reusable_connection[slot]); } - else if (!socket_is_still_usable(reusable_connection[slot].sfd)) + else if (!socket_is_still_alive(reusable_connection[slot].sfd)) { log_error(LOG_LEVEL_CONNECT, "The connection to %s:%d in slot %d is no longer usable. " diff --git a/jbsockets.c b/jbsockets.c index f5642730..b234b205 100644 --- a/jbsockets.c +++ b/jbsockets.c @@ -1,4 +1,4 @@ -const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.71 2009/12/16 08:35:47 fabiankeil Exp $"; +const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.72 2010/02/15 15:14:10 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $ @@ -1209,9 +1209,9 @@ unsigned long resolve_hostname_to_ip(const char *host) #ifdef FEATURE_CONNECTION_KEEP_ALIVE /********************************************************************* * - * Function : socket_is_still_usable + * Function : socket_is_still_alive * - * Description : Decides whether or not an open socket is still usable. + * Description : Figures out whether or not a socket is still alive. * * Parameters : * 1 : sfd = The socket to check. @@ -1219,7 +1219,7 @@ unsigned long resolve_hostname_to_ip(const char *host) * Returns : TRUE for yes, otherwise FALSE. * *********************************************************************/ -int socket_is_still_usable(jb_socket sfd) +int socket_is_still_alive(jb_socket sfd) { char buf[10]; int no_data_waiting; diff --git a/jbsockets.h b/jbsockets.h index ac982ed5..f19968c8 100644 --- a/jbsockets.h +++ b/jbsockets.h @@ -1,6 +1,6 @@ #ifndef JBSOCKETS_H_INCLUDED #define JBSOCKETS_H_INCLUDED -#define JBSOCKETS_H_VERSION "$Id: jbsockets.h,v 1.15 2009/05/10 10:12:30 fabiankeil Exp $" +#define JBSOCKETS_H_VERSION "$Id: jbsockets.h,v 1.16 2009/05/16 13:27:20 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jbsockets.h,v $ @@ -62,7 +62,7 @@ extern void get_host_information(jb_socket afd, char **ip_address, char **hostna extern unsigned long resolve_hostname_to_ip(const char *host); -extern int socket_is_still_usable(jb_socket sfd); +extern int socket_is_still_alive(jb_socket sfd); /* Revision control strings from this header and associated .c file */ extern const char jbsockets_rcs[]; diff --git a/jcc.c b/jcc.c index 3b0ba8f9..22e59ec0 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.314 2010/04/03 13:21:53 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.315 2010/04/12 16:51:31 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -1724,7 +1724,7 @@ static void chat(struct client_state *csp) #ifdef FEATURE_CONNECTION_KEEP_ALIVE if ((csp->server_connection.sfd != JB_INVALID_SOCKET) - && socket_is_still_usable(csp->server_connection.sfd) + && socket_is_still_alive(csp->server_connection.sfd) && connection_destination_matches(&csp->server_connection, http, fwd)) { log_error(LOG_LEVEL_CONNECT, @@ -2028,7 +2028,7 @@ static void chat(struct client_state *csp) if (FD_ISSET(csp->server_connection.sfd, &rfds)) { #ifdef FEATURE_CONNECTION_KEEP_ALIVE - if (!socket_is_still_usable(csp->cfd)) + if (!socket_is_still_alive(csp->cfd)) { #ifdef _WIN32 log_error(LOG_LEVEL_CONNECT, @@ -2533,7 +2533,7 @@ static void serve(struct client_state *csp) if (continue_chatting && !(csp->flags & CSP_FLAG_CRUNCHED)) { continue_chatting = (csp->server_connection.sfd != JB_INVALID_SOCKET) - && socket_is_still_usable(csp->server_connection.sfd); + && socket_is_still_alive(csp->server_connection.sfd); if (continue_chatting) { if (!(csp->flags & CSP_FLAG_SERVER_KEEP_ALIVE_TIMEOUT_SET)) @@ -2568,7 +2568,7 @@ static void serve(struct client_state *csp) } if ((csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE) && data_is_available(csp->cfd, (int)client_timeout) - && socket_is_still_usable(csp->cfd)) + && socket_is_still_alive(csp->cfd)) { log_error(LOG_LEVEL_CONNECT, "Client request arrived in " "time or the client closed the connection on socket %d.", @@ -2606,7 +2606,7 @@ static void serve(struct client_state *csp) csp->cfd); #ifdef FEATURE_CONNECTION_SHARING if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_SHARING) - && (socket_is_still_usable(csp->server_connection.sfd))) + && (socket_is_still_alive(csp->server_connection.sfd))) { time_t time_open = time(NULL) - csp->server_connection.timestamp;