Ignore:
Timestamp:
Jan 20, 2007 6:35:17 PM (15 years ago)
Author:
bennylp
Message:

Ticket #64: more lenient SDP parsing (take only what we need and ignore anything else)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/sdp.c

    r775 r889  
    771771    } 
    772772 
    773     pj_scan_advance_n(scanner, 3, SKIP_WS); 
    774     pj_scan_get_newline(scanner); 
     773    /* We've got what we're looking for, skip anything until newline */ 
     774    pj_scan_skip_line(scanner); 
    775775} 
    776776 
     
    814814 
    815815    /* address */ 
    816     pj_scan_get_until_ch(scanner, '\r', &ses->origin.addr); 
    817  
    818     /* newline */ 
    819     pj_scan_get_newline(scanner); 
     816    pj_scan_get_until_chr(scanner, " \t\r", &ses->origin.addr); 
     817 
     818    /* We've got what we're looking for, skip anything until newline */ 
     819    pj_scan_skip_line(scanner); 
     820 
    820821} 
    821822 
     
    843844 
    844845    /* stop time */ 
    845     pj_scan_get_until_ch(scanner, '\r', &str); 
     846    pj_scan_get_until_chr(scanner, " \t\r", &str); 
    846847    ses->time.stop = pj_strtoul(&str); 
    847848 
    848     /* newline */ 
    849     pj_scan_get_newline(scanner); 
     849    /* We've got what we're looking for, skip anything until newline */ 
     850    pj_scan_skip_line(scanner); 
    850851} 
    851852 
     
    864865    pj_scan_advance_n(scanner, 2, SKIP_WS); 
    865866 
    866     /* get anything until newline. */ 
     867    /* get anything until newline (including whitespaces). */ 
    867868    pj_scan_get_until_ch(scanner, '\r', str); 
    868869 
     
    888889 
    889890    /* address. */ 
    890     pj_scan_get_until_ch(scanner, '\r', &conn->addr); 
    891  
    892     /* newline */ 
    893     pj_scan_get_newline(scanner); 
     891    pj_scan_get_until_chr(scanner, " \t\r", &conn->addr); 
     892 
     893    /* We've got what we're looking for, skip anything until newline */ 
     894    pj_scan_skip_line(scanner); 
    894895} 
    895896 
     
    941942    } 
    942943 
    943     /* newline */ 
    944     pj_scan_get_newline(scanner); 
     944    /* We've got what we're looking for, skip anything until newline */ 
     945    pj_scan_skip_line(scanner); 
    945946} 
    946947 
     
    991992    } 
    992993 
    993     /* newline */ 
    994     pj_scan_get_newline(scanner); 
     994    /* We've got what we're looking for, skip anything until newline */ 
     995    pj_scan_skip_line(scanner); 
    995996 
    996997    return attr; 
     
    10971098        session = NULL; 
    10981099 
    1099         pj_assert(ctx.last_error == PJ_SUCCESS); 
     1100        pj_assert(ctx.last_error != PJ_SUCCESS); 
    11001101    } 
    11011102    PJ_END; 
Note: See TracChangeset for help on using the changeset viewer.