Ignore:
Timestamp:
Nov 22, 2005 1:06:33 AM (18 years ago)
Author:
bennylp
Message:

Fix parse param bug in Contact hdr and add more msg tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_parser.c

    r74 r76  
    759759    } 
    760760 
    761     msg = pjsip_msg_create(pool, PJSIP_REQUEST_MSG); 
    762  
    763761    /* Parse request or status line */ 
    764762    if (pj_scan_stricmp( scanner, PJSIP_VERSION, 7) == 0) { 
    765         msg->type = PJSIP_RESPONSE_MSG; 
     763        msg = pjsip_msg_create(pool, PJSIP_RESPONSE_MSG); 
    766764        int_parse_status_line( scanner, &msg->line.status ); 
    767765    } else { 
    768         msg->type = PJSIP_REQUEST_MSG; 
     766        msg = pjsip_msg_create(pool, PJSIP_REQUEST_MSG); 
    769767        int_parse_req_line(scanner, pool, &msg->line.req ); 
    770768    } 
     
    859857 
    860858    /* If we have Content-Type header, treat the rest of the message as body.*/ 
    861     if (ctype_hdr) { 
     859    if (ctype_hdr && scanner->curptr!=scanner->end) { 
    862860        pjsip_msg_body *body = pj_pool_alloc(pool, sizeof(pjsip_msg_body)); 
    863861        pj_strdup(pool, &body->content_type.type, &ctype_hdr->media.type); 
     
    13801378            hdr->star = 0; 
    13811379            hdr->uri = int_parse_uri_or_name_addr(scanner, ctx->pool,  
    1382                                                   PJSIP_PARSE_URI_AS_NAMEADDR); 
     1380                                                  PJSIP_PARSE_URI_AS_NAMEADDR | 
     1381                                                  PJSIP_PARSE_URI_IN_FROM_TO_HDR); 
    13831382 
    13841383            int_parse_contact_param(hdr, scanner, ctx->pool); 
Note: See TracChangeset for help on using the changeset viewer.