|
@@ -1,7 +1,7 @@
|
|
|
/*
|
|
|
* $Id$
|
|
|
*
|
|
|
- * Copyright (C) 2001-2003 FhG Fokus
|
|
|
+ * Copyright (C) 2001-2003 Fhg Fokus
|
|
|
*
|
|
|
* This file is part of ser, a free SIP server.
|
|
|
*
|
|
@@ -501,6 +501,8 @@ char* parse_to(char* buffer, char *end, struct to_body *to_b)
|
|
|
to_b->error=PARSE_OK;
|
|
|
to_b->uri.len = 0;
|
|
|
to_b->uri.s= 0;
|
|
|
+ to_b->display.len = 0;
|
|
|
+ to_b->display.s = 0;
|
|
|
foo=0;
|
|
|
|
|
|
for( tmp=buffer; tmp<end; tmp++)
|
|
@@ -624,9 +626,12 @@ char* parse_to(char* buffer, char *end, struct to_body *to_b)
|
|
|
case DISPLAY_QUOTED:
|
|
|
break;
|
|
|
case E_DISPLAY_QUOTED:
|
|
|
+ status = S_URI_ENCLOSED;
|
|
|
+ break;
|
|
|
case URI_OR_TOKEN:
|
|
|
case DISPLAY_TOKEN:
|
|
|
case MAYBE_URI_END:
|
|
|
+ to_b->display.len=foo-to_b->display.s;
|
|
|
status = S_URI_ENCLOSED;
|
|
|
break;
|
|
|
case F_CRLF:
|
|
@@ -669,10 +674,12 @@ char* parse_to(char* buffer, char *end, struct to_body *to_b)
|
|
|
{
|
|
|
case START_TO:
|
|
|
to_b->body.s = tmp;
|
|
|
+ to_b->display.s = tmp;
|
|
|
status = DISPLAY_QUOTED;
|
|
|
break;
|
|
|
case DISPLAY_QUOTED:
|
|
|
status = E_DISPLAY_QUOTED;
|
|
|
+ to_b->display.len = tmp-to_b->display.s+1;
|
|
|
break;
|
|
|
case F_CRLF:
|
|
|
case F_LF:
|
|
@@ -717,7 +724,8 @@ char* parse_to(char* buffer, char *end, struct to_body *to_b)
|
|
|
{
|
|
|
case START_TO:
|
|
|
to_b->uri.s = to_b->body.s = tmp;
|
|
|
- status = URI_OR_TOKEN;;
|
|
|
+ status = URI_OR_TOKEN;
|
|
|
+ to_b->display.s=tmp;
|
|
|
break;
|
|
|
case S_URI_ENCLOSED:
|
|
|
to_b->uri.s=tmp;
|
|
@@ -744,6 +752,7 @@ char* parse_to(char* buffer, char *end, struct to_body *to_b)
|
|
|
}/*for*/
|
|
|
|
|
|
endofheader:
|
|
|
+ if (to_b->display.len==0) to_b->display.s=0;
|
|
|
status=saved_status;
|
|
|
DBG("end of header reached, state=%d\n", status);
|
|
|
/* check if error*/
|
|
@@ -779,6 +788,3 @@ void free_to(struct to_body* tb)
|
|
|
}
|
|
|
pkg_free(tb);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|