Changeset 4e365ce for lib/proxy.h


Ignore:
Timestamp:
2015-10-26T03:42:15Z (5 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
0db6618
Parents:
f710673
git-author:
dequis <dx@…> (25-10-15 04:06:22)
git-committer:
dequis <dx@…> (26-10-15 03:42:15)
Message:

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()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/proxy.h

    rf710673 r4e365ce  
    4949
    5050G_MODULE_EXPORT int proxy_connect(const char *host, int port, b_event_handler func, gpointer data);
     51G_MODULE_EXPORT void proxy_disconnect(int fd);
    5152
    5253#endif /* _PROXY_H_ */
Note: See TracChangeset for help on using the changeset viewer.