// TODO stringprep
String digest =Plugin.sha(s5.getSid(),iq.getFrom(),backend.getMyJID());
SocksSocket s=null;
if(s5.hasStreamHosts())
{
for(Iterator i=s5.getStreamHosts();i.hasNext();)
{
StreamHost streamHost = (StreamHost)i.next();
try{
//Proxy p = new Socks5Proxy("192.168.10.2",5080);
//TODO add timeout
s = new SocksSocket(new Socks5Proxy(streamHost.getHost(),streamHost.getPort()),digest,0);
// check if connection is open
backend.send(new InfoQuery(iq.getFrom(),"result",iq.getID(),
new Socks5Extension(streamHost.getJID(),null)));
break;
}
catch (IOException e2)
{
//e2.printStackTrace();
System.out.println(e2.getMessage());
continue;
}
}
}
if(s==null)
{
sendError();
Popups.messagePopup(I18N.gettext("filetransfer.Problem_during_file_transfer,_transfer_aborted"),I18N.gettext("filetransfer.File_Transfer"));
getFileWindow.stopDownloading();
return;
}
InputStream in=null;
OutputStream out=getFileWindow.getOutputStream();
in = s.getInputStream();
if(in!=null)
{
if(out!=null)
{