Changeset 5701 for pjproject


Ignore:
Timestamp:
Nov 22, 2017 6:59:47 AM (6 years ago)
Author:
riza
Message:

Close #2067: Fix linker error when building as dll on VS2015.

Location:
pjproject/trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib-util/src/pjlib-util/http_client.c

    r4713 r5701  
    931931         * officially supported 
    932932         */ 
    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); 
    936936        PJ_ASSERT_RETURN(!pj_strcmp2(&hreq->param.version, HTTP_1_0) ||  
    937937                         !pj_strcmp2(&hreq->param.version, HTTP_1_1),  
  • pjproject/trunk/pjlib/src/pj/string.c

    r5682 r5701  
    7777 
    7878 
    79 PJ_DECL(pj_ssize_t) pj_strcspn2(const pj_str_t *str, const char *set_char) 
     79PJ_DEF(pj_ssize_t) pj_strcspn2(const pj_str_t *str, const char *set_char) 
    8080{ 
    8181    pj_ssize_t i, j; 
     
    115115 
    116116 
    117 PJ_DECL(pj_ssize_t) pj_strtok2(const pj_str_t *str, const char *delim, 
     117PJ_DEF(pj_ssize_t) pj_strtok2(const pj_str_t *str, const char *delim, 
    118118                               pj_str_t *tok, pj_size_t start_idx) 
    119119{ 
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_config.c

    r5691 r5701  
    821821            /* enable compact form - from Ticket #342 */ 
    822822            { 
    823                 extern pj_bool_t pjsip_use_compact_form; 
    824823                extern pj_bool_t pjsip_include_allow_hdr_in_dlg; 
    825824                extern pj_bool_t pjmedia_add_rtpmap_for_static_pt; 
    826825 
    827                 pjsip_use_compact_form = PJ_TRUE; 
     826                pjsip_cfg()->endpt.use_compact_form = PJ_TRUE; 
    828827                /* do not transmit Allow header */ 
    829828                pjsip_include_allow_hdr_in_dlg = PJ_FALSE; 
     
    17481747    pj_str_t cfg; 
    17491748    char line[128]; 
    1750     extern pj_bool_t pjsip_use_compact_form; 
    17511749 
    17521750    PJ_UNUSED_ARG(max); 
     
    21482146    } 
    21492147 
    2150     if (pjsip_use_compact_form) 
     2148    if (pjsip_cfg()->endpt.use_compact_form) 
    21512149    { 
    21522150        pj_strcat2(&cfg, "--use-compact-form\n"); 
  • pjproject/trunk/pjsip/include/pjsip/sip_config.h

    r5668 r5701  
    158158        pj_bool_t disable_secure_dlg_check; 
    159159 
     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 
    160173    } endpt; 
    161174 
     
    465478 * and short version of the headers. 
    466479 * 
    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. 
    479482 * 
    480483 * Default is 0 (no) 
  • pjproject/trunk/pjsip/src/pjsip-simple/presence_body.c

    r3553 r5701  
    8787            /* xs:ID must start with letter */ 
    8888            //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); 
    9090            id.ptr += 2; 
    9191            pj_generate_unique_string(&id); 
  • pjproject/trunk/pjsip/src/pjsip-simple/rpid.c

    r4537 r5701  
    150150        /* xs:ID must start with letter */ 
    151151        //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); 
    153153        person_id.ptr += 2; 
    154154        pj_generate_unique_string(&person_id); 
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c

    r5700 r5701  
    46654665    } else if (tsx->role == PJSIP_ROLE_UAS && 
    46664666               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) 
    46684668    { 
    46694669        pjsip_rx_data *rdata = e->body.tsx_state.src.rdata; 
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_timer.c

    r5576 r5701  
    7171}; 
    7272 
    73 /* External global vars */ 
    74 extern pj_bool_t pjsip_use_compact_form; 
    75  
    7673/* Local functions & vars */ 
    7774static void stop_timer(pjsip_inv_session *inv); 
     
    125122    pj_ssize_t printed; 
    126123    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; 
    128126 
    129127    /* Print header name and value */ 
  • pjproject/trunk/pjsip/src/pjsip/sip_config.c

    r5090 r5701  
    3535       PJSIP_REQ_HAS_VIA_ALIAS, 
    3636       PJSIP_RESOLVE_HOSTNAME_TO_GET_INTERFACE, 
    37        0 
     37       0, 
     38       PJSIP_ENCODE_SHORT_HNAME 
    3839    }, 
    3940 
  • pjproject/trunk/pjsip/src/pjsip/sip_msg.c

    r5468 r5701  
    145145}; 
    146146 
    147 pj_bool_t pjsip_use_compact_form = PJSIP_ENCODE_SHORT_HNAME; 
    148  
    149147static pj_str_t status_phrase[710]; 
    150148static int print_media_type(char *buf, unsigned len, 
     
    404402    pj_str_t clen_hdr =  { "Content-Length: ", 16}; 
    405403 
    406     if (pjsip_use_compact_form) { 
     404    if (pjsip_cfg()->endpt.use_compact_form) { 
    407405        clen_hdr.ptr = "l: "; 
    408406        clen_hdr.slen = 3; 
     
    487485            const pjsip_media_type *media = &msg->body->content_type; 
    488486 
    489             if (pjsip_use_compact_form) { 
     487            if (pjsip_cfg()->endpt.use_compact_form) { 
    490488                ctype_hdr.ptr = "c: "; 
    491489                ctype_hdr.slen = 3; 
     
    750748{ 
    751749    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; 
    753752     
    754753    if ((pj_ssize_t)size < hname->slen + hdr->hvalue.slen + 5) 
     
    833832{ 
    834833    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; 
    836836 
    837837    if ((pj_ssize_t)size < hname->slen + 15) 
     
    909909{ 
    910910    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; 
    912913 
    913914    copy_advance(p, (*hname)); 
     
    10581059    char *p = buf; 
    10591060    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; 
    10611063 
    10621064    if ((pj_ssize_t)size < hname->slen + 14) 
     
    12011203                                    pj_size_t size) 
    12021204{ 
    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; 
    12041207    const pjsip_parser_const_t *pc = pjsip_parser_const(); 
    12051208 
     
    13751378    char *p = buf; 
    13761379    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; 
    13781382 
    13791383    if ((pj_ssize_t)size < hname->slen +  
     
    15151519    char *startbuf = buf; 
    15161520    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; 
    15181523    const pjsip_parser_const_t *pc = pjsip_parser_const(); 
    15191524 
     
    19851990    char *endbuf = buf + size; 
    19861991    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; 
    19881994    const pjsip_parser_const_t *pc = pjsip_parser_const(); 
    19891995 
  • pjproject/trunk/pjsip/src/pjsip/sip_multipart.c

    r5693 r5701  
    3939#endif 
    4040 
    41 extern pj_bool_t pjsip_use_compact_form; 
    42  
    4341/* Type of "data" in multipart pjsip_msg_body */ 
    4442struct multipart_data 
     
    106104            const pjsip_media_type *media = &part->body->content_type; 
    107105 
    108             if (pjsip_use_compact_form) { 
     106            if (pjsip_cfg()->endpt.use_compact_form) { 
    109107                ctype_hdr.ptr = "c: "; 
    110108                ctype_hdr.slen = 3; 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport.c

    r5690 r5701  
    14241424    pj_status_t status = -1; 
    14251425 
    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(); 
    14271427 
    14281428    if (pjsip_cfg()->endpt.resolve_hostname_to_get_interface) { 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c

    r5635 r5701  
    38733873 
    38743874        /* 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(), 
    38763876                                          -1, &bye); 
    38773877        if (status == PJ_SUCCESS) { 
     
    44994499            pjsip_tx_data *tdata; 
    45004500 
    4501             status = pjsip_evsub_initiate(sub, &pjsip_subscribe_method, 
     4501            status = pjsip_evsub_initiate(sub, pjsip_get_subscribe_method(), 
    45024502                                          0, &tdata); 
    45034503            if (status == PJ_SUCCESS) 
     
    48924892        } 
    48934893    } 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 && 
    48954895               tsx->state >= PJSIP_TSX_STATE_COMPLETED && 
    48964896               e->body.tsx_state.prev_state < PJSIP_TSX_STATE_COMPLETED && 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c

    r5561 r5701  
    15781578                const pjsip_transaction *tsx = event->body.tsx_state.tsx; 
    15791579                if (pjsip_method_cmp(&tsx->method,  
    1580                                      &pjsip_subscribe_method)==0) 
     1580                                     pjsip_get_subscribe_method())==0) 
    15811581                { 
    15821582                    buddy->term_code = tsx->status_code; 
     
    15971597                    } 
    15981598                } else if (pjsip_method_cmp(&tsx->method, 
    1599                                             &pjsip_notify_method)==0) 
     1599                                            pjsip_get_notify_method())==0) 
    16001600                { 
    16011601                    if (pj_stricmp2(&buddy->term_reason, "deactivated")==0 || 
     
    22762276    pjsip_event_hdr *eh; 
    22772277 
    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    { 
    22792280        /* Only interested with NOTIFY request */ 
    22802281        return PJ_FALSE; 
Note: See TracChangeset for help on using the changeset viewer.