Ignore:
Timestamp:
Nov 20, 2005 7:58:10 PM (18 years ago)
Author:
bennylp
Message:

More compliant URI parser, comparison, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c

    r57 r64  
    2323#include <pjsip/sip_resolve.h> 
    2424#include <pjsip/sip_module.h> 
    25 #include <pjsip/sip_misc.h> 
     25#include <pjsip/sip_util.h> 
    2626#include <pjsip/sip_errno.h> 
    2727#include <pj/except.h> 
     
    107107 
    108108/* 
    109  * Create transaction. 
    110  * Defined in sip_transaction.c 
    111  */ 
    112 pj_status_t pjsip_tsx_create( pj_pool_t *pool, pjsip_endpoint *endpt, 
    113                               pjsip_transaction **tsx ); 
    114  
    115 /* 
    116109 * This is the global handler for memory allocation failure, for pools that 
    117110 * are created by the endpoint (by default, all pools ARE allocated by  
     
    295288 * Get "Allow" header. 
    296289 */ 
    297 PJ_DECL(const pjsip_allow_hdr*) pjsip_endpt_get_allow_hdr( pjsip_endpoint *endpt ) 
     290PJ_DEF(const pjsip_allow_hdr*) pjsip_endpt_get_allow_hdr( pjsip_endpoint *endpt ) 
    298291{ 
    299292    return endpt->allow_hdr; 
     
    672665 * Find transaction by the key. 
    673666 */ 
    674 PJ_DECL(pjsip_transaction*) pjsip_endpt_find_tsx( pjsip_endpoint *endpt, 
     667PJ_DEF(pjsip_transaction*) pjsip_endpt_find_tsx( pjsip_endpoint *endpt, 
    675668                                                  const pj_str_t *key ) 
    676669{ 
     
    981974 * Find/create transport. 
    982975 */ 
    983 PJ_DECL(pj_status_t) pjsip_endpt_alloc_transport( pjsip_endpoint *endpt, 
     976PJ_DEF(pj_status_t) pjsip_endpt_alloc_transport( pjsip_endpoint *endpt, 
    984977                                                  pjsip_transport_type_e type, 
    985978                                                  const pj_sockaddr_in *remote, 
     
    992985 
    993986 
     987/* 
     988 * Report error. 
     989 */ 
     990PJ_DEF(void) pjsip_endpt_log_error(  pjsip_endpoint *endpt, 
     991                                     const char *sender, 
     992                                     pj_status_t error_code, 
     993                                     const char *format, 
     994                                     ... ) 
     995{ 
     996    char newformat[256]; 
     997    int len; 
     998    va_list marker; 
     999 
     1000    va_start(marker, format); 
     1001 
     1002    PJ_UNUSED_ARG(endpt); 
     1003 
     1004    len = pj_native_strlen(format); 
     1005    if (len < sizeof(newformat)-30) { 
     1006        pj_str_t errstr; 
     1007 
     1008        pj_native_strcpy(newformat, format); 
     1009        pj_snprintf(newformat+len, sizeof(newformat)-len-1, 
     1010                    ": [err %d] ", error_code); 
     1011        len += pj_native_strlen(newformat+len); 
     1012 
     1013        errstr = pjsip_strerror(error_code, newformat+len,  
     1014                                sizeof(newformat)-len-1); 
     1015 
     1016        len += errstr.slen; 
     1017        newformat[len] = '\0'; 
     1018 
     1019        pj_log(sender, 1, newformat, marker); 
     1020    } else { 
     1021        pj_log(sender, 1, format, marker); 
     1022    } 
     1023 
     1024    va_end(marker); 
     1025} 
     1026 
     1027 
     1028/* 
     1029 * Dump endpoint. 
     1030 */ 
    9941031PJ_DEF(void) pjsip_endpt_dump( pjsip_endpoint *endpt, pj_bool_t detail ) 
    9951032{ 
Note: See TracChangeset for help on using the changeset viewer.