On Wed Jul 11 2007, Jakob Schroeter wrote:
> On Wed Jul 4 2007, Martin Acevedo wrote:
> > but it cannot connect, m_s5b->connect() always returns false.... with a
> > bit debug I found that withing the connect() funcion m_connections is a
> > null pointer
> >
> > bool SOCKS5Bytestream::connect()
> > {
> > if( !m_connection || !m_socks5 || !m_manager )
> > return false;
> > ........
> >
> > what could be happend? I think the server is fine since I can send files
> > from spark to gloox (via wildfire)
> > I use latest stable version, compiled with vs.net 2005.....
>
> m_connection can only be 0 if the remote entity advertised that it used
> gloox' internal socks5 server for the stream host, but when you call
> connect(), for some reason that connection doesn't exist anymore.
>
> Is this still an issue?
If so, does the attached patchlet change anything?
cheers,
Jakob
Index: src/socks5bytestreammanager.cpp
===================================================================
--- src/socks5bytestreammanager.cpp (revision 2551)
+++ src/socks5bytestreammanager.cpp (working copy)
@@ -330,7 +330,7 @@
if( !s || !s->hasAttribute( "jid" ) )
return false;
- const std::string & proxy = s->findAttribute( "jid" );
+ const std::string& proxy = s->findAttribute( "jid" );
const StreamHost* sh = findProxy( stanza->from(), proxy,
(*it).second );
if( sh )
{
@@ -342,7 +342,10 @@
sha.feed( (*it).second );
sha.feed( m_parent->jid().full() );
sha.feed( stanza->from().full() );
- s5b = new SOCKS5Bytestream( this, m_server->getConnection(
sha.hex() ),
+ ConnectionBase* cb = m_server->getConnection( sha.hex() );
+ if( !cb )
+ return false;
+ s5b = new SOCKS5Bytestream( this, cb,
m_parent->logInstance(),
m_parent->jid(), stanza->from(),
(*it).second );
Attachment:
pgpLCWDxwHqGj.pgp
Description: PGP signature