6fe66e36fae18d828825a6c551b5bb5ec05afab1 galt Thu Sep 13 11:41:17 2012 -0700 add tracking of connect-failures to hgCustom and hgTracks which may have many bigDataUrls pointing to the same failing site; also fixed a bug in the timeout handling of EINTR diff --git src/inc/net.h src/inc/net.h index 91c6882..e1ea0d4 100644 --- src/inc/net.h +++ src/inc/net.h @@ -1,27 +1,44 @@ /* Net.h some stuff to wrap around net communications. * * This file is copyright 2002 Jim Kent, but license is hereby * granted for all use - public, private or commercial. */ #ifndef NET_H #define NET_H #include "linefile.h" #include "dystring.h" +void setConnFailuresEnabled(boolean val); +/* Turn on or off the connFailures feature */ + +boolean checkConnFailure(char *hostName, int port, char **pErrStr); +/* check if this hostName:port has already had failure + * which can save time and avoid more timeouts */ + +void addConnFailure(char *hostName, int port, char *format, ...) +/* add a failure to connFailures[] + * which can save time and avoid more timeouts */ +#if defined(__GNUC__) +__attribute__((format(printf, 3, 4))) +#endif +; + +/* add a failure to connFailures[] + * which can save time and avoid more timeouts */ int netConnect(char *hostName, int port); /* Start connection with a server having resolved port. Return < 0 if error. */ int netMustConnect(char *hostName, int port); /* Start connection with server or die. */ int netMustConnectTo(char *hostName, char *portName); /* Start connection with a server and a port that needs to be converted to integer */ int netAcceptingSocket(int port, int queueSize); /* Create a socket for to accept connections. */ int netAcceptingSocketFrom(int port, int queueSize, char *host); /* Create a socket that can accept connections from a * IP address on the current machine if the current machine