[Vortex] [PATCH] sanitize vortex_connection_*

Francis Brosnan Blazquez francis at aspl.es
Tue Jan 22 19:24:31 CET 2008

Hi Benoit,

> I'm not sure about that, let's see if I understood the code properly:

Let's see...

> There is one place where vortex_connection_get_connect_timeout is
> used 
> which is in __vortex_connection_new() function.
> d_timeout  = vortex_connection_get_connect_timeout ();
> The following code is then used with d_timeout
> while (d_start_time + d_timeout > time (NULL)) {
> time(NULL), both under windows and POSIX systems return the number of 
> seconds since 1970-01-01 which imply that d_timeout unit is in
> seconds.
> Finally, vortex_connection_get_connect_timeout() will return 
> ctx->connection_connect_std_timeout by default. That's why I fixed
> the 
> default value to 60 instead of 60*1000000.
> Correct me if I overlooked something

No you didn't. There is a bug in the connection timeout code which mixes
microseconds value from vortex_connection_get_connect_timeout and the
value returned by time. 

Because vortex_connection_get_connect_timeout (and _get_timeout) must
return microseconds, I've updated this code to convert the value
returned into seconds so it is now compatible with time(). Updated both

Thanks for tracking down the problem. Cheers!

> Thanks,
Francis Brosnan Blazquez <francis at aspl.es>
Advanced Software Production Line, S.L.

More information about the Vortex mailing list