Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblinphone
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
List
Board
Labels
Milestones
Merge Requests
21
Merge Requests
21
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
liblinphone
Commits
6a9dafbb
Commit
6a9dafbb
authored
Apr 11, 2013
by
Simon Morlat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
try to fix date issues
parent
85636915
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
15 deletions
+20
-15
sal_eXosip2.c
coreapi/sal_eXosip2.c
+1
-1
sal_eXosip2_presence.c
coreapi/sal_eXosip2_presence.c
+19
-14
No files found.
coreapi/sal_eXosip2.c
View file @
6a9dafbb
...
...
@@ -1798,7 +1798,7 @@ static void text_received(Sal *sal, eXosip_event_t *ev){
for
(
j
=
0
;
j
<
12
;
j
++
)
{
if
(
strcmp
(
tmp2
,
months
[
j
])
==
0
)
ret
.
tm_mon
=
j
;
}
ret
.
tm_isdst
=
-
1
;
ret
.
tm_isdst
=
0
;
}
else
ms_warning
(
"No date header in SIP MESSAGE, we don't know when it was sent."
);
content_type
=
osip_message_get_content_type
(
ev
->
request
);
...
...
coreapi/sal_eXosip2_presence.c
View file @
6a9dafbb
...
...
@@ -81,23 +81,28 @@ void sal_remove_in_subscribe(Sal *sal, SalOp *op){
sal
->
in_subscribes
=
ms_list_remove
(
sal
->
in_subscribes
,
op
);
}
#ifdef WIN32
static
inline
char
*
my_ctime_r
(
const
time_t
*
t
,
char
*
buf
){
strcpy
(
buf
,
ctime
(
t
));
return
buf
;
}
static
const
char
*
days
[]
=
{
"Sun"
,
"Mon"
,
"Tue"
,
"Wed"
,
"Thu"
,
"Fri"
,
"Sat"
};
static
const
char
*
months
[]
=
{
"Jan"
,
"Feb"
,
"Mar"
,
"Apr"
,
"May"
,
"Jun"
,
"Jul"
,
"Aug"
,
"Sep"
,
"Oct"
,
"Nov"
,
"Dec"
};
static
void
msg_add_current_date
(
osip_message_t
*
msg
){
char
tmp
[
64
]
=
{
0
};
time_t
curtime
=
time
(
NULL
);
struct
tm
*
ret
;
#ifndef WIN32
struct
tm
gmt
;
ret
=
gmtime_r
(
&
curtime
,
&
gmt
);
#else
#define my_ctime_r ctime_r
ret
=
gmtime
(
&
curtime
);
#endif
/*cannot use strftime because it is locale dependant*/
snprintf
(
tmp
,
sizeof
(
tmp
)
-
1
,
"%s, %i %s %i %02i:%02i:%02i GMT"
,
days
[
ret
->
tm_wday
],
ret
->
tm_mday
,
months
[
ret
->
tm_mon
],
1900
+
ret
->
tm_year
,
ret
->
tm_hour
,
ret
->
tm_min
,
ret
->
tm_sec
);
osip_message_replace_header
(
msg
,
"Date"
,
tmp
);
}
int
sal_message_send
(
SalOp
*
op
,
const
char
*
from
,
const
char
*
to
,
const
char
*
content_type
,
const
char
*
msg
){
osip_message_t
*
sip
=
NULL
;
char
t
[
26
];
time_t
curtime
=
time
(
NULL
);
my_ctime_r
(
&
curtime
,
t
);
if
(
op
->
cid
==
-
1
)
{
...
...
@@ -113,7 +118,7 @@ int sal_message_send(SalOp *op, const char *from, const char *to, const char* co
sal_op_get_from
(
op
),
sal_op_get_route
(
op
));
if
(
sip
!=
NULL
){
sal_exosip_add_custom_headers
(
sip
,
op
->
base
.
custom_headers
);
osip_message_set_date
(
sip
,
t
);
msg_add_current_date
(
sip
);
osip_message_set_content_type
(
sip
,
content_type
);
if
(
msg
)
osip_message_set_body
(
sip
,
msg
,
strlen
(
msg
));
sal_add_other
(
op
->
base
.
root
,
op
,
sip
);
...
...
@@ -136,7 +141,7 @@ int sal_message_send(SalOp *op, const char *from, const char *to, const char* co
return
-
1
;
}
sal_exosip_add_custom_headers
(
sip
,
op
->
base
.
custom_headers
);
osip_message_set_date
(
sip
,
t
);
msg_add_current_date
(
sip
);
osip_message_set_content_type
(
sip
,
content_type
);
if
(
msg
)
osip_message_set_body
(
sip
,
msg
,
strlen
(
msg
));
eXosip_call_send_request
(
op
->
did
,
sip
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment