[Vortex] PATCH: Enhanced vortex_connection_new; better error checking

Francis Brosnan Blazquez francis at aspl.es
Mon Mar 24 20:12:37 CET 2008


Hi Jens,

> This patch (against SVN r3338) does two things:
> 
> (1) Adds a new API call vortex_connection_new2. This takes an  
> additional parameter "localPort", which allows the local TCP port  
> number to be specified. (Most of the time you don't care what local  
> port number is used when making a TCP connection; but there are  
> circumstances where you do, mostly having to do with techniques to  
> traverse NATs*. Which is why my app needed it. Others might need it  
> too, because it's a common requirement for P2P software, and BEEP is a  
> very good protocol to use for P2P.)

Let me check this...

> (2) Fixes a bug with auto-TLS, where if the TLS negotiation fails, the  
> client's onConnect callback is called with a NULL VortexConnection.  
> When that happens the client has no way to get an error message. With  
> this fix, a valid VortexConnection will be passed to the callback,  
> whose message is set to the error string returned from TLS.
> 
> I'm pretty confident about #1. 

Ok.

> Less so about #2; it works for me, but  
> I'm not sure if it's the best way to fix the problem, and it might be  
> leaking memory. Definitely needs review.

This is now fixed. There was an error at the vortex client side TLS
implementation causing to not return a reference at
vortex_connection_start_negociation_sync (because
vortex_tls_start_negociation was broken). Digging on this, more bugs
were found and fixed, especially under cases when the TLS handshake
fails after accepting starting TLS profile. I've updated the regression
test to check this on future releases including simulations of errors in
the middle of the TLS handshake.

The patch was not applied but was really useful. Thanks for reporting
Jens!

> —Jens
> 
> * For gory details see <http://www.bford.info/pub/net/p2pnat/>
> 
> _______________________________________________
> Vortex mailing list
> Vortex at lists.aspl.es
> http://lists.aspl.es/cgi-bin/mailman/listinfo/vortex
-- 
Francis Brosnan Blazquez <francis at aspl.es>
Advanced Software Production Line, S.L.




More information about the Vortex mailing list