Commit graph

59 commits

Author SHA1 Message Date
Tom Nichols
879dd11daa reduced max quiesce delay to 6 minutes. We want to be fairly agressive here. 2010-07-09 16:16:07 -04:00
Tom Nichols
969c4652a4 wait, shouldn't 'port' default to 5222?? Would seem logical to me. 2010-07-09 16:15:18 -04:00
Tom Nichols
9506970042 removed useless 'use_tls' variable 2010-07-09 16:12:32 -04:00
Tom Nichols
3c6b07353d added keepalive to send thread 2010-07-09 16:06:53 -04:00
Brian Beggs
66c6c21ad8 kill the running threads before disconnecting 2010-07-09 15:36:13 -04:00
Tom Nichols
34eb88f199 Merge branch 'hacks' of git@github.com:tomstrummer/SleekXMPP into hacks 2010-07-07 13:19:21 -04:00
Thom Nichols
f3cf5f6080 added SSL certificate verification to startTLS method 2010-07-07 11:33:12 -04:00
Thom Nichols
85d8b9270f client must validate the server's SSL certificate against the CA list if it is provided. 2010-07-06 17:37:57 -04:00
Tom Nichols
259dffeb6e send now has a priority and an 'init' parameter to denote stanzas that may be sent prior to session establishment. 2010-07-06 14:16:46 -04:00
Thom Nichols
0a30e6c017 cleaned up disconnect/reconnect logic just a little 2010-07-02 18:05:50 -04:00
Tom Nichols
d381ab320a merged changes from origin/hacks 2010-07-02 17:14:37 -04:00
Tom Nichols
6e93982fdf trying to get xmlstream to reconnect on stream failure 2010-07-02 16:46:34 -04:00
Brian Beggs
4b00baab1e reconnection fix: xmlstream now catches XMLParserError and restarts the stream 2010-07-02 22:29:08 +08:00
Thom Nichols
62da57a6c2 Merge branch 'master' of git://github.com/macdiesel/SleekXMPP into hacks 2010-07-01 17:50:45 -04:00
Tom Nichols
cd2017b8b0 catch XML parse errors & don't attempt to reconnect. Also removed 'connecting' state from setStream method 2010-07-01 16:46:37 -04:00
Tom Nichols
dd9f33b7d9 removed some superfluous debug logging 2010-07-01 15:11:02 -04:00
Brian Beggs
f477ccf533 Merge remote branch 'tom/hacks' 2010-07-01 10:01:52 -04:00
Tom Nichols
15ac3e9fba race condition where we were transitioning to 'disconnected' and immediately reconnecting in another thread before the socket.close call occurred. Now we're locking the state machine until the disconnect routine completes. 2010-06-28 11:06:26 -04:00
Brian Beggs
f5d0466462 working on digest-md5 authentication 2010-06-18 09:51:29 -04:00
Thom Nichols
e7c37c4ec5 connect uses the new function-on-state-transition so when the connect method returns you are guaranteed to be either in the 'connected' or 'disconnected' state. Could remove the 'connecting' state except uses it. 2010-06-04 17:00:51 -04:00
Thom Nichols
919c8c5633 tweaked connectTCP call slightly to reduce possibility of 'connecting' state limbo 2010-06-03 15:21:26 -04:00
Thom Nichols
d20cd6b3e6 added function execution on transition, and more unit tests. 2010-06-03 13:51:11 -04:00
Thom Nichols
da6e1e47dc whups, somehow I lost the 'connecting' lock in connect() 2010-06-03 08:09:09 -04:00
Thom Nichols
1c32668e18 fixed quiesce algorithm; state transition if connect fails; note about use_tls instance variable. 2010-06-03 07:47:27 -04:00
Thom Nichols
4295a66c70 reconnection quiesce logic 2010-06-02 14:18:09 -04:00
Thom Nichols
7930ed22f2 overhauled state machine. Now allows for atomic transitions.
Next step: atomic function calls (and maybe 'handlers') on state transition.
2010-06-02 12:39:54 -04:00
Thom Nichols
4eb210bff5 fixed some major reconnection errors 2010-06-01 22:51:49 -04:00
Thom Nichols
1780ca900a merged a lot of fritzy's changes 2010-06-01 22:40:37 -04:00
Nathan Fritz
257bcadd96 control-c fixes 2010-06-01 22:07:52 +08:00
Nathan Fritz
194e6bcb51 added pubsub state stanzas and scheduled events 2010-06-01 22:07:52 +08:00
Nathan Fritz
2e7024419a adding scheduler 2010-06-01 22:07:52 +08:00
Tom Nichols
8e95ae2948 attempt to add support for self-signed certificate certs 2010-05-13 13:49:00 -04:00
Tom Nichols
a92075a659 merged 2010-05-12 16:54:01 -04:00
Tom Nichols
7552efee5c some reconnetion fixes 2010-05-12 16:51:14 -04:00
Brian Beggs
e0c32b6d9b Fixes for disconnection problems detailed in http://github.com/fritzy/SleekXMPP/issues/#issue/20
Fixes to both ClientXMPP & xmlstream.  ClientXMPP was not tracking the changes to authenticated and sessionstarted after the client was disconnected.

