Value of timeout.tv_usec off by a factor of 1000
Posted: Tue May 06, 2008 6:12 am
In zm_remote_camera.cpp, a timeval struct is initialized as follows:
Since the tv_usec field is supposed to be the number of microseconds, it should actually be initialized as:
Since the value of config.http_timeout%1000 gives the remaining number of milliseconds not covered by the tv_sec field.
Not a big deal, really, but if you set the timeout to less than 1000ms, then you may notice the difference.
Code: Select all
timeout.tv_sec = config.http_timeout/1000;
timeout.tv_usec = config.http_timeout%1000;
Code: Select all
timeout.tv_sec = config.http_timeout/1000;
timeout.tv_usec = (config.http_timeout%1000) * 1000;
Not a big deal, really, but if you set the timeout to less than 1000ms, then you may notice the difference.