summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVis Virial <visvrial@gmail.com>2016-11-10 21:58:15 +0900
committerAzat Khuzhin <a3at.mail@gmail.com>2016-12-19 00:55:50 +0300
commitdb60ade81d43e9aaf03273d162878a9cc976f57b (patch)
treee1352444626c064878a9fa904afad09f359df050 /include
parent23f9a20e8d5d8ebfc0336fc59b3661344404b83a (diff)
downloadlibevent-db60ade81d43e9aaf03273d162878a9cc976f57b.tar.gz
http: do not use local settings for Date header
Diffstat (limited to 'include')
-rw-r--r--include/event2/util.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/event2/util.h b/include/event2/util.h
index 2c43e30e..defe00a3 100644
--- a/include/event2/util.h
+++ b/include/event2/util.h
@@ -77,6 +77,8 @@ extern "C" {
#include <sys/socket.h>
#endif
+#include <time.h>
+
/* Some openbsd autoconf versions get the name of this macro wrong. */
#if defined(EVENT__SIZEOF_VOID__) && !defined(EVENT__SIZEOF_VOID_P)
#define EVENT__SIZEOF_VOID_P EVENT__SIZEOF_VOID__
@@ -331,6 +333,15 @@ struct evutil_monotonic_timer
#define EV_MONOT_PRECISE 1
#define EV_MONOT_FALLBACK 2
+/** Format a date string using RFC 1123 format (used in HTTP).
+ * If `cur_p` is NULL, current system's time will be used.
+ * The number of characters written will be returned.
+ * One should check if the return value is smaller than `datelen` to check if
+ * the result is truncated or not.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_date_rfc1123(char *date, const size_t datelen, struct tm *cur_p);
+
/** Allocate a new struct evutil_monotonic_timer for use with the
* evutil_configure_monotonic_time() and evutil_gettime_monotonic()
* functions. You must configure the timer with