Azat Khuzhin
4798de6c64
test: fix util/date_rfc1123 under win32
...
Refs: #417
v2: check when gmtime() returns NULL
v3: fix overflow cases
2016-12-22 18:10:24 +03:00
Azat Khuzhin
4545807db4
Fix UB in evutil_date_rfc1123()
...
As pointed in https://github.com/libevent/libevent/pull/417#issuecomment-267860738
"code is unsafe because in evutil_date_rfc1123() the pointer to the
automatic variable struct tm cur is used outside the scope it defined."
Checked with `clang -fsanitize=address -fsanitize-address-use-after-scope`
and test that call evutil_date_rfc1123() with tm==NULL
2016-12-22 14:46:38 +03:00
Vis Virial
db60ade81d
http: do not use local settings for Date header
2016-12-19 00:55:50 +03:00
Azat Khuzhin
3e75194cb5
evutil_time: include <unistd.h> when there is only sleep()/usleep()
2016-12-06 12:54:05 +03:00
Andrea Shepard
f2645f80c1
Implement new/free for struct evutil_monotonic_timer and export monotonic time functions
2014-12-04 09:30:20 -05:00
Nick Mathewson
911abf3dd2
Check CLOCK_MONOTONIC_* at runtime if needed.
...
(We need this to avoid compile errors on cygwin. Fixes github issue
75.)
2013-08-19 10:14:43 -04:00
Nick Mathewson
85a40040d1
Add regress_finalize to makefile.nmake
2013-05-01 13:37:57 -04:00
Nick Mathewson
9be546809a
Avoid unused-var warning on systems with clock_gettime but without CLOCK_MONOTONIC_COARSE
2012-08-02 12:35:49 -04:00
Nick Mathewson
630f077c29
Simple unit tests for monotonic timers
2012-04-26 16:42:21 -04:00
Nick Mathewson
2c470452fb
Implement fast/precise monotonic clocks on Windows
...
This uses code from libutp, which was released under the MIT
license; see evutil_time.c and LICENSE changes.
2012-04-26 15:44:37 -04:00
Nick Mathewson
f5e4eb05e5
Refactor monotonic timer handling into a new type and set of functions; add a gettimeofday-based ratcheting implementation
...
Now, event.c can always assume that we have a monotonic timer; this
makes event.c easier to write.
2012-04-26 15:44:31 -04:00
Nick Mathewson
71bca50f12
Split out time-related prototypes into time-internal.h
2012-04-20 12:27:12 -04:00
Nick Mathewson
c419485442
Split out time-related evutil functions into a new evutil_time.c
2012-04-20 12:19:03 -04:00