mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-04 17:52:29 +00:00
Use gmtime_r if available as gmtime is not MT-safe.
Original commit message from CVS: * configure.ac: * gst-libs/gst/rtsp/gstrtspconnection.c: (add_date_header): Use gmtime_r if available as gmtime is not MT-safe. Fixes bug #511810.
This commit is contained in:
parent
044f629784
commit
8b970c5581
4 changed files with 19 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2008-02-02 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
|
* configure.ac:
|
||||||
|
* gst-libs/gst/rtsp/gstrtspconnection.c: (add_date_header):
|
||||||
|
Use gmtime_r if available as gmtime is not MT-safe.
|
||||||
|
Fixes bug #511810.
|
||||||
|
|
||||||
2008-02-02 Sebastian Dröge <slomo@circular-chaos.org>
|
2008-02-02 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
* gst-libs/gst/rtsp/gstrtspconnection.c: (add_date_header):
|
* gst-libs/gst/rtsp/gstrtspconnection.c: (add_date_header):
|
||||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
||||||
Subproject commit 571dce3335f9be76978009b3842c050dbb900e6f
|
Subproject commit 3c5473161ce19a3530bad279b842d542895b1500
|
|
@ -239,7 +239,7 @@ dnl also, Windows does not have long long
|
||||||
AX_CREATE_STDINT_H
|
AX_CREATE_STDINT_H
|
||||||
|
|
||||||
dnl *** checks for functions ***
|
dnl *** checks for functions ***
|
||||||
AC_CHECK_FUNCS([localtime_r])
|
AC_CHECK_FUNCS([localtime_r gmtime_r])
|
||||||
|
|
||||||
dnl *** checks for types/defines ***
|
dnl *** checks for types/defines ***
|
||||||
|
|
||||||
|
|
|
@ -370,10 +370,20 @@ add_date_header (GstRTSPMessage * message)
|
||||||
gchar date_string[100];
|
gchar date_string[100];
|
||||||
time_t t;
|
time_t t;
|
||||||
|
|
||||||
|
#ifdef HAVE_GMTIME_R
|
||||||
|
struct tm tm_;
|
||||||
|
#endif
|
||||||
|
|
||||||
g_get_current_time (&tv);
|
g_get_current_time (&tv);
|
||||||
t = (time_t) tv.tv_sec;
|
t = (time_t) tv.tv_sec;
|
||||||
|
|
||||||
|
#ifdef HAVE_GMTIME_R
|
||||||
|
strftime (date_string, sizeof (date_string), "%a, %d %b %Y %H:%M:%S GMT",
|
||||||
|
gmtime_r (&t, &tm_));
|
||||||
|
#else
|
||||||
strftime (date_string, sizeof (date_string), "%a, %d %b %Y %H:%M:%S GMT",
|
strftime (date_string, sizeof (date_string), "%a, %d %b %Y %H:%M:%S GMT",
|
||||||
gmtime (&t));
|
gmtime (&t));
|
||||||
|
#endif
|
||||||
|
|
||||||
gst_rtsp_message_add_header (message, GST_RTSP_HDR_DATE, date_string);
|
gst_rtsp_message_add_header (message, GST_RTSP_HDR_DATE, date_string);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue