Commit e617403e authored by jehan's avatar jehan

fix channel trace for small body

parent 97bdfd1f
......@@ -560,11 +560,11 @@ static int belle_sip_channel_process_read_data(belle_sip_channel_t *obj){
}
if (num>0){
char *begin=obj->input_stream.write_ptr;
char *logbuf=make_logbuf(BELLE_SIP_LOG_MESSAGE,begin,num);
obj->input_stream.write_ptr+=num;
/*first null terminate the read buff*/
*obj->input_stream.write_ptr='\0';
if (num>20) /*to avoid tracing server based keep alives*/
if (num>20 || obj->input_stream.state != WAITING_MESSAGE_START ) /*to avoid tracing server based keep alives*/ {
char *logbuf = make_logbuf(BELLE_SIP_LOG_MESSAGE,begin,num);
belle_sip_message("channel [%p]: received [%i] new bytes from [%s://%s:%i]:\n%s",
obj,
num,
......@@ -572,7 +572,8 @@ static int belle_sip_channel_process_read_data(belle_sip_channel_t *obj){
obj->peer_name,
obj->peer_port,
logbuf);
belle_sip_free(logbuf);
belle_sip_free(logbuf);
}
belle_sip_channel_process_stream(obj,FALSE);
} else if (num == 0) {
/*before closing the channel, check if there was a pending message to receive, whose body acquisition is to be finished.*/
......
......@@ -67,6 +67,13 @@ static void test_attribute_2(void) {
BC_ASSERT_STRING_EQUAL(belle_sdp_attribute_get_value(lAttribute), "31ec21eb38b2ec6d36e8dc7b");
BC_ASSERT_TRUE(belle_sdp_attribute_has_value(lAttribute));
belle_sip_object_unref(BELLE_SIP_OBJECT(lAttribute));
lAttribute = attribute_parse_marshall_parse_clone("a=alt:1 1 : e2br+9PL Eu1qGlQ9 10.211.55.3 8988");
BC_ASSERT_STRING_EQUAL(belle_sdp_attribute_get_name(lAttribute), "alt");
BC_ASSERT_STRING_EQUAL(belle_sdp_attribute_get_value(lAttribute), "1 1 : e2br+9PL Eu1qGlQ9 10.211.55.3 8988");
BC_ASSERT_TRUE(belle_sdp_attribute_has_value(lAttribute));
belle_sip_object_unref(BELLE_SIP_OBJECT(lAttribute));
}
static void test_rtcp_fb_attribute(void) {
......@@ -384,6 +391,7 @@ static void test_simple_session_description(void) {
"c=IN IP4 192.168.0.18\r\n"\
"t=0 0\r\n"\
"m=audio 7078 RTP/AVP 111 110 3 0 8 101\r\n"\
"a=alt:1 1 : e2br+9PL Eu1qGlQ9 10.211.55.3 8988\r\n"\
"a=rtpmap:111 speex/16000\r\n"\
"a=fmtp:111 vbr=on\r\n"\
"a=rtpmap:110 speex/8000\r\n"\
......
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