Commit graph

18 commits

Author SHA1 Message Date
rcorniere f1331dcebc Reset isSecure in StartTLS() 2020-03-10 17:14:26 +01:00
rcorniere e59a86c380 Refactor tests 2020-03-06 17:52:52 +01:00
rcorniere 8798ff6fc1 - Changed IQ stanzas to pointer semantics
- Fixed commands from v 0.4.0 and tests
- Added primitive Result Sets support (XEP-0059)
2020-01-31 11:48:03 +01:00
remicorniere 94aceac802 Changed "Disconnect" to wait for the closing stream tag. (#141)
Updated example with a README.md and fixed some logs.
2019-12-26 14:47:02 +01:00
remicorniere 7d89353156 Fix SIGSEGV in xmpp_component (#126)
* SIGSEGV in xmpp_component example with Prosody #126
2019-11-22 15:07:40 +01:00
Mickael Remond 6aa1e668ee
Fix issues after refactor
Relates to #126
2019-11-08 12:07:55 +01:00
Wichert Akkerman 0227596f90 Increase size of XML decoder internal buffers
Since a transport (and a streamlogger) does not implement io.ByteReader
xml.Decoder wraps it using `bufio.NewReader(transport)` so it can easily read
bytes one at a time. This has the unfortuante effect of resulting in a panic if
we try to parse a stanza that is larger than the default buffer size of 4096
bytes.

To fix this we wrap the transport using `bufio.NewReaderSize()` with a much
larger buffer size.
2019-11-04 09:58:04 +01:00
Wichert Akkerman 6da1962962 Correctly open new streams after StartTLS and auth 2019-10-28 16:38:10 +01:00
Wichert Akkerman 33446ad0ba Create a new stream after StartTLS 2019-10-28 16:38:10 +01:00
Wichert Akkerman 390f9b065e Replace readWriter and decoder after StartTLS 2019-10-28 16:38:10 +01:00
Wichert Akkerman a6709a1f71 Do not try to create a stream logger before we have a net.Conn 2019-10-28 16:38:10 +01:00
Wichert Akkerman 92329b48e6 Transports need to handle open/close stanzas
XMPP and WebSocket transports require different open and close stanzas. To
handle this the responsibility handling those and creating the XML decoder is
moved to the Transport.
2019-10-28 16:38:10 +01:00
Wichert Akkerman 36e153f981 Allow transports to define their own ping mechanism 2019-10-28 16:38:10 +01:00
Wichert Akkerman d0f2b492ac Fix XMPP TLS config 2019-10-28 16:38:10 +01:00
Wichert Akkerman 01d78a1e5c Fix error result from Transport.Connect errors 2019-10-28 16:38:10 +01:00
Wichert Akkerman 8db608ccc1 Add IsSecure() to Transport 2019-10-28 16:38:10 +01:00
Wichert Akkerman 7fa4b06705 Move address into transport config
This makes it possible to use a factory function to create a transport of the right type and not having to repeat the address when calling Transport.Connect()
2019-10-28 16:38:10 +01:00
Wichert Akkerman f8d0e99696 Move XMPP transport to separate file 2019-10-28 16:38:10 +01:00