Changeset 5701
- Timestamp:
- Nov 22, 2017 6:59:47 AM (7 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib-util/src/pjlib-util/http_client.c
r4713 r5701 931 931 * officially supported 932 932 */ 933 PJ_ASSERT_RETURN(hreq->param.addr_family== PJ_AF_UNSPEC||934 hreq->param.addr_family== PJ_AF_INET||935 hreq->param.addr_family== PJ_AF_INET6, PJ_EAFNOTSUP);933 PJ_ASSERT_RETURN(hreq->param.addr_family==pj_AF_UNSPEC() || 934 hreq->param.addr_family==pj_AF_INET() || 935 hreq->param.addr_family==pj_AF_INET6(), PJ_EAFNOTSUP); 936 936 PJ_ASSERT_RETURN(!pj_strcmp2(&hreq->param.version, HTTP_1_0) || 937 937 !pj_strcmp2(&hreq->param.version, HTTP_1_1), -
pjproject/trunk/pjlib/src/pj/string.c
r5682 r5701 77 77 78 78 79 PJ_DE CL(pj_ssize_t) pj_strcspn2(const pj_str_t *str, const char *set_char)79 PJ_DEF(pj_ssize_t) pj_strcspn2(const pj_str_t *str, const char *set_char) 80 80 { 81 81 pj_ssize_t i, j; … … 115 115 116 116 117 PJ_DE CL(pj_ssize_t) pj_strtok2(const pj_str_t *str, const char *delim,117 PJ_DEF(pj_ssize_t) pj_strtok2(const pj_str_t *str, const char *delim, 118 118 pj_str_t *tok, pj_size_t start_idx) 119 119 { -
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_config.c
r5691 r5701 821 821 /* enable compact form - from Ticket #342 */ 822 822 { 823 extern pj_bool_t pjsip_use_compact_form;824 823 extern pj_bool_t pjsip_include_allow_hdr_in_dlg; 825 824 extern pj_bool_t pjmedia_add_rtpmap_for_static_pt; 826 825 827 pjsip_ use_compact_form = PJ_TRUE;826 pjsip_cfg()->endpt.use_compact_form = PJ_TRUE; 828 827 /* do not transmit Allow header */ 829 828 pjsip_include_allow_hdr_in_dlg = PJ_FALSE; … … 1748 1747 pj_str_t cfg; 1749 1748 char line[128]; 1750 extern pj_bool_t pjsip_use_compact_form;1751 1749 1752 1750 PJ_UNUSED_ARG(max); … … 2148 2146 } 2149 2147 2150 if (pjsip_ use_compact_form)2148 if (pjsip_cfg()->endpt.use_compact_form) 2151 2149 { 2152 2150 pj_strcat2(&cfg, "--use-compact-form\n"); -
pjproject/trunk/pjsip/include/pjsip/sip_config.h
r5668 r5701 158 158 pj_bool_t disable_secure_dlg_check; 159 159 160 /** 161 * Encode SIP headers in their short forms to reduce size. By default, 162 * SIP headers in outgoing messages will be encoded in their full names. 163 * If this option is enabled, then SIP headers for outgoing messages 164 * will be encoded in their short forms, to reduce message size. 165 * Note that this does not affect the ability of PJSIP to parse incoming 166 * SIP messages, as the parser always supports parsing both the long 167 * and short version of the headers. 168 * 169 * Default is PJSIP_ENCODE_SHORT_HNAME 170 */ 171 pj_bool_t use_compact_form; 172 160 173 } endpt; 161 174 … … 465 478 * and short version of the headers. 466 479 * 467 * Note that there is also an undocumented variable defined in sip_msg.c 468 * to control whether compact form should be used for encoding SIP 469 * headers. The default value of this variable is PJSIP_ENCODE_SHORT_HNAME. 470 * To change PJSIP behavior during run-time, application can use the 471 * following construct: 472 * 473 \verbatim 474 extern pj_bool_t pjsip_use_compact_form; 475 476 // enable compact form 477 pjsip_use_compact_form = PJ_TRUE; 478 \endverbatim 480 * This option can also be controlled at run-time by the 481 * \a use_compact_form setting in pjsip_cfg_t. 479 482 * 480 483 * Default is 0 (no) -
pjproject/trunk/pjsip/src/pjsip-simple/presence_body.c
r3553 r5701 87 87 /* xs:ID must start with letter */ 88 88 //pj_create_unique_string(pool, &id); 89 id.ptr = (char*)pj_pool_alloc(pool, PJ_GUID_STRING_LENGTH+2);89 id.ptr = (char*)pj_pool_alloc(pool, pj_GUID_STRING_LENGTH()+2); 90 90 id.ptr += 2; 91 91 pj_generate_unique_string(&id); -
pjproject/trunk/pjsip/src/pjsip-simple/rpid.c
r4537 r5701 150 150 /* xs:ID must start with letter */ 151 151 //pj_create_unique_string(pool, &person_id); 152 person_id.ptr = (char*)pj_pool_alloc(pool, PJ_GUID_STRING_LENGTH+2);152 person_id.ptr = (char*)pj_pool_alloc(pool, pj_GUID_STRING_LENGTH()+2); 153 153 person_id.ptr += 2; 154 154 pj_generate_unique_string(&person_id); -
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r5700 r5701 4665 4665 } else if (tsx->role == PJSIP_ROLE_UAS && 4666 4666 tsx->state == PJSIP_TSX_STATE_TRYING && 4667 pjsip_method_cmp(&tsx->method, &pjsip_invite_method)==0)4667 pjsip_method_cmp(&tsx->method, pjsip_get_invite_method())==0) 4668 4668 { 4669 4669 pjsip_rx_data *rdata = e->body.tsx_state.src.rdata; -
pjproject/trunk/pjsip/src/pjsip-ua/sip_timer.c
r5576 r5701 71 71 }; 72 72 73 /* External global vars */74 extern pj_bool_t pjsip_use_compact_form;75 76 73 /* Local functions & vars */ 77 74 static void stop_timer(pjsip_inv_session *inv); … … 125 122 pj_ssize_t printed; 126 123 const pjsip_parser_const_t *pc = pjsip_parser_const(); 127 const pj_str_t *hname = pjsip_use_compact_form? &hdr->sname : &hdr->name; 124 const pj_str_t *hname = pjsip_cfg()->endpt.use_compact_form? 125 &hdr->sname : &hdr->name; 128 126 129 127 /* Print header name and value */ -
pjproject/trunk/pjsip/src/pjsip/sip_config.c
r5090 r5701 35 35 PJSIP_REQ_HAS_VIA_ALIAS, 36 36 PJSIP_RESOLVE_HOSTNAME_TO_GET_INTERFACE, 37 0 37 0, 38 PJSIP_ENCODE_SHORT_HNAME 38 39 }, 39 40 -
pjproject/trunk/pjsip/src/pjsip/sip_msg.c
r5468 r5701 145 145 }; 146 146 147 pj_bool_t pjsip_use_compact_form = PJSIP_ENCODE_SHORT_HNAME;148 149 147 static pj_str_t status_phrase[710]; 150 148 static int print_media_type(char *buf, unsigned len, … … 404 402 pj_str_t clen_hdr = { "Content-Length: ", 16}; 405 403 406 if (pjsip_ use_compact_form) {404 if (pjsip_cfg()->endpt.use_compact_form) { 407 405 clen_hdr.ptr = "l: "; 408 406 clen_hdr.slen = 3; … … 487 485 const pjsip_media_type *media = &msg->body->content_type; 488 486 489 if (pjsip_ use_compact_form) {487 if (pjsip_cfg()->endpt.use_compact_form) { 490 488 ctype_hdr.ptr = "c: "; 491 489 ctype_hdr.slen = 3; … … 750 748 { 751 749 char *p = buf; 752 const pj_str_t *hname = pjsip_use_compact_form? &hdr->sname : &hdr->name; 750 const pj_str_t *hname = pjsip_cfg()->endpt.use_compact_form? 751 &hdr->sname : &hdr->name; 753 752 754 753 if ((pj_ssize_t)size < hname->slen + hdr->hvalue.slen + 5) … … 833 832 { 834 833 char *p = buf; 835 const pj_str_t *hname = pjsip_use_compact_form? &hdr->sname : &hdr->name; 834 const pj_str_t *hname = pjsip_cfg()->endpt.use_compact_form? 835 &hdr->sname : &hdr->name; 836 836 837 837 if ((pj_ssize_t)size < hname->slen + 15) … … 909 909 { 910 910 char *p = buf, *endbuf = buf+size; 911 const pj_str_t *hname = pjsip_use_compact_form? &hdr->sname : &hdr->name; 911 const pj_str_t *hname = pjsip_cfg()->endpt.use_compact_form? 912 &hdr->sname : &hdr->name; 912 913 913 914 copy_advance(p, (*hname)); … … 1058 1059 char *p = buf; 1059 1060 int len; 1060 const pj_str_t *hname = pjsip_use_compact_form? &hdr->sname : &hdr->name; 1061 const pj_str_t *hname = pjsip_cfg()->endpt.use_compact_form? 1062 &hdr->sname : &hdr->name; 1061 1063 1062 1064 if ((pj_ssize_t)size < hname->slen + 14) … … 1201 1203 pj_size_t size) 1202 1204 { 1203 const pj_str_t *hname = pjsip_use_compact_form? &hdr->sname : &hdr->name; 1205 const pj_str_t *hname = pjsip_cfg()->endpt.use_compact_form? 1206 &hdr->sname : &hdr->name; 1204 1207 const pjsip_parser_const_t *pc = pjsip_parser_const(); 1205 1208 … … 1375 1378 char *p = buf; 1376 1379 int len; 1377 const pj_str_t *hname = pjsip_use_compact_form? &hdr->sname : &hdr->name; 1380 const pj_str_t *hname = pjsip_cfg()->endpt.use_compact_form? 1381 &hdr->sname : &hdr->name; 1378 1382 1379 1383 if ((pj_ssize_t)size < hname->slen + … … 1515 1519 char *startbuf = buf; 1516 1520 char *endbuf = buf + size; 1517 const pj_str_t *hname = pjsip_use_compact_form? &hdr->sname : &hdr->name; 1521 const pj_str_t *hname = pjsip_cfg()->endpt.use_compact_form? 1522 &hdr->sname : &hdr->name; 1518 1523 const pjsip_parser_const_t *pc = pjsip_parser_const(); 1519 1524 … … 1985 1990 char *endbuf = buf + size; 1986 1991 pj_str_t sip_ver = { "SIP/2.0/", 8 }; 1987 const pj_str_t *hname = pjsip_use_compact_form? &hdr->sname : &hdr->name; 1992 const pj_str_t *hname = pjsip_cfg()->endpt.use_compact_form? 1993 &hdr->sname : &hdr->name; 1988 1994 const pjsip_parser_const_t *pc = pjsip_parser_const(); 1989 1995 -
pjproject/trunk/pjsip/src/pjsip/sip_multipart.c
r5693 r5701 39 39 #endif 40 40 41 extern pj_bool_t pjsip_use_compact_form;42 43 41 /* Type of "data" in multipart pjsip_msg_body */ 44 42 struct multipart_data … … 106 104 const pjsip_media_type *media = &part->body->content_type; 107 105 108 if (pjsip_ use_compact_form) {106 if (pjsip_cfg()->endpt.use_compact_form) { 109 107 ctype_hdr.ptr = "c: "; 110 108 ctype_hdr.slen = 3; -
pjproject/trunk/pjsip/src/pjsip/sip_transport.c
r5690 r5701 1424 1424 pj_status_t status = -1; 1425 1425 1426 af = (tp_type & PJSIP_TRANSPORT_IPV6)? PJ_AF_INET6 : PJ_AF_INET;1426 af = (tp_type & PJSIP_TRANSPORT_IPV6)? pj_AF_INET6() : pj_AF_INET(); 1427 1427 1428 1428 if (pjsip_cfg()->endpt.resolve_hostname_to_get_interface) { -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r5635 r5701 3873 3873 3874 3874 /* Disconnect the call */ 3875 status = pjsip_dlg_create_request(forked_dlg, &pjsip_bye_method,3875 status = pjsip_dlg_create_request(forked_dlg, pjsip_get_bye_method(), 3876 3876 -1, &bye); 3877 3877 if (status == PJ_SUCCESS) { … … 4499 4499 pjsip_tx_data *tdata; 4500 4500 4501 status = pjsip_evsub_initiate(sub, &pjsip_subscribe_method,4501 status = pjsip_evsub_initiate(sub, pjsip_get_subscribe_method(), 4502 4502 0, &tdata); 4503 4503 if (status == PJ_SUCCESS) … … 4892 4892 } 4893 4893 } else if (tsx->role == PJSIP_ROLE_UAC && 4894 pjsip_method_cmp(&tsx->method, &pjsip_invite_method)==0 &&4894 pjsip_method_cmp(&tsx->method, pjsip_get_invite_method())==0 && 4895 4895 tsx->state >= PJSIP_TSX_STATE_COMPLETED && 4896 4896 e->body.tsx_state.prev_state < PJSIP_TSX_STATE_COMPLETED && -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
r5561 r5701 1578 1578 const pjsip_transaction *tsx = event->body.tsx_state.tsx; 1579 1579 if (pjsip_method_cmp(&tsx->method, 1580 &pjsip_subscribe_method)==0)1580 pjsip_get_subscribe_method())==0) 1581 1581 { 1582 1582 buddy->term_code = tsx->status_code; … … 1597 1597 } 1598 1598 } else if (pjsip_method_cmp(&tsx->method, 1599 &pjsip_notify_method)==0)1599 pjsip_get_notify_method())==0) 1600 1600 { 1601 1601 if (pj_stricmp2(&buddy->term_reason, "deactivated")==0 || … … 2276 2276 pjsip_event_hdr *eh; 2277 2277 2278 if (pjsip_method_cmp(&msg->line.req.method, &pjsip_notify_method)!=0) { 2278 if (pjsip_method_cmp(&msg->line.req.method, pjsip_get_notify_method())!=0) 2279 { 2279 2280 /* Only interested with NOTIFY request */ 2280 2281 return PJ_FALSE;
Note: See TracChangeset
for help on using the changeset viewer.