xmlstream had some funkyness with state in the _process method that was cleaned up and hopefully made a little cleaner.

Also changed a DNS issue that was occuring that rendered me unable to disconnect.  I would recieve the following error upon reconnect.
Exception in thread process:
Exception in thread process:
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/usr/local/lib/python2.6/threading.py", line 484, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/macdiesel/tmp/workspace/SleekXMPP/sleekxmpp/xmlstream/xmlstream.py", line 202, in _process
    self.reconnect()
  File "/home/macdiesel/tmp/workspace/SleekXMPP/sleekxmpp/__init__.py", line 134, in reconnect
    XMLStream.reconnect(self)
  File "/home/macdiesel/tmp/workspace/SleekXMPP/sleekxmpp/xmlstream/xmlstream.py", line 289, in reconnect
    self.connect()
  File "/home/macdiesel/tmp/workspace/SleekXMPP/sleekxmpp/__init__.py", line 99, in connect
    answers = dns.resolver.query("_xmpp-client._tcp.%s" % self.server, "SRV")
  File "/usr/local/lib/python2.6/site-packages/dns/resolver.py", line 732, in query
    return get_default_resolver().query(qname, rdtype, rdclass, tcp, source)
  File "/usr/local/lib/python2.6/site-packages/dns/resolver.py", line 617, in query
    source=source)
  File "/usr/local/lib/python2.6/site-packages/dns/query.py", line 113, in udp
    wire = q.to_wire()
  File "/usr/local/lib/python2.6/site-packages/dns/message.py", line 404, in to_wire
    r.add_question(rrset.name, rrset.rdtype, rrset.rdclass)
  File "/usr/local/lib/python2.6/site-packages/dns/renderer.py", line 152, in add_question
    self.output.write(struct.pack("!HH", rdtype, rdclass))
TypeError: unsupported operand type(s) for &: 'unicode' and 'long'

Seems I was getting this error when calling line 99 in ClientXMPP.  You can't bit-shift a 1 and a string and this is why this error is coming up. I removed the "SRV" argument and used the default of 1.  not sure exactly what this should be so it may need to be fixed back before it's merged back to trunk.

The line in question:
answers = dns.resolver.query("_xmpp-client._tcp.%s" % self.server, "SRV")
2010-05-13 04:43:25 +08:00
Nathan Fritz
fef511fd51 bugfix for .disconnect() hanging 2010-04-13 19:35:47 -07:00
Nathan Fritz
935ee4d14e changed license to MIT 2010-03-26 14:32:16 -07:00
Nathan Fritz
d4a490e3f0 fixed xmlstream filesocket issue 2010-03-15 10:19:45 -07:00
Nathan Fritz
c239fb1f90 added muc functionality 2010-03-04 09:47:42 -08:00
Nathan Fritz
8d5dbfa691 fixed some presence bugs 2010-02-27 02:02:08 +00:00
Nathan Fritz
58375955a9 added send queueing to avoid mixed sending 2010-02-15 02:13:44 -08:00
Nathan Fritz
65dd83d4e1 Merge branch 'master' of github.com:fritzy/SleekXMPP 2010-01-25 10:40:50 -08:00
Nathan Fritz
6e4c1128ec removed stupid monkeypatch for filesocket 2010-01-25 10:40:44 -08:00
Nathan Fritz
e39a2395d7 xep 30 and 50 always reply from jid iq sent to 2010-01-15 21:07:28 -08:00
Nathan Fritz
a8ff3586d3 * python 2.6 compatibility 2010-01-08 06:03:02 +00:00
Nathan Fritz
093644ffbd * major stanza improvements
* raise XMPPError in handler to reply with error stanza
* started work on pubsub stanzas
2010-01-05 21:56:48 +00:00
Nathan Fritz
805afa4bc1 * fixed unhandled iqs 2009-12-22 10:05:53 +00:00
Nathan Fritz
07018c0afa * fixed many stanza bugs
* added stanza unhandled (unhandled iqs now reply with feature-not-implemented)
* added stanza exceptions (stanzas may now reply with exceptions when their handler raises an exception)
2009-12-17 01:54:22 +00:00
Nathan Fritz
a031dd24a6 tweaked stanzas for easy use 2009-12-10 07:33:59 +00:00
Nathan Fritz
007b04dd30 * added proper message and iq stanzas. presence left to do 2009-12-10 01:23:03 +00:00