Commit Graph

65 Commits

Author SHA1 Message Date
Valentin Lorentz
dce3c97fe4 Socket: Only catch select.error if it is an interupted system call. 2013-06-29 13:44:42 +02:00
Valentin Lorentz
75654a4544 Socket: Prevent crash caused when a signal is received while using select. Closes GH-477. 2013-06-29 12:40:45 +02:00
Carsten Teibes
7129dc2697 Switch to charade, which is better maintained and works under 2 and 3 2013-06-27 19:36:44 +02:00
Valentin Lorentz
8aba15807d Socket: Assert 'irc' is not None. 2013-06-01 12:08:12 +02:00
Valentin Lorentz
2016983d35 Add supybot.utils.net.getAddressFromHostname() and improve Socket driver to try successively all IP addresses. 2013-05-31 17:21:10 +02:00
Valentin Lorentz
ddd8314884 Socket: Close the socket more nicely. 2013-03-27 16:32:26 +01:00
Valentin Lorentz
cac96aa5f7 Socket: Fix race condition in SSL handshakes. 2013-03-21 17:21:20 +00:00
Valentin Lorentz
7f2d38b885 Socket: Fix compatibility with Python 3.1. 2013-02-22 20:43:27 +00:00
Valentin Lorentz
7588472f36 Fix 'Transport endpoint not connected' errors. Closes GH-437. 2013-01-31 16:47:17 +01:00
Alexander Ralph Michael Minges
bbdd55bea2 Add fallback decoding if chardet fails to guess the correct encoding 2013-01-20 17:07:58 +01:00
Alexander Ralph Michael Minges
4316e5936e Use chardet to guess the character encoding when on python3 2013-01-15 20:55:42 +01:00
Valentin Lorentz
3dba9088b0 Merge remote-tracking branch 'supybot/master' into testing
Conflicts:
	INSTALL
	plugins/ChannelLogger/README.txt
	plugins/ChannelStats/README.txt
	plugins/Google/plugin.py
	plugins/Google/test.py
	plugins/Plugin/test.py
	plugins/Web/test.py
	setup.py
	src/callbacks.py
	src/ircdb.py
	src/irclib.py
	src/utils/str.py
	test/test_irclib.py
2013-01-01 21:11:24 +01:00
Valentin Lorentz
7b3ef56116 Fix mysterious bug when connecting/disconnecting. 2012-12-26 19:58:39 +01:00
Valentin Lorentz
790f0eea35 socket: Fix compatibility issue with Python 3 (introduced in 8cf094a). 2012-12-26 15:03:57 +01:00
Valentin Lorentz
69c60ca1f5 Remove debug output. 2012-12-08 05:16:00 +00:00
Valentin Lorentz
8cf094a628 Socket: Use select.select() instead of checking sockets one by one. Closes GH-431. Closes GH-420. 2012-12-07 21:41:50 +01:00
Valentin Lorentz
7d22d3dc36 Prevent NameError if ssl module can't be imported. 2012-12-07 01:48:05 +00:00
Valentin Lorentz
5f1c21c644 Remove temporary files. 2012-11-04 01:29:37 +01:00
Valentin Lorentz
e9755a6486 Add fix missing in previous commit. 2012-11-04 01:28:24 +01:00
Valentin Lorentz
6b881d6509 Socket driver: Apply supybot.drivers.poll as soon as modified (do not require reconnect). 2012-10-10 19:39:28 +02:00
Valentin Lorentz
156b3d93e1 Socket driver: Add support for Socks proxies. 2012-10-07 13:13:08 +02:00
James McCoy
82ecf36fcd Update my name/contact information
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2012-09-01 10:16:48 -04:00
Valentin Lorentz
041893aaf9 Socket driver: encode strings just before sending them. 2012-08-05 13:47:48 +02:00
Valentin Lorentz
d28fa0cbdf Make Socket driver compatible with py3k. 2012-08-04 12:00:02 +02:00
James McCoy
edca443eed Just create schedule.schedule/drivers.Twisted.poller without any guard
These module-level variables had historically been created such that reloading
the module wouldn't redefine the variable.  However, none of our code reloads
the modules and the guard to prevent redefining the variable was broken so it
would've been redefined anyway.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>

Conflicts:

	src/schedule.py
2012-05-25 18:14:10 +02:00
James McCoy
97e71bd2cd Just create schedule.schedule/drivers.Twisted.poller without any guard
These module-level variables had historically been created such that reloading
the module wouldn't redefine the variable.  However, none of our code reloads
the modules and the guard to prevent redefining the variable was broken so it
would've been redefined anyway.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2012-05-22 22:38:44 -04:00
Valentin Lorentz
2432df156d Fix SSL issues caused by redundant patches. 2012-04-03 17:14:07 +02:00
Valentin Lorentz
e92b8a62f5 Merge supybot's master (will make future merges easier)
Conflicts:
	plugins/Misc/plugin.py
	plugins/String/plugin.py
	src/drivers/Socket.py
	src/irclib.py
	src/ircutils.py
