From 2ceed95f6b634ba79e2b50b164a6e9c3731c41b2 Mon Sep 17 00:00:00 2001 From: Alex Wenckus Date: Wed, 21 Feb 2007 00:08:34 +0000 Subject: [PATCH] added reply timeout wait for used host response. git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7230 b35dd754-fafc-0310-a699-88a17e54d16e --- .../filetransfer/Socks5TransferNegotiator.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java b/source/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java index f9aa2a08b..361bbeb96 100644 --- a/source/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java +++ b/source/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java @@ -328,11 +328,11 @@ public class Socks5TransferNegotiator extends StreamNegotiator { * @param sessionID The session id of the stream. * @param proxy The server socket which will listen locally for remote * connections. - * @param digest - * @param query - * @return - * @throws XMPPException - * @throws IOException + * @param digest the digest of the userids and the session id + * @param query the query which the response is being awaited + * @return the selected host + * @throws XMPPException when the response from the peer is an error or doesn't occur + * @throws IOException when there is an error establishing the local socket */ private SelectedHostInfo waitForUsedHostResponse(String sessionID, final ProxyProcess proxy, final String digest, @@ -344,10 +344,10 @@ public class Socks5TransferNegotiator extends StreamNegotiator { .createPacketCollector(new PacketIDFilter(query.getPacketID())); connection.sendPacket(query); - Packet packet = collector.nextResult(); + Packet packet = collector.nextResult(SmackConfiguration.getPacketReplyTimeout()); collector.cancel(); Bytestream response; - if (packet instanceof Bytestream) { + if (packet != null && packet instanceof Bytestream) { response = (Bytestream) packet; } else {