aboutsummaryrefslogtreecommitdiffstats
path: root/lib/proxy.c
Commit message (Collapse)AuthorAgeLines
* Fix a double free when calling proxy_disconnect() inside phb->func()dequis2016-02-18-8/+23
| | | | | | | | | | | | | | | | Fixes trac ticket #1248 proxy_connected() calls phb->func(), then tries to do phb_free() directly afterwards, but that might have been freed by a proxy_disconnect() call during the execution of that callback. This one happened to several different people because some AIM server broke recently. This commit fixes it by implementing a phb_connected() function that removes the PHB from the hash table before calling phb->func(), which ensures that any proxy_disconnect() calls just close the fd and nothing else.
* proxy: fix validation of the proxytype valuedequis2015-12-09-1/+1
| | | | | | Coverity says it could be an out of bounds read, but the value is set internally, so not really. Still, good point about the condition being wrong.
* Add proxy_disconnect() to interrupt possibly pending connectionsdequis2015-10-26-1/+39
| | | | | | | | | | | 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()
* proxy: Turn phb_close() into phb_free(), use it for all g_free(phb)dequis2015-10-26-35/+40
| | | | More cleanup.
* proxy: Use an array of function pointers for proxy_connect_*dequis2015-10-25-10/+15
| | | | Just cleanup.
* socks4a proxy support (like socks4 with remote DNS)dequis2015-10-21-7/+22
| | | | | | | | | Fixes trac ticket 995 https://bugs.bitlbee.org/bitlbee/ticket/995 This is slightly pointless for the suggested use case (tor), since with socks5 we already send a hostname instead of an IP address. Either way, it was easy to implement, so I hope it helps.
* proxy: minor refactor, simplify error handlingdequis2015-04-05-110/+36
|
* Reindent everything to K&R style with tabsIndent2015-02-20-70/+79
| | | | | | | Used uncrustify, with the configuration file in ./doc/uncrustify.cfg Commit author set to "Indent <please@skip.me>" so that it's easier to skip while doing git blame.
* http proxy: only check for "HTTP/1.x 200" in the status stringdequis2015-01-16-2/+2
| | | | | It was checking for "Connection established" and some proxies use a different string, such as "Tunnel established" in polipo
* Fix some more g_source_remove warnings, this time in proxy.cdequis2015-01-16-0/+2
| | | | Both in gaim_io_connected(), visible when using an http proxy
* Fix compiler warnings on Cygwin and Mac OS X.Jason Copenhaver2015-01-16-4/+4
| | | | | | | | * Don't use PIE/PIC on Cygwin/Darwin unless specified as these platforms don't support it. * Cleanup warnings for 'make check' build. * Fix the type issue for getsockopt calls. * Fix enum warnings in Yahoo libs on Mac OS X.
* Fix incorrect Free Software Foundation addressMatej Cepl2015-01-16-1/+1
|
* RIP native win32 support (use cygwin instead)dequis2014-09-27-8/+0
| | | | It has been broken for a very long time and nobody cared about it.
* Add better handling of HTTP/1.1 and/or keepalive connections. This shouldWilmer van der Gaast2013-06-09-1/+1
| | | | | | let me close #641, and more importantly, prepares the Twitter module for an upcoming API change. https://dev.twitter.com/blog/deprecating-http-1.0-streaming-api
* Fixed dumb file descriptor leak.Wilmer van der Gaast2011-07-12-0/+1
|
* Another compatibility fix: AI_ADDRCONFIG doesn't exist on some systems.Wilmer van der Gaast2010-10-24-0/+3
|
* If a connection fails, try the next address from the getaddrinfo() results.Wilmer van der Gaast2010-08-15-50/+68
| | | | | | | | | | This should fix issues with hosts that have IPv6 and IPv4 addresses but listen on only one of them. (Bug #673) This also fixes a bug that broke error checking in gaim_io_connected(), until now event handlers were never actually getting proper error reporting (fd=-1), but IIRC they should all handle it anyway as I was never aware of this bug.
* Applied patch from wahjava (with some modifications) for bug #644. ThisWilmer van der Gaast2010-08-07-51/+54
| | | | | lets proxy_connect() connect to IPv6 hosts.
* Make purple use BitlBee's event handling API. Since the APIs never reallyWilmer van der Gaast2009-10-11-32/+32
| | | | | | | | | | diverged too much this is fairly transparent. I did rename and redefine GAIM_INPUT_* variables to really make it work without adding another stupid layer in between. One problem left, the new libpurple input API doesn't care about return values. Fixing that in the next CL.
* Removed a double g_free() in proxy.c (that couldn't actually ever beWilmer van der Gaast2008-12-14-1/+0
| | | | | invoked but was stupid anyway). #409.
* Added ClientInterface configuration option to make BitlBee bind() to aWilmer van der Gaast2008-04-06-0/+11
| | | | | specific interface before connecting to a remote host.
* Fixed a broken check in lib/proxy.c, this restores proxy support. ThanksWilmer van der Gaast2008-03-24-2/+2
| | | | | | | to Miles Bader for reporting this in the Debian BTS. Apparently not many people use this functionality, it was broken in bzr for more than a year already...
* Fixed return value check in proxy_connect(), since on some systemsWilmer van der Gaast2007-12-28-11/+10
| | | | | | a non-blocking connect() can return immediately (when connecting to localhost, for example). Closes bug #233 and #340.
* Fix GCC warning.Jelmer Vernooij2007-10-12-2/+2
|
* Merging from devel/Jelmer.Wilmer van der Gaast2006-06-25-4/+0
|
* Moved Base64-related functions to a separate file and added decode funtions.Wilmer van der Gaast2006-06-25-0/+1
|
* Moving all generic files to lib/ instead of having some in / and some inWilmer van der Gaast2006-06-25-0/+556
protocols/, and adding RC4 code.