2012-04-03 16:55:29 +02:00
James McCoy
b8c43dc5cc Perform all received* IrcMsg tagging in one spot.
This also fixes a long-standing failing Misc test since it was relying on the
receivedAt tag.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2011-12-13 18:06:26 +01:00
James McCoy
4ddfae427f Perform all received* IrcMsg tagging in one spot.
This also fixes a long-standing failing Misc test since it was relying on the
receivedAt tag.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2011-12-05 23:52:38 -05:00
Daniel Folkinshteyn
df5391dcf7 Socket driver: implement ssl connection support.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
2011-10-22 14:09:06 -04:00
Valentin Lorentz
49dfa69b91 Fix actually compatibility with non-ssl envirronments 2010-12-12 14:33:36 +01:00
Valentin Lorentz
a58e270516 Fix issue with Pypy 2010-12-12 14:22:44 +01:00
Valentin Lorentz
96ea659030 Add SSL support for Socket driver 2010-12-09 19:33:35 +01:00
James Vega
8d5e4ba624 Twisted: Send all available ircmsgs and reduce delay between checks
All ircmsgs that takeMsg will return should be processed each time
checkIrcForMsgs is called since there may be multiple available in the
fastqueue.

Reduced the time between calls of checkIrcForMsgs so the delay between
normally queued ircmsgs stays close to the configured throttleTime.

Closes: Sf#3018148
(cherry picked from commit adc5d62bbf)
2010-08-24 19:49:54 -04:00
James Vega
ff760d1c69 Socket: Ensure driver is flagged as disconnected after a socket error.
Users were occasionally hitting a situation where the socket had errored,
causing a reconnect, but the socket wasn't closed nor the driver marked as
disconnected.  This resulted in run() continuing to try and use the driver,
which would cause another error, schedule another reconnect, log an error, ad
infinitum.

Closes: Sf#2965530

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit a278d17f2b)
2010-08-24 19:49:38 -04:00
James Vega
adc5d62bbf Twisted: Send all available ircmsgs and reduce delay between checks
All ircmsgs that takeMsg will return should be processed each time
checkIrcForMsgs is called since there may be multiple available in the
fastqueue.

Reduced the time between calls of checkIrcForMsgs so the delay between
normally queued ircmsgs stays close to the configured throttleTime.

Closes: Sf#3018148
2010-06-18 20:33:43 -04:00
James Vega
a278d17f2b Socket: Ensure driver is flagged as disconnected after a socket error.
Users were occasionally hitting a situation where the socket had errored,
causing a reconnect, but the socket wasn't closed nor the driver marked as
disconnected.  This resulted in run() continuing to try and use the driver,
which would cause another error, schedule another reconnect, log an error, ad
infinitum.

Closes: Sf#2965530

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-05-24 23:36:29 -04:00
James Vega
10342acd11 Re-fix IrcDriver, which actually does need the args to __init__ 2009-03-11 13:37:27 -04:00
James Vega
5fabe8f747 Do not pass arguments to object.__init__ in IrcDriver.__init__ 2009-03-11 13:37:27 -04:00
James Vega
c23c84a725 Twisted.py: Remove useless code 2009-03-11 13:37:27 -04:00
James Vega
d72b696739 Do not pass arguments to object's __init__ 2009-03-11 13:37:26 -04:00
James Vega
e31d352e57 Correct the logic in _handleSocketError 2009-03-11 13:37:25 -04:00
James Vega
9b79f112a0 src/drivers/__init__.py: Make Socket the default driver since Twisted has been causing so many problems lately. 2006-04-13 14:26:06 +00:00
Ali Afshar
26c0adf768 added support for Twisted2.0 by preventing the twisted reactor from spawning threads for dns queries. 2006-02-14 23:45:51 +00:00
James Vega
a3e4fc5b1d Change the modeline to use softtabstop instead of tabstop. 2006-02-11 15:52:51 +00:00
Jeremy Fincher
660776f804 Fixed twisted.internet.ssl imports to work still if OpenSSL isn't installed. 2005-05-23 19:38:29 +00:00
Jeremy Fincher
ff2eb7daa9 Tried (again) to fix bug #1156765. This might resurrect some old bugs, such as the inability to quit via Ctrl-C or similar. It must be tested. 2005-05-20 16:29:17 +00:00
Jeremy Fincher
8730832e69 Refactored the Socket driver, hopefully to resolve the currently outstanding bugs (#1156765 and #1097217) with it. 2005-05-19 23:39:19 +00:00
Jeremy Fincher
6986bbad16 Changed the log message for trying SSL with Socket driver to point people in the direction of Twisted. 2005-05-19 23:38:55 +00:00