1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-23 06:42:05 +01:00

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
This commit is contained in:
Alex Wenckus 2007-02-21 00:08:34 +00:00 committed by alex
parent c5eadeb271
commit 2ceed95f6b

View file

@ -328,11 +328,11 @@ public class Socks5TransferNegotiator extends StreamNegotiator {
* @param sessionID The session id of the stream. * @param sessionID The session id of the stream.
* @param proxy The server socket which will listen locally for remote * @param proxy The server socket which will listen locally for remote
* connections. * connections.
* @param digest * @param digest the digest of the userids and the session id
* @param query * @param query the query which the response is being awaited
* @return * @return the selected host
* @throws XMPPException * @throws XMPPException when the response from the peer is an error or doesn't occur
* @throws IOException * @throws IOException when there is an error establishing the local socket
*/ */
private SelectedHostInfo waitForUsedHostResponse(String sessionID, private SelectedHostInfo waitForUsedHostResponse(String sessionID,
final ProxyProcess proxy, final String digest, final ProxyProcess proxy, final String digest,
@ -344,10 +344,10 @@ public class Socks5TransferNegotiator extends StreamNegotiator {
.createPacketCollector(new PacketIDFilter(query.getPacketID())); .createPacketCollector(new PacketIDFilter(query.getPacketID()));
connection.sendPacket(query); connection.sendPacket(query);
Packet packet = collector.nextResult(); Packet packet = collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
collector.cancel(); collector.cancel();
Bytestream response; Bytestream response;
if (packet instanceof Bytestream) { if (packet != null && packet instanceof Bytestream) {
response = (Bytestream) packet; response = (Bytestream) packet;
} }
else { else {