aboutsummaryrefslogtreecommitdiffstats
path: root/lib/proxy.h
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-10-25 01:06:22 -0300
committerdequis <dx@dxzone.com.ar>2015-10-26 00:42:15 -0300
commit4e365cec5275e3dec782af3ec0bc9a651cc2b831 (patch)
tree08382036a53279ac3681ea848e423ebc1881beb7 /lib/proxy.h
parentf710673a3d6f7d602c8261789ae78a4f273fb1a9 (diff)
Add proxy_disconnect() to interrupt possibly pending connections
Fixes trac ticket 1198, https://bugs.bitlbee.org/bitlbee/ticket/1198 This function can be used as a safe drop-in replacement to closesocket() If a proxy connection is pending (connected callback still not called), it looks up the PHB in a hash table indexed by fd. If it is there, it closes, frees the phb and avoids further calls to the callback. If it is not in there, it just does closesocket()
Diffstat (limited to 'lib/proxy.h')
-rw-r--r--lib/proxy.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/proxy.h b/lib/proxy.h
index eaf31375..3c1b019b 100644
--- a/lib/proxy.h
+++ b/lib/proxy.h
@@ -48,5 +48,6 @@ extern char proxyuser[128];
extern char proxypass[128];
G_MODULE_EXPORT int proxy_connect(const char *host, int port, b_event_handler func, gpointer data);
+G_MODULE_EXPORT void proxy_disconnect(int fd);
#endif /* _PROXY_H_ */