Changeset 491 for pjproject/trunk
- Timestamp:
- Jun 6, 2006 5:04:30 PM (18 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsip/sip_config.h
r331 r491 116 116 #define PJSIP_MAX_CALL_ID_LEN PJ_GUID_STRING_LENGTH 117 117 #define PJSIP_MAX_TAG_LEN PJ_GUID_STRING_LENGTH 118 #define PJSIP_MAX_BRANCH_LEN (PJSIP_RFC3261_BRANCH_LEN + PJ_GUID_STRING_LENGTH )118 #define PJSIP_MAX_BRANCH_LEN (PJSIP_RFC3261_BRANCH_LEN + PJ_GUID_STRING_LENGTH + 2) 119 119 #define PJSIP_MAX_HNAME_LEN 64 120 120 -
pjproject/trunk/pjsip/include/pjsip/sip_errno.h
r283 r491 372 372 */ 373 373 #define PJSIP_ESESSIONTERMINATED (PJSIP_ERRNO_START_PJSIP+140) /* 171140 */ 374 /** 375 * @hideinitializer 376 * Invalid session state for the specified operation. 377 */ 378 #define PJSIP_ESESSIONSTATE (PJSIP_ERRNO_START_PJSIP+141) /* 171141 */ 374 379 375 380 -
pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c
r486 r491 672 672 673 673 if (status != PJ_SUCCESS) { 674 PJSIP_ENDPT_LOG_ERROR((endpt, "transport", status, 675 "Error processing packet from %s:%d, packet:--\n" 676 "%s\n" 677 "-- end of packet.", 678 rdata->pkt_info.src_name, 679 rdata->pkt_info.src_port, 680 rdata->msg_info.msg_buf)); 674 char info[30]; 675 char errmsg[PJ_ERR_MSG_SIZE]; 676 677 info[0] = '\0'; 678 679 if (status == PJSIP_EMISSINGHDR) { 680 pj_str_t p; 681 682 p.ptr = info; p.slen = 0; 683 684 if (rdata->msg_info.cid == NULL || rdata->msg_info.cid->id.slen) 685 pj_strcpy2(&p, "Call-ID"); 686 if (rdata->msg_info.from == NULL) 687 pj_strcpy2(&p, " From"); 688 if (rdata->msg_info.to == NULL) 689 pj_strcpy2(&p, " To"); 690 if (rdata->msg_info.via == NULL) 691 pj_strcpy2(&p, " Via"); 692 if (rdata->msg_info.cseq == NULL) 693 pj_strcpy2(&p, " CSeq"); 694 695 p.ptr[p.slen] = '\0'; 696 } 697 698 pj_strerror(status, errmsg, sizeof(errmsg)); 699 700 PJ_LOG(1, (THIS_FILE, 701 "Error processing packet from %s:%d: %s %s [code %d]:\n" 702 "%s\n" 703 "-- end of packet.", 704 rdata->pkt_info.src_name, 705 rdata->pkt_info.src_port, 706 errmsg, 707 info, 708 status, 709 rdata->msg_info.msg_buf)); 681 710 return; 682 711 } -
pjproject/trunk/pjsip/src/pjsip/sip_errno.c
r406 r491 107 107 108 108 /* Invite session. */ 109 { PJSIP_ESESSIONTERMINATED, "Session already terminated" }, 109 { PJSIP_ESESSIONTERMINATED, "INVITE session already terminated" }, 110 { PJSIP_ESESSIONSTATE, "Invalid INVITE session state" }, 110 111 }; 111 112 -
pjproject/trunk/pjsip/src/pjsip/sip_msg.c
r453 r491 365 365 /* Process message body. */ 366 366 if (msg->body) { 367 enum { CLEN_SPACE = 12};367 enum { CLEN_SPACE = 5 }; 368 368 char *clen_pos = NULL; 369 369 … … 394 394 p += clen_hdr.slen; 395 395 396 /* Print blanks after "Content- Type:", this is where we'll put396 /* Print blanks after "Content-Length:", this is where we'll put 397 397 * the content length value after we know the length of the 398 398 * body. … … 420 420 */ 421 421 if (clen_pos) { 422 char tmp[ CLEN_SPACE];422 char tmp[16]; 423 423 len = pj_utoa(len, tmp); 424 if (len > CLEN_SPACE) len = CLEN_SPACE; 424 425 pj_memcpy(clen_pos+CLEN_SPACE-len, tmp, len); 425 426 } … … 434 435 pj_memcpy(p, clen_hdr.ptr, clen_hdr.slen); 435 436 p += clen_hdr.slen; 437 *p++ = ' '; 436 438 *p++ = '0'; 437 439 *p++ = '\r'; -
pjproject/trunk/pjsip/src/pjsip/sip_parser.c
r184 r491 265 265 * Syntax error exception number. 266 266 */ 267 status = pj_exception_id_alloc("PJSIP :syntax error",267 status = pj_exception_id_alloc("PJSIP syntax error", 268 268 &PJSIP_SYN_ERR_EXCEPTION); 269 269 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); … … 910 910 err_info->except_code = PJ_GET_EXCEPTION(); 911 911 err_info->line = scanner->line; 912 err_info->col = pj_scan_get_col(scanner); 912 /* Scanner's column is zero based, so add 1 */ 913 err_info->col = pj_scan_get_col(scanner) + 1; 913 914 if (parsing_headers) 914 915 err_info->hname = hname; -
pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
r448 r491 1126 1126 pj_memcpy(via->branch_param.ptr, PJSIP_RFC3261_BRANCH_ID, 1127 1127 PJSIP_RFC3261_BRANCH_LEN); 1128 1129 tmp.ptr = via->branch_param.ptr + PJSIP_RFC3261_BRANCH_LEN;1128 tmp.ptr = via->branch_param.ptr + PJSIP_RFC3261_BRANCH_LEN + 2; 1129 *(tmp.ptr-2) = 80; *(tmp.ptr-1) = 106; 1130 1130 pj_generate_unique_string( &tmp ); 1131 1131 -
pjproject/trunk/pjsip/src/pjsip/sip_transport.c
r367 r491 24 24 #include <pjsip/sip_errno.h> 25 25 #include <pjsip/sip_module.h> 26 #include <pj/except.h> 26 27 #include <pj/os.h> 27 28 #include <pj/log.h> … … 879 880 } 880 881 882 /* Check for parsing syntax error */ 883 if (!pj_list_empty(&rdata->msg_info.parse_err)) { 884 pjsip_parser_err_report *err; 885 char buf[128]; 886 pj_str_t tmp; 887 888 /* Gather syntax error information */ 889 tmp.ptr = buf; tmp.slen = 0; 890 err = rdata->msg_info.parse_err.next; 891 while (err != &rdata->msg_info.parse_err) { 892 int len; 893 len = pj_ansi_snprintf(tmp.ptr+tmp.slen, sizeof(buf)-tmp.slen, 894 ": %s exception when parsing %.*s " 895 "header on line %d col %d", 896 pj_exception_id_name(err->except_code), 897 (int)err->hname.slen, err->hname.ptr, 898 err->line, err->col); 899 if (len > 0 && len < (int) (sizeof(buf)-tmp.slen)) { 900 tmp.slen += len; 901 } 902 err = err->next; 903 } 904 905 PJ_LOG(1, (THIS_FILE, 906 "Error processing packet from %s:%d %.*s:\n" 907 "%s\n" 908 "-- end of packet.", 909 rdata->pkt_info.src_name, 910 rdata->pkt_info.src_port, 911 (int)tmp.slen, tmp.ptr, 912 rdata->msg_info.msg_buf)); 913 914 goto finish_process_fragment; 915 } 916 881 917 /* Perform basic header checking. */ 882 918 if (rdata->msg_info.cid == NULL || -
pjproject/trunk/pjsip/src/pjsip/sip_util.c
r448 r491 863 863 pj_memcpy(via->branch_param.ptr, PJSIP_RFC3261_BRANCH_ID, 864 864 PJSIP_RFC3261_BRANCH_LEN); 865 tmp.ptr = via->branch_param.ptr + PJSIP_RFC3261_BRANCH_LEN; 865 tmp.ptr = via->branch_param.ptr + PJSIP_RFC3261_BRANCH_LEN + 2; 866 *(tmp.ptr-2) = 80; *(tmp.ptr-1) = 106; 866 867 pj_generate_unique_string(&tmp); 867 868 }
Note: See TracChangeset
for help on using the changeset viewer.