Changeset 2546


Ignore:
Timestamp:
Mar 23, 2009 1:26:00 PM (11 years ago)
Author:
bennylp
Message:

Ticket #705: backported changes from ticket #704

Location:
pjproject/branches/1.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.0

  • pjproject/branches/1.0/pjsip/src/test-pjsip/msg_test.c

    r2538 r2546  
    18671867        pjsip_hdr *parsed_hdr1=NULL, *parsed_hdr2=NULL; 
    18681868        char *input, *output; 
     1869#if defined(PJSIP_UNESCAPE_IN_PLACE) && PJSIP_UNESCAPE_IN_PLACE!=0 
     1870        static char hcontent[1024]; 
     1871#else 
     1872        char *hcontent; 
     1873#endif 
    18691874        int rc; 
    18701875 
     
    18741879        hname = pj_str(test->hname); 
    18751880        len = strlen(test->hcontent); 
     1881#if defined(PJSIP_UNESCAPE_IN_PLACE) && PJSIP_UNESCAPE_IN_PLACE!=0 
     1882        PJ_ASSERT_RETURN(len < sizeof(hcontent), PJSIP_EMSGTOOLONG); 
     1883        strcpy(hcontent, test->hcontent); 
     1884#else 
     1885        hcontent = test->hcontent; 
     1886#endif 
     1887         
    18761888        parsed_hdr1 = (pjsip_hdr*) pjsip_parse_hdr(pool, &hname,  
    1877                                                    test->hcontent, len,  
     1889                                                   hcontent, len,  
    18781890                                                   &parsed_len); 
    18791891        if (parsed_hdr1 == NULL) { 
     
    18981910            hname = pj_str(test->hshort_name); 
    18991911            len = strlen(test->hcontent); 
    1900             parsed_hdr2 = (pjsip_hdr*) pjsip_parse_hdr(pool, &hname, test->hcontent, len, &parsed_len); 
     1912#if defined(PJSIP_UNESCAPE_IN_PLACE) && PJSIP_UNESCAPE_IN_PLACE!=0 
     1913            PJ_ASSERT_RETURN(len < sizeof(hcontent), PJSIP_EMSGTOOLONG); 
     1914            strcpy(hcontent, test->hcontent); 
     1915#else 
     1916            hcontent = test->hcontent; 
     1917#endif 
     1918 
     1919            parsed_hdr2 = (pjsip_hdr*) pjsip_parse_hdr(pool, &hname, hcontent, len, &parsed_len); 
    19011920            if (parsed_hdr2 == NULL) { 
    19021921                PJ_LOG(3,(THIS_FILE, "    error parsing header %s: %s", test->hshort_name, test->hcontent)); 
Note: See TracChangeset for help on using the changeset viewer.