Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
eb37b082
Commit
eb37b082
authored
Aug 04, 2013
by
jehan
Browse files
remove trailling " from external body url
parent
eaad8d79
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
coreapi/bellesip_sal/sal_op_message.c
coreapi/bellesip_sal/sal_op_message.c
+2
-3
tester/message_tester.c
tester/message_tester.c
+6
-3
No files found.
coreapi/bellesip_sal/sal_op_message.c
View file @
eb37b082
...
...
@@ -111,9 +111,8 @@ static void process_request_event(void *op_base, const belle_sip_request_event_t
salmsg
.
url
=
NULL
;
if
(
external_body
&&
belle_sip_parameters_get_parameter
(
BELLE_SIP_PARAMETERS
(
content_type
),
"URL"
))
{
size_t
url_length
=
strlen
(
belle_sip_parameters_get_parameter
(
BELLE_SIP_PARAMETERS
(
content_type
),
"URL"
));
char
*
url
=
ms_malloc
(
url_length
);
if
(
sscanf
(
belle_sip_parameters_get_parameter
(
BELLE_SIP_PARAMETERS
(
content_type
),
"URL"
),
"
\"
%s
\"
"
,
url
)
==
1
)
salmsg
.
url
=
url
;
salmsg
.
url
=
ms_strdup
(
belle_sip_parameters_get_parameter
(
BELLE_SIP_PARAMETERS
(
content_type
),
"URL"
)
+
1
);
/* skip first "*/
((
char
*
)
salmsg
.
url
)[
url_length
-
2
]
=
'\0'
;
/*remove trailing "*/
}
salmsg
.
message_id
=
message_id
;
salmsg
.
time
=
date
?
belle_sip_header_date_get_time
(
date
)
:
time
(
NULL
);
...
...
tester/message_tester.c
View file @
eb37b082
...
...
@@ -22,6 +22,7 @@
#include "private.h"
#include "liblinphone_tester.h"
static
char
*
message_external_body_url
;
void
text_message_received
(
LinphoneCore
*
lc
,
LinphoneChatRoom
*
room
,
const
LinphoneAddress
*
from_address
,
const
char
*
message
)
{
stats
*
counters
=
get_stats
(
lc
);
...
...
@@ -37,8 +38,10 @@ void message_received(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMess
ms_free
(
from
);
counters
=
get_stats
(
lc
);
counters
->
number_of_LinphoneMessageReceived
++
;
if
(
linphone_chat_message_get_external_body_url
(
message
))
if
(
linphone_chat_message_get_external_body_url
(
message
))
{
counters
->
number_of_LinphoneMessageExtBodyReceived
++
;
CU_ASSERT_STRING_EQUAL
(
linphone_chat_message_get_external_body_url
(
message
),
message_external_body_url
);
}
}
void
linphone_chat_message_state_change
(
LinphoneChatMessage
*
msg
,
LinphoneChatMessageState
state
,
void
*
ud
)
{
...
...
@@ -160,14 +163,14 @@ static void text_message_with_external_body(void) {
char
*
to
=
linphone_address_as_string
(
marie
->
identity
);
LinphoneChatRoom
*
chat_room
=
linphone_core_create_chat_room
(
pauline
->
lc
,
to
);
LinphoneChatMessage
*
message
=
linphone_chat_room_create_message
(
chat_room
,
"Bli bli bli
\n
blu"
);
linphone_chat_message_set_external_body_url
(
message
,
"http://www.linphone.org"
);
linphone_chat_message_set_external_body_url
(
message
,
message_external_body_url
=
"http://www.linphone.org"
);
linphone_chat_room_send_message2
(
chat_room
,
message
,
linphone_chat_message_state_change
,
pauline
->
lc
);
CU_ASSERT_TRUE
(
wait_for
(
pauline
->
lc
,
marie
->
lc
,
&
marie
->
stat
.
number_of_LinphoneMessageReceived
,
1
));
CU_ASSERT_TRUE
(
wait_for
(
pauline
->
lc
,
marie
->
lc
,
&
pauline
->
stat
.
number_of_LinphoneMessageDelivered
,
1
));
CU_ASSERT_EQUAL
(
pauline
->
stat
.
number_of_LinphoneMessageInProgress
,
1
);
CU_ASSERT_EQUAL
(
marie
->
stat
.
number_of_LinphoneMessageExtBodyReceived
,
1
);
/*fixme use history to check message content*/
linphone_core_manager_destroy
(
marie
);
linphone_core_manager_destroy
(
pauline
);
}
...
...
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