Changeset 1800
- Timestamp:
- Feb 15, 2008 5:26:47 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_transport.c
r1634 r1800 1271 1271 if (rdata->pkt_info.len <= 0) 1272 1272 return -1; 1273 1273 1274 1274 current_pkt = rdata->pkt_info.packet; 1275 1275 remaining_len = rdata->pkt_info.len; … … 1284 1284 1285 1285 pjsip_msg *msg; 1286 char *p, *end; 1287 char saved; 1286 1288 pj_size_t msg_fragment_size; 1289 1290 /* Skip leading newlines as pjsip_find_msg() currently can't 1291 * handle leading newlines. 1292 */ 1293 for (p=current_pkt, end=p+remaining_len; p!=end; ++p) { 1294 if (*p != '\r' && *p != '\n') 1295 break; 1296 } 1297 if (p!=current_pkt) { 1298 remaining_len -= (p - current_pkt); 1299 total_processed += (p - current_pkt); 1300 current_pkt = p; 1301 if (remaining_len == 0) { 1302 return total_processed; 1303 } 1304 } 1287 1305 1288 1306 /* Initialize default fragment size. */ 1289 1307 msg_fragment_size = remaining_len; 1290 1291 /* Null terminate packet. */1292 1308 1293 1309 /* Clear and init msg_info in rdata. … … 1320 1336 rdata->msg_info.len = msg_fragment_size; 1321 1337 1338 /* Null terminate packet */ 1339 saved = current_pkt[msg_fragment_size]; 1340 current_pkt[msg_fragment_size] = '\0'; 1341 1322 1342 /* Parse the message. */ 1323 1343 rdata->msg_info.msg = msg = 1324 1344 pjsip_parse_rdata( current_pkt, msg_fragment_size, rdata); 1345 1346 /* Restore null termination */ 1347 current_pkt[msg_fragment_size] = saved; 1325 1348 1326 1349 /* Check for parsing syntax error */
Note: See TracChangeset
for help on using the changeset viewer.