~samwhited/xmpp

all: release v0.19.0

Signed-off-by: Sam Whited <sam@samwhited.com>
xmpp: use new UnmarshalIQError function

See #114

Signed-off-by: Sam Whited <sam@samwhited.com>
stanza: add func to unmarshal IQ start or error IQ

Fixes #114

Signed-off-by: Sam Whited <sam@samwhited.com>
stanza: set default condition on errors

Previously if no condition was set on an error marshaling it to XML
would fail with the misleading error: "xml: start tag with no name".
Now marshaling will succeed and the condition will default to
undefined-condition per the RFC.

Fixes #127

Signed-off-by: Sam Whited <sam@samwhited.com>
stanza: rewrap test struct

Signed-off-by: Sam Whited <sam@samwhited.com>
stanza: add Wrap method to Errors

Signed-off-by: Sam Whited <sam@samwhited.com>
ping: use new encoding test helper

Signed-off-by: Sam Whited <sam@samwhited.com>
internal/xmpptest: add encoding test helper

Fixes #84

Signed-off-by: Sam Whited <sam@samwhited.com>
xmpp: fix DOS where no deadline was set on conns

When dialing a new connection in the Dial* functions no deadline was
being set meaning that a misbehaving server that blackholes the
connection could cause these functions to block forever. This patch
makes these functions respect any deadline set on the context, giving
the user control over cancelation.

Unifying the context logic also results in a secondary issue being fixed
where cancel functions were not being respected (but deadlines were) on
writes.

Fixes #124

Signed-off-by: Sam Whited <sam@samwhited.com>
jid: test that "WithDomain" performs normalization

Signed-off-by: Sam Whited <sam@samwhited.com>
jid: normalize domainparts

Normalize domainparts using the IDNA2008 "display" profile. This may or
may not match the rules of RFC 5895 exactly, but as long as all incoming
JIDs are run through this processing it shouldn't matter if two servers
have slightly different sets of rules.

Fixes #123

Signed-off-by: Sam Whited <sam@samwhited.com>
jid: move trailing . trimming out of split

Signed-off-by: Sam Whited <sam@samwhited.com>
xmpp: remove unused argument from DialSession

Fixes #125

Signed-off-by: Sam Whited <sam@samwhited.com>
stanza: rename a file

With `Is' exported this now does more than handle IDs.
Rename the file for clarity.

Signed-off-by: Sam Whited <sam@samwhited.com>
all: add function stanza.Is()

Add exported function stanza.Is() which tests an xml.Name for its name
and space. If it is a proper stanza it returns true.
This function was repeatedly defined in several files and is now defined
one time and exported in stanza/stanza.go

Fixes #113
all: fix tests broken by upstream change

We recently reported a minor DOS vector in the encoding/xml package
which was fixed by d0b79e3513a2. This revealed issues with the iterators
in the disco and roster packages that had previously been hidden by the
bad behavior of encoding/xml.

Signed-off-by: Sam Whited <sam@samwhited.com>
docs: document naming of Fetch functions

Previously some functions that made simple queries were called (or
started with) "Get" while others used "Fetch". Now "Fetch" is used to
indicate functions that return an iterator, while "Get" functions return
the full data.

Signed-off-by: Sam Whited <sam@samwhited.com>
all: add myself to contributors

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
disco: rename GetItems(IQ) to FetchItems(IQ)

Like this we consistently signal that functions with the prefix `Fetch`
return an iterator.

Fixes #116

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
form: remove unnecessary loop

Signed-off-by: Sam Whited <sam@samwhited.com>
Next