Hi,
When using sipp-2.0 I noticed that putting [last-Record-Route:] in the UAS
script would cause a blank line to be inserted in the message header, if there
was no Record-Route header in the last request. This happened for any header
that did not exist in the last request.
It looks like what has happened is the call::get_last_header() method is now
returning an empty string instead of NULL when there is no header. Callers of
this method assume that NULL will be returned if there is no header.
I've attached a patch against 2.0 that fixes this in my case - this makes
get_last_header() return NULL instead of an empty string, if there was no last
header.
Cheers
Ben
--
Ben Evans / Software Engineer / Open Cloud / http://www.opencloud.com
--- call.cpp 2007-04-27 02:45:51.000000000 +1200
+++ call.cpp 2007-05-14 10:14:17.000000000 +1200
@@ -1110,13 +1110,16 @@
ERROR_P2("call::get_last_header: Header to parse bigger than %d (%zu)", MAX_HEADER_LEN, strlen(name));
}
+ char* last_header;
if (name[len - 1] == ':') {
- return get_header(last_recv_msg, name, false);
+ last_header = get_header(last_recv_msg, name, false);
} else {
char with_colon[MAX_HEADER_LEN];
sprintf(with_colon, "%s:", name);
- return get_header(last_recv_msg, with_colon, false);
+ last_header = get_header(last_recv_msg, with_colon, false);
}
+ // Last header could be empty string, return null instead
+ return (last_header == NULL || last_header[0] == '\0') ? NULL : last_header;
}
char * call::get_header_content(char* message, char * name)
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Sipp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sipp-users