mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Merge remote-tracking branch 'neel/b25511-r4'
This commit is contained in:
@@ -71,8 +71,8 @@ tor_sleep_msec(int msec)
|
||||
/** Set *timeval to the current time of day. On error, log and terminate.
|
||||
* (Same as gettimeofday(timeval,NULL), but never returns -1.)
|
||||
*/
|
||||
void
|
||||
tor_gettimeofday(struct timeval *timeval)
|
||||
MOCK_IMPL(void,
|
||||
tor_gettimeofday, (struct timeval *timeval))
|
||||
{
|
||||
#ifdef _WIN32
|
||||
/* Epoch bias copied from perl: number of units between windows epoch and
|
||||
|
||||
@@ -173,7 +173,7 @@ void monotime_coarse_add_msec(monotime_coarse_t *out,
|
||||
#define monotime_coarse_add_msec monotime_add_msec
|
||||
#endif /* defined(MONOTIME_COARSE_TYPE_IS_DIFFERENT) */
|
||||
|
||||
void tor_gettimeofday(struct timeval *timeval);
|
||||
MOCK_DECL(void, tor_gettimeofday, (struct timeval *timeval));
|
||||
|
||||
#ifdef TOR_UNIT_TESTS
|
||||
void tor_sleep_msec(int msec);
|
||||
|
||||
@@ -1834,6 +1834,15 @@ format_iso_time(char *buf, time_t t)
|
||||
strftime(buf, ISO_TIME_LEN+1, "%Y-%m-%d %H:%M:%S", tor_gmtime_r(&t, &tm));
|
||||
}
|
||||
|
||||
/** As format_local_iso_time, but use the yyyy-mm-ddThh:mm:ss format to avoid
|
||||
* embedding an internal space. */
|
||||
void
|
||||
format_local_iso_time_nospace(char *buf, time_t t)
|
||||
{
|
||||
format_local_iso_time(buf, t);
|
||||
buf[10] = 'T';
|
||||
}
|
||||
|
||||
/** As format_iso_time, but use the yyyy-mm-ddThh:mm:ss format to avoid
|
||||
* embedding an internal space. */
|
||||
void
|
||||
|
||||
@@ -271,6 +271,7 @@ int parse_rfc1123_time(const char *buf, time_t *t);
|
||||
#define ISO_TIME_USEC_LEN (ISO_TIME_LEN+7)
|
||||
void format_local_iso_time(char *buf, time_t t);
|
||||
void format_iso_time(char *buf, time_t t);
|
||||
void format_local_iso_time_nospace(char *buf, time_t t);
|
||||
void format_iso_time_nospace(char *buf, time_t t);
|
||||
void format_iso_time_nospace_usec(char *buf, const struct timeval *tv);
|
||||
int parse_iso_time_(const char *cp, time_t *t, int strict, int nospace);
|
||||
|
||||
Reference in New Issue
Block a user