From 2db5ebb4b76be958d84168f2ef294aba98a5fa9e Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sat, 7 Mar 2015 20:51:23 +0100 Subject: [PATCH] Fix BytestreamsProvider: Mode is optional and defaults to TCP. --- .../bytestreams/socks5/provider/BytestreamsProvider.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/provider/BytestreamsProvider.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/provider/BytestreamsProvider.java index 18feb3228..5e29868c2 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/provider/BytestreamsProvider.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/provider/BytestreamsProvider.java @@ -20,6 +20,7 @@ import java.io.IOException; import org.jivesoftware.smack.provider.IQProvider; import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream; +import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream.Mode; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; @@ -81,7 +82,11 @@ public class BytestreamsProvider extends IQProvider { } } - toReturn.setMode((Bytestream.Mode.fromName(mode))); + if (mode == null) { + toReturn.setMode(Mode.tcp); + } else { + toReturn.setMode((Bytestream.Mode.fromName(mode))); + } toReturn.setSessionID(id); return toReturn; }