Changeset 571 for pjproject/trunk/pjmedia/src/pjmedia/sdp.c
- Timestamp:
- Jul 2, 2006 12:29:54 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/sdp.c
r569 r571 35 35 }; 36 36 #define TOKEN "-.!%*_=`'~" 37 //#define TOKEN "'`-./:?\"#$&*;=@[]^_`{|}+~!" 37 38 #define NTP_OFFSET ((pj_uint32_t)2208988800) 38 39 #define THIS_FILE "sdp.c" … … 67 68 static int is_initialized; 68 69 static pj_cis_buf_t cis_buf; 69 static pj_cis_t cs_ token;70 static pj_cis_t cs_digit, cs_token; 70 71 71 72 static void init_sdp_parser(void) … … 79 80 80 81 pj_cis_buf_init(&cis_buf); 82 81 83 pj_cis_init(&cis_buf, &cs_token); 82 84 pj_cis_add_alpha(&cs_token); 83 85 pj_cis_add_num(&cs_token); 84 86 pj_cis_add_str(&cs_token, TOKEN); 87 88 pj_cis_init(&cis_buf, &cs_digit); 89 pj_cis_add_num(&cs_digit); 85 90 } 86 91 … … 258 263 /* Init */ 259 264 rtpmap->pt.slen = rtpmap->param.slen = rtpmap->enc_name.slen = 0; 265 rtpmap->clock_rate = 0; 260 266 261 267 /* Parse */ … … 283 289 284 290 /* Get the clock rate. */ 285 pj_scan_get(&scanner, &cs_ token, &token);291 pj_scan_get(&scanner, &cs_digit, &token); 286 292 rtpmap->clock_rate = pj_strtoul(&token); 287 293 … … 761 767 ctx->last_error = PJMEDIA_SDP_EINVER; 762 768 769 /* check equal sign */ 770 if (*(scanner->curptr+1) != '=') { 771 on_scanner_error(scanner); 772 return; 773 } 774 775 /* check version is 0 */ 776 if (*(scanner->curptr+2) != '0') { 777 on_scanner_error(scanner); 778 return; 779 } 780 763 781 pj_scan_advance_n(scanner, 3, SKIP_WS); 764 782 pj_scan_get_newline(scanner); … … 771 789 772 790 ctx->last_error = PJMEDIA_SDP_EINORIGIN; 791 792 /* check equal sign */ 793 if (*(scanner->curptr+1) != '=') { 794 on_scanner_error(scanner); 795 return; 796 } 773 797 774 798 /* o= */ … … 811 835 ctx->last_error = PJMEDIA_SDP_EINTIME; 812 836 837 /* check equal sign */ 838 if (*(scanner->curptr+1) != '=') { 839 on_scanner_error(scanner); 840 return; 841 } 842 813 843 /* t= */ 814 844 pj_scan_advance_n(scanner, 2, SKIP_WS); … … 833 863 ctx->last_error = PJMEDIA_SDP_EINSDP; 834 864 865 /* check equal sign */ 866 if (*(scanner->curptr+1) != '=') { 867 on_scanner_error(scanner); 868 return; 869 } 870 835 871 /* x= */ 836 872 pj_scan_advance_n(scanner, 2, SKIP_WS); … … 872 908 873 909 ctx->last_error = PJMEDIA_SDP_EINMEDIA; 910 911 /* check the equal sign */ 912 if (*(scanner->curptr+1) != '=') { 913 on_scanner_error(scanner); 914 return; 915 } 874 916 875 917 /* m= */ … … 926 968 927 969 attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr)); 970 971 /* check equal sign */ 972 if (*(scanner->curptr+1) != '=') { 973 on_scanner_error(scanner); 974 return NULL; 975 } 928 976 929 977 /* skip a= */ … … 1013 1061 break; 1014 1062 default: 1015 parse_generic_line(&scanner, &dummy, &ctx); 1063 if (cur_name >= 'a' && cur_name <= 'z') 1064 parse_generic_line(&scanner, &dummy, &ctx); 1065 else { 1066 ctx.last_error = PJMEDIA_SDP_EINSDP; 1067 on_scanner_error(&scanner); 1068 } 1016 1069 break; 1017 1070 } … … 1104 1157 1105 1158 #define CHECK(exp,ret) do { \ 1106 pj_assert(exp);\1159 /*pj_assert(exp);*/ \ 1107 1160 if (!(exp)) \ 1108 1161 return ret; \
Note: See TracChangeset
for help on using the changeset viewer.