Commit cd72ef58 authored by Guillaume BIENKOWSKI's avatar Guillaume BIENKOWSKI
Browse files

Timezone value is not set until a call to "mktime()" is done.

A better fix would be to call tzset() somewhere in the belle-sip init code.
parent c3d73667
......@@ -1617,7 +1617,8 @@ BELLESIP_EXPORT time_t belle_sip_header_date_get_time(belle_sip_header_date_t *o
char tmp2[16] ={0};
int i,j;
time_t seconds;
time_t adjust_timezone = timezone;
time_t adjust_timezone;
/* time headers are in GMT as spec says */
sscanf(obj->date,"%3c,%d %16s %d %d:%d:%d",tmp1,&ret.tm_mday,tmp2,
......@@ -1645,8 +1646,10 @@ success:
seconds = timegm(&ret);
adjust_timezone = 0;
#else
seconds=mktime(&ret);
seconds = mktime(&ret);
adjust_timezone = timezone;
#endif
if (seconds==(time_t)-1){
belle_sip_error("mktime() failed: %s",strerror(errno));
return (time_t)-1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment