[Vortex] PATCH: Enhanced vortex_connection_new; better error checking

Jens Alfke jens at mooseyard.com
Tue Mar 18 00:04:42 CET 2008

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.)

(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. 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.


* For gory details see <http://www.bford.info/pub/net/p2pnat/>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: jens_patch_20080317.patch
Type: application/octet-stream
Size: 8474 bytes
Desc: not available
Url : http://lists.aspl.es/pipermail/vortex/attachments/20080317/1121f7fc/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1875 bytes
Desc: not available
Url : http://lists.aspl.es/pipermail/vortex/attachments/20080317/1121f7fc/attachment.bin 

More information about the Vortex mailing list