mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-29 23:42:06 +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:
parent
c5eadeb271
commit
2ceed95f6b
1 changed files with 7 additions and 7 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue