Changeset 65 for pjproject


Ignore:
Timestamp:
Nov 21, 2005 1:55:47 AM (19 years ago)
Author:
bennylp
Message:

Set svn:eol-style property

Location:
pjproject/trunk
Files:
283 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/build/cc-gcc.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/build/cc-vc.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/build/common.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/build/host-mingw.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/build/host-unix.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/build/host-win32.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/build/m-alpha.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/build/m-i386.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/build/m-m68k.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/build/m-sparc.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/build/os-linux-kernel.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/build/os-linux.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/build/os-palmos.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/build/os-sunos.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/build/os-win32.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/build/pjproject.dsw

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/build/pjproject.sln

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/build/rules.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib-util/build/Makefile

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib-util/build/pjlib_util.dsp

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjlib-util/build/pjlib_util.dsw

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjlib-util/build/pjlib_util_test.dsp

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjlib-util/include/pjlib-util/md5.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib-util/include/pjlib-util/scanner.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib-util/include/pjlib-util/string.h

    • Property svn:eol-style set to native
    r63 r65  
    1 /* $Id: $ */ 
     1/* $Id$ */ 
    22/*  
    33 * Copyright (C)2003-2006 Benny Prijono <benny@prijono.org> 
     
    3131 
    3232/** 
    33  * Unescape string. 
     33 * Unescape string. If source string does not contain any escaped 
     34 * characters, the function would simply return the original string. 
     35 * Otherwise a new string will be allocated. 
    3436 * 
    35  * @param str       The string to unescape. 
     37 * @param pool      Pool to allocate the string. 
     38 * @param src       Source string to unescape. 
     39 * 
     40 * @return          String with no escaped characters. 
    3641 */ 
    37 PJ_DECL(void) pj_str_unescape(pj_str_t *str); 
     42PJ_DECL(pj_str_t) pj_str_unescape( pj_pool_t *pool, const pj_str_t *src); 
    3843 
    3944/** 
  • pjproject/trunk/pjlib-util/include/pjlib-util/stun.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib-util/include/pjlib-util/xml.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib-util/src/pjlib-util-test/main.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib-util/src/pjlib-util-test/test.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib-util/src/pjlib-util-test/test.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib-util/src/pjlib-util-test/xml.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib-util/src/pjlib-util/md5.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib-util/src/pjlib-util/scanner.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib-util/src/pjlib-util/string.c

    • Property svn:eol-style set to native
    r63 r65  
    1 /* $Id: $ */ 
     1/* $Id$ */ 
    22/*  
    33 * Copyright (C)2003-2006 Benny Prijono <benny@prijono.org> 
     
    1919#include <pjlib-util/string.h> 
    2020#include <pj/ctype.h> 
     21#include <pj/string.h> 
     22#include <pj/pool.h> 
    2123 
    22 PJ_DEF(void) pj_str_unescape(pj_str_t *str) 
     24PJ_DEF(pj_str_t) pj_str_unescape( pj_pool_t *pool, const pj_str_t *src_str) 
    2325{ 
    24     char *src = str->ptr; 
    25     char *dst = str->ptr; 
    26     char *end = src + str->slen; 
     26    char *src = src_str->ptr; 
     27    char *end = src + src_str->slen; 
     28    pj_str_t dst_str; 
     29    char *dst; 
    2730     
     31    if (pj_strchr(src_str, '%')==NULL) 
     32        return *src_str; 
     33 
     34    dst = dst_str.ptr = pj_pool_alloc(pool, src_str->slen); 
     35 
    2836    while (src != end) { 
    2937        if (*src == '%' && src < end-2) { 
     
    3341            src += 3; 
    3442        } else { 
    35             ++src; 
    36             ++dst; 
     43            *dst++ = *src++; 
    3744        } 
    3845    } 
    39     str->slen = dst - str->ptr; 
     46    dst_str.slen = dst - dst_str.ptr; 
     47    return dst_str; 
    4048} 
    4149 
  • pjproject/trunk/pjlib-util/src/pjlib-util/stun.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib-util/src/pjlib-util/stun_client.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib-util/src/pjlib-util/symbols.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib-util/src/pjlib-util/xml.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/build/Makefile

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/build/os-linux-kernel.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/build/os-linux.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/build/os-sunos.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/build/os-win32.mak

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/build/pjlib++-test.dsp

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjlib/build/pjlib++.dsp

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjlib/build/pjlib++.vcproj

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjlib/build/pjlib.dsp

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjlib/build/pjlib.dsw

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjlib/build/pjlib.sln

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjlib/build/pjlib.vcproj

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjlib/build/pjlib_samples.dsp

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjlib/build/pjlib_samples.vcproj

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjlib/build/pjlib_test.dsp

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjlib/build/pjlib_test.vcproj

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjlib/include/pj++/file.hpp

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj++/hash.hpp

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj++/list.hpp

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj++/lock.hpp

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj++/os.hpp

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj++/pool.hpp

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj++/proactor.hpp

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj++/scanner.hpp

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj++/sock.hpp

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj++/string.hpp

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj++/timer.hpp

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj++/tree.hpp

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj++/types.hpp

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/addr_resolv.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/array.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/assert.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/assert.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/cc_gcc.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/cc_msvc.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/ctype.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/errno.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/high_precision.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/m_alpha.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/m_i386.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/m_m68k.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/m_sparc.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/malloc.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/os_linux.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/os_linux_kernel.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/os_palmos.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/os_sunos.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/os_win32.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/rand.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/setjmp.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/size_t.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/socket.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/sprintf.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/stdarg.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/stdfileio.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/string.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/time.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/compat/vsprintf.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/include/pj/os.h

    r51 r65  
    867867 
    868868/** 
     869 * Add timestamp t2 to t1. 
     870 * @param t1        t1. 
     871 * @param t2        t2. 
     872 */ 
     873PJ_INLINE(void) pj_add_timestamp(pj_timestamp *t1, const pj_timestamp *t2) 
     874{ 
     875#if PJ_HAS_INT64 
     876    t1->u64 += t2->u64; 
     877#else 
     878    pj_uint32_t old = t1->u32.lo; 
     879    t1->u32.hi += t2->u32.hi; 
     880    t1->u32.lo += t2->u32.lo; 
     881    if (t1->u32.lo < old) 
     882        ++t1->u32.hi; 
     883#endif 
     884} 
     885 
     886/** 
     887 * Substract timestamp t2 from t1. 
     888 * @param t1        t1. 
     889 * @param t2        t2. 
     890 */ 
     891PJ_INLINE(void) pj_sub_timestamp(pj_timestamp *t1, const pj_timestamp *t2) 
     892{ 
     893#if PJ_HAS_INT64 
     894    t1->u64 -= t2->u64; 
     895#else 
     896    t1->u32.hi -= t2->u32.hi; 
     897    if (t1->u32.lo >= t2->u32.lo) 
     898        t1->u32.lo -= t2->u32.lo; 
     899    else { 
     900        t1->u32.lo -= t2->u32.lo; 
     901        --t1->u32.hi; 
     902    } 
     903#endif 
     904} 
     905 
     906/** 
    869907 * Calculate the elapsed time, and store it in pj_time_val. 
    870908 * This function calculates the elapsed time using highest precision 
  • pjproject/trunk/pjlib/include/pj/string.h

    r62 r65  
    399399 * @return the pointer to first character found, or NULL. 
    400400 */ 
    401 PJ_INLINE(char*) pj_strchr( pj_str_t *str, int chr) 
     401PJ_INLINE(char*) pj_strchr( const pj_str_t *str, int chr) 
    402402{ 
    403403    return (char*) memchr(str->ptr, chr, str->slen); 
  • pjproject/trunk/pjlib/src/pj/addr_resolv_linux_kernel.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pj/addr_resolv_sock.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pj/array.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pj/compat/longjmp_i386.S

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pj/compat/setjmp_i386.S

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pj/compat/sigjmp.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pj/compat/string.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib++-test/main.cpp

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-samples/except.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-samples/list.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-samples/log.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/atomic.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/echo_clt.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/errno.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/exception.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/fifobuf.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/file.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/ioq_perf.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/ioq_tcp.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/ioq_udp.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/list.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/main.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/main_mod.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/mutex.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/os.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/pool.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/pool_perf.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/rand.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/rbtree.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/select.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/sleep.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/sock.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/sock_perf.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/string.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/test.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/test.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/thread.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/timer.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/timestamp.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_sync.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjlib/src/pjlib-test/util.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/build/Jbtest.dat

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/build/Makefile

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/build/make-linux-i386.inc

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/build/make-mingw.inc

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/build/make-rules

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/build/pjmedia.dsp

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjmedia/build/pjmedia.dsw

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjmedia/build/pjmedia.sln

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjmedia/build/pjmedia.vcproj

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjmedia/build/pjmedia_audio_tool.dsp

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjmedia/build/pjmedia_audio_tool.vcproj

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjmedia/build/pjmedia_test.dsp

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjmedia/build/pjmedia_test.vcproj

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjmedia/src/pjmedia/codec.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/codec.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/config.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/dsound.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/g711.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/jbuf.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/jbuf.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/mediamgr.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/mediamgr.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/nullsound.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/pasound.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/LICENSE.txt

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/README.txt

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/V19-devel-readme.txt

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/dsound_wrapper.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/dsound_wrapper.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_allocation.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_allocation.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_converters.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_converters.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_cpuload.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_cpuload.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_dither.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_dither.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_endianness.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_front.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_hostapi.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_linux_alsa.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_linux_alsa.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_process.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_process.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_skeleton.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_stream.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_stream.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_trace.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_trace.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_types.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_hostapis.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_oss.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_util.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_unix_util.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_util.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_ds.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_hostapis.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_util.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_wmme.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_wmme.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_x86_plain_converters.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_x86_plain_converters.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/portaudio.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/test/audio_tool.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/test/jbuf_test.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/test/main.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/test/rtp_test.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/test/sdptest.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjmedia/src/test/session_test.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/build/Makefile

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/build/make-linux-i386.inc

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/build/make-mingw.inc

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/build/make-optimize.inc

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/build/make-rules

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/build/pjsip.dsw

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjsip/build/pjsip.sln

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjsip/build/pjsip_auth_lib.dsp

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjsip/build/pjsip_core.dsp

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjsip/build/pjsip_simple.dsp

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjsip/build/pjsip_ua.dsp

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjsip/build/pjsua.dsp

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjsip/build/test_pjsip.dsp

    • Property svn:eol-style set to CRLF
  • pjproject/trunk/pjsip/include/pjsip-simple/event_notify.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip-simple/event_notify_msg.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip-simple/messaging.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip-simple/pidf.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip-simple/presence.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip-simple/xpidf.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip-ua/sip_dialog.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip-ua/sip_regc.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip-ua/sip_ua.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip/print_util.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip/sip_auth.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip/sip_auth_msg.h

    • Property svn:eol-style set to native
    r60 r65  
    3737{ 
    3838    pj_str_t    realm; 
     39    pjsip_param other_param; 
    3940}; 
    4041 
     
    4950{ 
    5051    pj_str_t    realm; 
     52    pjsip_param other_param; 
    5153    pj_str_t    username; 
    5254    pj_str_t    nonce; 
     
    5860    pj_str_t    qop; 
    5961    pj_str_t    nc; 
    60     pj_str_t    other_param; 
    6162}; 
    6263 
     
    7071{ 
    7172    pj_str_t    realm; 
     73    pjsip_param other_param; 
    7274    pj_str_t    version; 
    7375    pj_str_t    signature; 
     
    130132{ 
    131133    pj_str_t    realm; 
     134    pjsip_param other_param; 
    132135}; 
    133136 
     
    141144{ 
    142145    pj_str_t    realm; 
     146    pjsip_param other_param; 
    143147    pj_str_t    domain; 
    144148    pj_str_t    nonce; 
     
    147151    pj_str_t    algorithm; 
    148152    pj_str_t    qop; 
    149     pj_str_t    other_param; 
    150153}; 
    151154 
     
    159162{ 
    160163    pj_str_t    realm; 
     164    pjsip_param other_param; 
    161165    pj_str_t    version; 
    162166    pj_str_t    micalgorithm; 
  • pjproject/trunk/pjsip/include/pjsip/sip_auth_parser.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip/sip_config.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip/sip_endpoint.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip/sip_errno.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip/sip_event.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip/sip_module.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip/sip_msg.h

    • Property svn:eol-style set to native
    r60 r65  
    995995    PJSIP_DECL_HDR_MEMBER(struct pjsip_contact_hdr); 
    996996    int             star;           /**< The contact contains only a '*' character */ 
    997     pjsip_uri *uri;         /**< URI in the contact. */ 
     997    pjsip_uri      *uri;            /**< URI in the contact. */ 
    998998    int             q1000;          /**< The "q" value times 1000 (to avoid float) */ 
    999999    pj_int32_t      expires;        /**< Expires parameter, otherwise -1 if not present. */ 
    1000     pj_str_t        other_param;    /**< Other parameters, concatenated in a single string. */ 
     1000    pjsip_param     other_param;    /**< Other parameters, concatenated in a single string. */ 
    10011001} pjsip_contact_hdr; 
    10021002 
     
    10781078{ 
    10791079    PJSIP_DECL_HDR_MEMBER(struct pjsip_fromto_hdr); 
    1080     pjsip_uri  *uri;        /**< URI in From/To header. */ 
     1080    pjsip_uri       *uri;           /**< URI in From/To header. */ 
    10811081    pj_str_t         tag;           /**< Header "tag" parameter. */ 
    1082     pj_str_t         other_param;   /**< Other params, concatenated as a single string. */ 
     1082    pjsip_param      other_param;   /**< Other params, concatenated as a single string. */ 
    10831083} pjsip_fromto_hdr; 
    10841084 
     
    11881188    PJSIP_DECL_HDR_MEMBER(struct pjsip_routing_hdr);  /**< Generic header fields. */ 
    11891189    pjsip_name_addr  name_addr;   /**< The URL in the Route/Record-Route header. */ 
    1190     pj_str_t         other_param; /** Other parameter. */ 
     1190    pjsip_param      other_param; /** Other parameter. */ 
    11911191} pjsip_routing_hdr; 
    11921192 
     
    13521352    pj_str_t         recvd_param;   /**< "received" parameter. */ 
    13531353    pj_str_t         branch_param;  /**< "branch" parameter. */ 
    1354     pj_str_t         other_param;   /**< Other parameters, concatenated as single string. */ 
     1354    pjsip_param      other_param;   /**< Other parameters, concatenated as single string. */ 
    13551355    pj_str_t         comment;       /**< Comment. */ 
    13561356} pjsip_via_hdr; 
  • pjproject/trunk/pjsip/include/pjsip/sip_msg_i.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip/sip_parser.h

    • Property svn:eol-style set to native
    r64 r65  
    337337}; 
    338338 
    339 void pjsip_parse_param_imp(  pj_scanner *scanner, 
     339void pjsip_parse_param_imp(  pj_scanner *scanner, pj_pool_t *pool, 
    340340                             pj_str_t *pname, pj_str_t *pvalue, 
    341341                             unsigned opt); 
  • pjproject/trunk/pjsip/include/pjsip/sip_private.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip/sip_resolve.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip/sip_transaction.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip/sip_transport.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip/sip_transport_udp.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip/sip_types.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/include/pjsip/sip_uri.h

    • Property svn:eol-style set to native
    r64 r65  
    8585PJ_DECL(void) pjsip_param_clone(pj_pool_t *pool, pjsip_param *dst_list, 
    8686                                const pjsip_param *src_list); 
     87 
     88/** 
     89 * Duplicate the parameters. 
     90 * 
     91 * @param pool          Pool to allocate memory from. 
     92 * @param dst_list      Destination list. 
     93 * @param src_list      Source list. 
     94 */ 
     95PJ_DECL(void) pjsip_param_shallow_clone(pj_pool_t *pool,  
     96                                        pjsip_param *dst_list, 
     97                                        const pjsip_param *src_list); 
     98 
     99/** 
     100 * Print parameters. 
     101 * 
     102 * @param param_list    The parameter list. 
     103 * @param buf           Buffer. 
     104 * @param size          Size of buffer. 
     105 * @param sep           Separator character (either ';' or ','). 
     106 * 
     107 * @return              The number of bytes printed, or -1 on errr. 
     108 */ 
     109PJ_DECL(pj_ssize_t) pjsip_param_print_on(const pjsip_param *param_list, 
     110                                         char *buf, pj_size_t size, 
     111                                         int sep); 
    87112 
    88113/** 
  • pjproject/trunk/pjsip/include/pjsip/sip_util.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip-simple/event_notify.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip-simple/event_notify_msg.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip-simple/messaging.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip-simple/pidf.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip-simple/presence.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip-simple/xpidf.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_dialog.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_ua.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_ua_private.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip/sip_auth.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip/sip_auth_msg.c

    • Property svn:eol-style set to native
    r51 r65  
    4848    pjsip_authorization_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr)); 
    4949    init_hdr(hdr, PJSIP_H_AUTHORIZATION, &authorization_hdr_vptr); 
     50    pj_list_init(&hdr->credential.common.other_param); 
    5051    return hdr; 
    5152} 
     
    5556    pjsip_proxy_authorization_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr)); 
    5657    init_hdr(hdr, PJSIP_H_PROXY_AUTHORIZATION, &authorization_hdr_vptr); 
     58    pj_list_init(&hdr->credential.common.other_param); 
    5759    return hdr; 
    5860} 
     
    7779    copy_advance_pair(buf, ", qop=", 6, cred->qop); 
    7880    copy_advance_pair(buf, ", nc=", 5, cred->nc); 
    79     copy_advance(buf, cred->other_param); 
     81     
     82    printed = pjsip_param_print_on(&cred->other_param, buf, endbuf-buf, ','); 
     83    if (printed < 0) 
     84        return -1; 
     85    buf += printed; 
    8086 
    8187    return (int) (buf-startbuf); 
     
    148154        pj_strdup(pool, &hdr->credential.digest.qop, &rhs->credential.digest.qop); 
    149155        pj_strdup(pool, &hdr->credential.digest.nc, &rhs->credential.digest.nc); 
    150         pj_strdup(pool, &hdr->credential.digest.other_param, &rhs->credential.digest.other_param); 
     156        pjsip_param_clone(pool, &hdr->credential.digest.other_param, &rhs->credential.digest.other_param); 
    151157    } else if (pj_stricmp2(&hdr->scheme, "pgp") == 0) { 
    152158        pj_assert(0); 
     
    166172    pjsip_authorization_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
    167173    pj_memcpy(hdr, rhs, sizeof(*hdr)); 
     174    pjsip_param_shallow_clone(pool, &hdr->credential.common.other_param,  
     175                              &rhs->credential.common.other_param); 
    168176    return hdr; 
    169177} 
     
    193201    pjsip_www_authenticate_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr)); 
    194202    init_hdr(hdr, PJSIP_H_WWW_AUTHENTICATE, &www_authenticate_hdr_vptr); 
     203    pj_list_init(&hdr->challenge.common.other_param); 
    195204    return hdr; 
    196205} 
     
    201210    pjsip_proxy_authenticate_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr)); 
    202211    init_hdr(hdr, PJSIP_H_PROXY_AUTHENTICATE, &www_authenticate_hdr_vptr); 
     212    pj_list_init(&hdr->challenge.common.other_param); 
    203213    return hdr; 
    204214} 
     
    221231    copy_advance_pair(buf, ",algorithm=", 11, chal->algorithm); 
    222232    copy_advance_pair_quote_cond(buf, ",qop=", 5, chal->qop, '"', '"'); 
    223     copy_advance(buf, chal->other_param); 
     233     
     234    printed = pjsip_param_print_on(&chal->other_param, buf, endbuf-buf, ','); 
     235    if (printed < 0) 
     236        return -1; 
     237    buf += printed; 
    224238 
    225239    return (int)(buf-startbuf); 
     
    286300        pj_strdup(pool, &hdr->challenge.digest.algorithm, &rhs->challenge.digest.algorithm); 
    287301        pj_strdup(pool, &hdr->challenge.digest.qop, &rhs->challenge.digest.qop); 
    288         pj_strdup(pool, &hdr->challenge.digest.other_param, &rhs->challenge.digest.other_param); 
     302        pjsip_param_clone(pool, &hdr->challenge.digest.other_param,  
     303                          &rhs->challenge.digest.other_param); 
    289304    } else if (pj_stricmp2(&hdr->scheme, "pgp") == 0) { 
    290305        pj_assert(0); 
     
    305320    pjsip_www_authenticate_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
    306321    pj_memcpy(hdr, rhs, sizeof(*hdr)); 
    307     return hdr; 
    308 } 
    309  
    310  
     322    pjsip_param_shallow_clone(pool, &hdr->challenge.common.other_param,  
     323                              &rhs->challenge.common.other_param); 
     324    return hdr; 
     325} 
     326 
     327 
  • pjproject/trunk/pjsip/src/pjsip/sip_auth_parser.c

    • Property svn:eol-style set to native
    r51 r65  
    2323#include <pj/string.h> 
    2424#include <pj/except.h> 
     25#include <pj/pool.h> 
    2526 
    2627static pjsip_hdr* parse_hdr_authorization       ( pjsip_parse_ctx *ctx ); 
     
    6768                                     pjsip_digest_credential *cred) 
    6869{ 
     70    pj_list_init(&cred->other_param); 
     71 
    6972    for (;;) { 
    7073        pj_str_t name, value; 
    7174 
    72         pjsip_parse_param_imp(scanner, &name, &value,PJSIP_PARSE_REMOVE_QUOTE); 
     75        pjsip_parse_param_imp(scanner, pool, &name, &value, 
     76                              PJSIP_PARSE_REMOVE_QUOTE); 
    7377 
    7478        if (!pj_stricmp(&name, &pjsip_USERNAME_STR)) { 
     
    103107 
    104108        } else { 
    105             pjsip_concat_param_imp(&cred->other_param,pool,&name,&value, ','); 
     109            pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param)); 
     110            p->name = name; 
     111            p->value = value; 
     112            pj_list_insert_before(&cred->other_param, p); 
    106113        } 
    107114 
     
    127134                                    pjsip_digest_challenge *chal) 
    128135{ 
     136    pj_list_init(&chal->other_param); 
     137 
    129138    for (;;) { 
    130139        pj_str_t name, value; 
    131140 
    132         pjsip_parse_param_imp(scanner, &name, &value,PJSIP_PARSE_REMOVE_QUOTE); 
     141        pjsip_parse_param_imp(scanner, pool, &name, &value, 
     142                              PJSIP_PARSE_REMOVE_QUOTE); 
    133143 
    134144        if (!pj_stricmp(&name, &pjsip_REALM_STR)) { 
     
    159169 
    160170        } else { 
    161             pjsip_concat_param_imp(&chal->other_param, pool,  
    162                                    &name, &value, ','); 
     171            pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param)); 
     172            p->name = name; 
     173            p->value = value; 
     174            pj_list_insert_before(&chal->other_param, p); 
    163175        } 
    164176 
  • pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip/sip_errno.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip/sip_msg.c

    • Property svn:eol-style set to native
    r51 r65  
    869869    init_hdr(hdr, PJSIP_H_CONTACT, &contact_hdr_vptr); 
    870870    hdr->expires = -1; 
     871    pj_list_init(&hdr->other_param); 
    871872    return hdr; 
    872873} 
     
    884885        *p++ = ' '; 
    885886        *p++ = '*'; 
    886         *p = '\0'; 
    887887        return p - buf; 
    888888 
     
    928928        } 
    929929 
    930         if (hdr->other_param.slen) { 
    931             copy_advance(buf, hdr->other_param); 
    932         } 
    933  
    934         *buf = '\0'; 
     930        printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf,';'); 
     931        if (printed < 0) 
     932            return printed; 
     933        buf += printed; 
     934 
    935935        return buf-startbuf; 
    936936    } 
    937937} 
    938938 
    939 static pjsip_contact_hdr* pjsip_contact_hdr_clone( pj_pool_t *pool,  
    940                                                    const pjsip_contact_hdr *rhs) 
     939static pjsip_contact_hdr* pjsip_contact_hdr_clone(pj_pool_t *pool,  
     940                                                  const pjsip_contact_hdr *rhs) 
    941941{ 
    942942    pjsip_contact_hdr *hdr = pjsip_contact_hdr_create(pool); 
     
    949949    hdr->q1000 = rhs->q1000; 
    950950    hdr->expires = rhs->expires; 
    951     pj_strdup(pool, &hdr->other_param, &rhs->other_param); 
    952     return hdr; 
    953 } 
    954  
    955 static pjsip_contact_hdr* pjsip_contact_hdr_shallow_clone( pj_pool_t *pool, 
    956                                                            const pjsip_contact_hdr *rhs) 
     951    pjsip_param_clone(pool, &hdr->other_param, &rhs->other_param); 
     952    return hdr; 
     953} 
     954 
     955static pjsip_contact_hdr*  
     956pjsip_contact_hdr_shallow_clone( pj_pool_t *pool, 
     957                                 const pjsip_contact_hdr *rhs) 
    957958{ 
    958959    pjsip_contact_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
    959960    pj_memcpy(hdr, rhs, sizeof(*hdr)); 
     961    pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param); 
    960962    return hdr; 
    961963} 
     
    965967 * Content-Type header.. 
    966968 */ 
    967 static int pjsip_ctype_hdr_print( pjsip_ctype_hdr *hdr, char *buf, pj_size_t size); 
    968 static pjsip_ctype_hdr* pjsip_ctype_hdr_clone( pj_pool_t *pool, const pjsip_ctype_hdr *hdr); 
     969static int pjsip_ctype_hdr_print( pjsip_ctype_hdr *hdr, char *buf,  
     970                                  pj_size_t size); 
     971static pjsip_ctype_hdr* pjsip_ctype_hdr_clone(pj_pool_t *pool,  
     972                                              const pjsip_ctype_hdr *hdr); 
    969973#define pjsip_ctype_hdr_shallow_clone pjsip_ctype_hdr_clone 
    970974 
     
    10711075    pjsip_from_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr)); 
    10721076    init_hdr(hdr, PJSIP_H_FROM, &fromto_hdr_vptr); 
     1077    pj_list_init(&hdr->other_param); 
    10731078    return hdr; 
    10741079} 
     
    10781083    pjsip_to_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr)); 
    10791084    init_hdr(hdr, PJSIP_H_TO, &fromto_hdr_vptr); 
     1085    pj_list_init(&hdr->other_param); 
    10801086    return hdr; 
    10811087} 
     
    11061112    *buf++ = ' '; 
    11071113 
    1108     printed = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, hdr->uri, buf, endbuf-buf); 
     1114    printed = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, hdr->uri,  
     1115                              buf, endbuf-buf); 
    11091116    if (printed < 1) 
    11101117        return -1; 
     
    11131120 
    11141121    copy_advance_pair(buf, ";tag=", 5, hdr->tag); 
    1115     if (hdr->other_param.slen) 
    1116         copy_advance(buf, hdr->other_param); 
     1122 
     1123    printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, ';'); 
     1124    if (printed < 0) 
     1125        return -1; 
     1126    buf += printed; 
    11171127 
    11181128    return buf-startbuf; 
     
    11291139    hdr->uri = pjsip_uri_clone(pool, rhs->uri); 
    11301140    pj_strdup( pool, &hdr->tag, &rhs->tag); 
    1131     pj_strdup( pool, &hdr->other_param, &rhs->other_param); 
    1132  
    1133     return hdr; 
    1134 } 
    1135  
    1136 static pjsip_fromto_hdr* pjsip_fromto_hdr_shallow_clone( pj_pool_t *pool, 
    1137                                                          const pjsip_fromto_hdr *rhs) 
     1141    pjsip_param_clone( pool, &hdr->other_param, &rhs->other_param); 
     1142 
     1143    return hdr; 
     1144} 
     1145 
     1146static pjsip_fromto_hdr*  
     1147pjsip_fromto_hdr_shallow_clone( pj_pool_t *pool, 
     1148                                const pjsip_fromto_hdr *rhs) 
    11381149{ 
    11391150    pjsip_fromto_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
    11401151    pj_memcpy(hdr, rhs, sizeof(*hdr)); 
     1152    pjsip_param_shallow_clone( pool, &hdr->other_param, &rhs->other_param); 
    11411153    return hdr; 
    11421154} 
     
    11881200    init_hdr(hdr, PJSIP_H_RECORD_ROUTE, &routing_hdr_vptr); 
    11891201    pjsip_name_addr_init(&hdr->name_addr); 
    1190     pj_memset(&hdr->other_param, 0, sizeof(hdr->other_param)); 
     1202    pj_list_init(&hdr->other_param); 
    11911203    return hdr; 
    11921204} 
     
    11971209    init_hdr(hdr, PJSIP_H_ROUTE, &routing_hdr_vptr); 
    11981210    pjsip_name_addr_init(&hdr->name_addr); 
    1199     pj_memset(&hdr->other_param, 0, sizeof(hdr->other_param)); 
     1211    pj_list_init(&hdr->other_param); 
    12001212    return hdr; 
    12011213} 
     
    12261238    *buf++ = ' '; 
    12271239 
    1228     printed = pjsip_uri_print(PJSIP_URI_IN_ROUTING_HDR, &hdr->name_addr, buf, endbuf-buf); 
     1240    printed = pjsip_uri_print(PJSIP_URI_IN_ROUTING_HDR, &hdr->name_addr, buf,  
     1241                              endbuf-buf); 
    12291242    if (printed < 1) 
    12301243        return -1; 
    12311244    buf += printed; 
    12321245 
    1233     if (hdr->other_param.slen) { 
    1234         copy_advance(buf, hdr->other_param); 
    1235     } 
     1246    printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, ';'); 
     1247    if (printed < 0) 
     1248        return -1; 
     1249    buf += printed; 
    12361250 
    12371251    return buf-startbuf; 
     
    12461260    pjsip_name_addr_init(&hdr->name_addr); 
    12471261    pjsip_name_addr_assign(pool, &hdr->name_addr, &rhs->name_addr); 
    1248     pj_strdup( pool, &hdr->other_param, &rhs->other_param); 
     1262    pjsip_param_clone( pool, &hdr->other_param, &rhs->other_param); 
    12491263    return hdr; 
    12501264} 
     
    12551269    pjsip_routing_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
    12561270    pj_memcpy(hdr, rhs, sizeof(*hdr)); 
     1271    pjsip_param_shallow_clone( pool, &hdr->other_param, &rhs->other_param); 
    12571272    return hdr; 
    12581273} 
     
    13311346    hdr->ttl_param = -1; 
    13321347    hdr->rport_param = -1; 
     1348    pj_list_init(&hdr->other_param); 
    13331349    return hdr; 
    13341350} 
     
    13901406    copy_advance_pair(buf, ";received=", 10, hdr->recvd_param); 
    13911407    copy_advance_pair(buf, ";branch=", 8, hdr->branch_param); 
    1392     copy_advance(buf, hdr->other_param); 
    13931408     
    1394     *buf = '\0'; 
     1409    printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, ';'); 
     1410    if (printed < 0) 
     1411        return -1; 
     1412    buf += printed; 
     1413     
    13951414    return buf-startbuf; 
    13961415} 
     
    14081427    pj_strdup(pool, &hdr->recvd_param, &rhs->recvd_param); 
    14091428    pj_strdup(pool, &hdr->branch_param, &rhs->branch_param); 
    1410     pj_strdup(pool, &hdr->other_param, &rhs->other_param); 
     1429    pjsip_param_clone(pool, &hdr->other_param, &rhs->other_param); 
    14111430    return hdr; 
    14121431} 
     
    14171436    pjsip_via_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
    14181437    pj_memcpy(hdr, rhs, sizeof(*hdr)); 
     1438    pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param); 
    14191439    return hdr; 
    14201440} 
  • pjproject/trunk/pjsip/src/pjsip/sip_parser.c

    • Property svn:eol-style set to native
    r64 r65  
    114114                                   pjsip_parser_err_report *err_list); 
    115115static void         int_parse_param( pj_scanner *scanner,  
     116                                     pj_pool_t *pool, 
    116117                                     pj_str_t *pname,  
    117118                                     pj_str_t *pvalue); 
    118119static void         int_parse_hparam( pj_scanner *scanner, 
     120                                      pj_pool_t *pool, 
    119121                                      pj_str_t *hname, 
    120122                                      pj_str_t *hvalue ); 
     
    126128                                           pjsip_status_line *line); 
    127129static void         int_parse_user_pass( pj_scanner *scanner,  
     130                                         pj_pool_t *pool, 
    128131                                         pj_str_t *user,  
    129132                                         pj_str_t *pass); 
     
    287290    status = pj_cis_dup(&pjsip_USER_SPEC, &pjsip_ALNUM_SPEC); 
    288291    PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 
    289     pj_cis_add_str( &pjsip_USER_SPEC, ESCAPED USER_UNRESERVED ); 
     292    pj_cis_add_str( &pjsip_USER_SPEC, UNRESERVED ESCAPED USER_UNRESERVED ); 
    290293 
    291294    status = pj_cis_dup(&pjsip_PASSWD_SPEC, &pjsip_ALNUM_SPEC); 
    292295    PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 
    293     pj_cis_add_str( &pjsip_PASSWD_SPEC, MARK ESCAPED PASS); 
     296    pj_cis_add_str( &pjsip_PASSWD_SPEC, UNRESERVED ESCAPED PASS); 
    294297 
    295298    status = pj_cis_init(&cis_buf, &pjsip_PROBE_USER_HOST_SPEC); 
     
    866869 
    867870/* Parse parameter (pname ["=" pvalue]). */ 
    868 void pjsip_parse_param_imp(  pj_scanner *scanner, 
     871void pjsip_parse_param_imp(  pj_scanner *scanner, pj_pool_t *pool, 
    869872                             pj_str_t *pname, pj_str_t *pvalue, 
    870873                             unsigned option) 
     
    872875    /* pname */ 
    873876    pj_scan_get(scanner, &pjsip_PARAM_CHAR_SPEC, pname); 
    874     pj_str_unescape(pname); 
     877    *pname = pj_str_unescape(pool, pname); 
    875878 
    876879    /* pvalue, if any */ 
     
    886889        } else { 
    887890            pj_scan_get(scanner, &pjsip_PARAM_CHAR_SPEC, pvalue); 
    888             pj_str_unescape(pvalue); 
     891            *pvalue = pj_str_unescape(pool, pvalue); 
    889892        } 
    890893    } else { 
     
    895898 
    896899/* Parse parameter (";" pname ["=" pvalue]). */ 
    897 static void int_parse_param( pj_scanner *scanner, 
     900static void int_parse_param( pj_scanner *scanner, pj_pool_t *pool, 
    898901                             pj_str_t *pname, pj_str_t *pvalue) 
    899902{ 
     
    902905 
    903906    /* Get pname and optionally pvalue */ 
    904     pjsip_parse_param_imp(scanner, pname, pvalue, 0); 
     907    pjsip_parse_param_imp(scanner, pool, pname, pvalue,  
     908                          PJSIP_PARSE_REMOVE_QUOTE); 
    905909} 
    906910 
    907911/* Parse header parameter. */ 
    908 static void int_parse_hparam( pj_scanner *scanner, 
     912static void int_parse_hparam( pj_scanner *scanner, pj_pool_t *pool, 
    909913                              pj_str_t *hname, pj_str_t *hvalue ) 
    910914{ 
     
    914918    /* hname */ 
    915919    pj_scan_get(scanner, &pjsip_HDR_CHAR_SPEC, hname); 
    916     pj_str_unescape(hname); 
     920    *hname = pj_str_unescape(pool, hname); 
    917921 
    918922    /* pvalue, if any */ 
     
    920924        pj_scan_get_char(scanner); 
    921925        pj_scan_get(scanner, &pjsip_HDR_CHAR_SPEC, hvalue); 
    922         pj_str_unescape(hvalue); 
     926        *hvalue = pj_str_unescape(pool, hvalue); 
    923927    } else { 
    924928        hvalue->ptr = NULL; 
     
    937941        pj_scan_get_char(scanner); 
    938942        pj_scan_get(scanner, &pjsip_DIGIT_SPEC, &port); 
    939         pj_str_unescape(&port); 
    940943        *p_port = pj_strtoul(&port); 
    941944    } else { 
     
    962965 
    963966/* Parse user:pass tokens in an URI. */ 
    964 static void int_parse_user_pass( pj_scanner *scanner,  
     967static void int_parse_user_pass( pj_scanner *scanner, pj_pool_t *pool, 
    965968                                 pj_str_t *user, pj_str_t *pass) 
    966969{ 
    967970    pj_scan_get( scanner, &pjsip_USER_SPEC, user); 
    968     pj_str_unescape(user); 
     971    *user = pj_str_unescape(pool, user); 
    969972 
    970973    if ( *scanner->curptr == ':') { 
    971974        pj_scan_get_char( scanner ); 
    972975        pj_scan_get( scanner, &pjsip_PASSWD_SPEC, pass); 
    973         pj_str_unescape(pass); 
     976        *pass = pj_str_unescape(pool, pass); 
    974977    } else { 
    975978        pass->ptr = NULL; 
     
    11051108 
    11061109    if (int_is_next_user(scanner)) { 
    1107         int_parse_user_pass(scanner, &url->user, &url->passwd); 
     1110        int_parse_user_pass(scanner, pool, &url->user, &url->passwd); 
    11081111    } 
    11091112 
     
    11151118        pj_str_t pname, pvalue; 
    11161119 
    1117         int_parse_param( scanner, &pname, &pvalue); 
     1120        int_parse_param( scanner, pool, &pname, &pvalue); 
    11181121 
    11191122        if (!parser_stricmp(pname, pjsip_USER_STR) && pvalue.slen) { 
     
    11471150        pjsip_param *param; 
    11481151        param = pj_pool_alloc(pool, sizeof(pjsip_param)); 
    1149         int_parse_hparam(scanner, &param->name, &param->value); 
     1152        int_parse_hparam(scanner, pool, &param->name, &param->value); 
    11501153        pj_list_insert_before(&url->header_param, param); 
    11511154        hsep = '&'; 
     
    11681171    if (*scanner->curptr == '"') { 
    11691172        pj_scan_get_quote( scanner, '"', '"', &name_addr->display); 
     1173        /* Trim the leading and ending quote */ 
     1174        name_addr->display.ptr++; 
     1175        name_addr->display.slen -= 2; 
    11701176 
    11711177    } else if (*scanner->curptr != '<') { 
     
    13241330        pj_str_t pname, pvalue; 
    13251331 
    1326         int_parse_param( scanner, &pname, &pvalue); 
     1332        int_parse_param( scanner, pool, &pname, &pvalue); 
    13271333        if (!parser_stricmp(pname, pjsip_Q_STR) && pvalue.slen) { 
    13281334            char *dot_pos = memchr(pvalue.ptr, '.', pvalue.slen); 
     
    13381344 
    13391345        } else { 
    1340             concat_param(&hdr->other_param, pool, &pname, &pvalue); 
     1346            pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param)); 
     1347            p->name = pname; 
     1348            p->value = pvalue; 
     1349            pj_list_insert_before(&hdr->other_param, p); 
    13411350        } 
    13421351    } 
     
    14131422    while (*scanner->curptr == ';') { 
    14141423        pj_str_t pname, pvalue; 
    1415         int_parse_param(scanner, &pname, &pvalue); 
     1424        int_parse_param(scanner, ctx->pool, &pname, &pvalue); 
    14161425        concat_param(&hdr->media.param, ctx->pool, &pname, &pvalue); 
    14171426    } 
     
    14661475        pj_str_t pname, pvalue; 
    14671476 
    1468         int_parse_param( scanner, &pname, &pvalue); 
     1477        int_parse_param( scanner, pool, &pname, &pvalue); 
    14691478 
    14701479        if (!parser_stricmp(pname, pjsip_TAG_STR)) { 
     
    14721481             
    14731482        } else { 
    1474             concat_param(&hdr->other_param, pool, &pname, &pvalue); 
     1483            pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param)); 
     1484            p->name = pname; 
     1485            p->value = pvalue; 
     1486            pj_list_insert_before(&hdr->other_param, p); 
    14751487        } 
    14761488    } 
     
    15471559        pj_str_t pname, pvalue; 
    15481560 
    1549         int_parse_param( scanner, &pname, &pvalue); 
     1561        int_parse_param( scanner, pool, &pname, &pvalue); 
    15501562 
    15511563        if (!parser_stricmp(pname, pjsip_BRANCH_STR) && pvalue.slen) { 
     
    15671579                hdr->rport_param = 0; 
    15681580        } else { 
    1569             concat_param( &hdr->other_param, pool, &pname, &pvalue); 
    1570         } 
    1571     } 
    1572  
     1581            pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param)); 
     1582            p->name = pname; 
     1583            p->value = pvalue; 
     1584            pj_list_insert_before(&hdr->other_param, p); 
     1585        } 
     1586    } 
    15731587} 
    15741588 
     
    16031617 
    16041618    pj_memcpy(&hdr->name_addr, temp, sizeof(*temp)); 
    1605     if (*scanner->curptr == ';') { 
    1606         pj_scan_get_until(scanner, &pjsip_NEWLINE_OR_EOF_SPEC,  
    1607                           &hdr->other_param); 
     1619 
     1620    while (*scanner->curptr == ';') { 
     1621        pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param)); 
     1622        int_parse_param(scanner, pool, &p->name, &p->value); 
     1623        pj_list_insert_before(&hdr->other_param, p); 
    16081624    } 
    16091625} 
  • pjproject/trunk/pjsip/src/pjsip/sip_resolve.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip/sip_transaction.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip/sip_transport.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsip/sip_uri.c

    • Property svn:eol-style set to native
    r64 r65  
    6969} 
    7070 
     71 
     72PJ_DEF(void) pjsip_param_shallow_clone( pj_pool_t *pool,  
     73                                        pjsip_param *dst_list, 
     74                                        const pjsip_param *src_list) 
     75{ 
     76    const pjsip_param *p = src_list->next; 
     77 
     78    pj_list_init(dst_list); 
     79    while (p != src_list) { 
     80        pjsip_param *new_param = pj_pool_alloc(pool, sizeof(pjsip_param)); 
     81        new_param->name = p->name; 
     82        new_param->value = p->value; 
     83        pj_list_insert_before(dst_list, new_param); 
     84        p = p->next; 
     85    } 
     86} 
     87 
     88PJ_DEF(pj_ssize_t) pjsip_param_print_on( const pjsip_param *param_list, 
     89                                         char *buf, pj_size_t size, 
     90                                         int sep) 
     91{ 
     92    const pjsip_param *p = param_list->next; 
     93    char *startbuf = buf; 
     94    char *endbuf = buf + size; 
     95 
     96    while (p != param_list) { 
     97        *buf++ = (char)sep; 
     98        copy_advance_escape(buf, p->name, pjsip_PARAM_CHAR_SPEC); 
     99        if (p->value.slen) { 
     100            *buf++ = '='; 
     101            copy_advance_escape(buf, p->value, pjsip_PARAM_CHAR_SPEC); 
     102        } 
     103        p = p->next; 
     104    } 
     105    return buf-startbuf; 
     106} 
     107 
     108 
    71109/* 
    72110 * URI stuffs 
     
    255293 
    256294    /* Other param. */ 
    257     param = url->other_param.next; 
    258     while (param != &url->other_param) { 
    259         *buf++ = ';'; 
    260         copy_advance_escape(buf, param->name, pjsip_PARAM_CHAR_SPEC); 
    261         if (param->value.slen) { 
    262             *buf++ = '='; 
    263             copy_advance_escape(buf, param->value, pjsip_PARAM_CHAR_SPEC); 
    264         } 
    265         param = param->next; 
    266     } 
     295    printed = pjsip_param_print_on(&url->other_param, buf, endbuf-buf, ';'); 
     296    if (printed < 0) 
     297        return -1; 
     298    buf += printed; 
    267299 
    268300    /* Header param. */ 
     
    473505 
    474506    if (context != PJSIP_URI_IN_REQ_URI) { 
    475         copy_advance(buf, name->display); 
    476507        if (name->display.slen) { 
     508            if (endbuf-buf < 8) return -1; 
     509            *buf++ = '"'; 
     510            copy_advance(buf, name->display); 
     511            *buf++ = '"'; 
    477512            *buf++ = ' '; 
    478513        } 
  • pjproject/trunk/pjsip/src/pjsip/sip_util.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsua/getopt.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsua/getopt.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsua/main.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/pjsua/misc.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/test-pjsip/main.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/test-pjsip/msg.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/test-pjsip/test.c

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/test-pjsip/test.h

    • Property svn:eol-style set to native
  • pjproject/trunk/pjsip/src/test-pjsip/uri.c

    • Property svn:eol-style set to native
    r64 r65  
    2626                    "0123456789" 
    2727#define MARK        "-_.!~*'()" 
    28 #define USER        "&=+$,;?/%" 
    29 #define PASS        "&=+$,%" 
    30 #define PARAM_CHAR  "[]/:&+$" MARK "%" 
    31  
    32 #define POOL_SIZE       4096 
    33  
    34 static pj_uint32_t parse_len, parse_time, print_time; 
     28#define USER_CHAR   ALPHANUM MARK "&=+$,;?/" 
     29#define PASS_CHAR   ALPHANUM MARK "&=+$," 
     30#define PARAM_CHAR  ALPHANUM MARK "[]/:&+$" 
     31 
     32#define POOL_SIZE       4000 
     33#define LOOP_COUNT      1000 
     34#define AVERAGE_URL_LEN 80 
     35#define THREAD_COUNT    4 
     36 
     37static pj_uint32_t parse_len; 
     38static pj_timestamp parse_time, print_time; 
    3539 
    3640 
    3741/* URI creator functions. */ 
     42static pjsip_uri *create_uri0( pj_pool_t *pool ); 
    3843static pjsip_uri *create_uri1( pj_pool_t *pool ); 
    3944static pjsip_uri *create_uri2( pj_pool_t *pool ); 
     
    5358static pjsip_uri *create_uri16( pj_pool_t *pool ); 
    5459static pjsip_uri *create_uri17( pj_pool_t *pool ); 
    55 static pjsip_uri *create_uri18( pj_pool_t *pool ); 
    56 static pjsip_uri *create_uri19( pj_pool_t *pool ); 
    5760static pjsip_uri *create_dummy( pj_pool_t *pool ); 
    5861 
     
    7174        PJ_SUCCESS, 
    7275        "sip:localhost", 
     76        &create_uri0 
     77    }, 
     78    { 
     79        PJ_SUCCESS, 
     80        "sip:user@localhost", 
    7381        &create_uri1 
    7482    }, 
    7583    { 
    7684        PJ_SUCCESS, 
    77         "sip:user@localhost", 
    78         &create_uri2 
    79     }, 
    80     { 
    81         PJ_SUCCESS, 
    8285        "sip:user:password@localhost:5060", 
    83         &create_uri3, 
     86        &create_uri2, 
    8487    }, 
    8588    { 
     
    8790        ERR_NOT_EQUAL, 
    8891        "sip:localhost:5060", 
     92        &create_uri3 
     93    }, 
     94    { 
     95        /* All recognized parameters. */ 
     96        PJ_SUCCESS, 
     97        "sip:localhost;transport=tcp;user=ip;ttl=255;lr;maddr=127.0.0.1;method=ACK", 
    8998        &create_uri4 
    90     }, 
    91     { 
    92         /* All recognized parameters. */ 
    93         PJ_SUCCESS, 
    94         "sip:localhost;transport=tcp;user=ip;ttl=255;lr;maddr=127.0.0.1;method=ACK", 
    95         &create_uri5 
    9699    }, 
    97100    { 
     
    100103        "sip:localhost;pickup=hurry;user=phone;message=I%20am%20sorry" 
    101104        "?Subject=Hello%20There&Server=SIP%20Server", 
    102         &create_uri6 
     105        &create_uri5 
    103106    }, 
    104107    { 
     
    106109        PJ_SUCCESS, 
    107110        "sips:localhost", 
    108         &create_uri7, 
     111        &create_uri6, 
    109112    }, 
    110113    { 
     
    112115        PJ_SUCCESS, 
    113116        "<sip:localhost>", 
    114         &create_uri8 
     117        &create_uri7 
    115118    }, 
    116119    { 
     
    120123        PJ_SUCCESS, 
    121124        "  Power Administrator  <sips:localhost>", 
     125        &create_uri8 
     126    }, 
     127    { 
     128        /* Name address. */ 
     129        PJ_SUCCESS, 
     130        " \"User\" <sip:user@localhost:5071>", 
    122131        &create_uri9 
    123132    }, 
    124133    { 
    125         /* Name address. */ 
    126         PJ_SUCCESS, 
    127         " \"User\" <sip:user@localhost:5071>", 
    128         &create_uri10 
    129     }, 
    130     { 
    131134        /* Escaped sequence in display name (display=Strange User\"\\\"). */ 
    132135        PJ_SUCCESS, 
    133136        " \"Strange User\\\"\\\\\\\"\" <sip:localhost>", 
     137        &create_uri10, 
     138    }, 
     139    { 
     140        /* Errorneous escaping in display name. */ 
     141        ERR_SYNTAX_ERR, 
     142        " \"Rogue User\\\" <sip:localhost>", 
    134143        &create_uri11, 
    135144    }, 
    136145    { 
    137         /* Errorneous escaping in display name. */ 
    138         ERR_SYNTAX_ERR, 
    139         " \"Rogue User\\\" <sip:localhost>", 
     146        /* Dangling quote in display name, but that should be OK. */ 
     147        PJ_SUCCESS, 
     148        "Strange User\" <sip:localhost>", 
    140149        &create_uri12, 
    141150    }, 
    142151    { 
    143         /* Dangling quote in display name, but that should be OK. */ 
    144         PJ_SUCCESS, 
    145         "Strange User\" <sip:localhost>", 
     152        /* Special characters in parameter value must be quoted. */ 
     153        PJ_SUCCESS, 
     154        "sip:localhost;pvalue=\"hello world\"", 
    146155        &create_uri13, 
    147     }, 
    148     { 
    149         /* Special characters in parameter value must be quoted. */ 
    150         PJ_SUCCESS, 
    151         "sip:localhost;pvalue=\"hello world\"", 
    152         &create_uri14, 
    153156    }, 
    154157    { 
     
    157160         */ 
    158161        PJ_SUCCESS, 
    159         "This is -. !% *_+`'~ me <sip:a19A&=+$,;?/%2c:%09a&Zz=+$,@" 
     162        "This is -. !% *_+`'~ me <sip:a19A&=+$,;?/%2c:%40a&Zz=+$,@" 
    160163        "my_proxy09.MY-domain.com:9801>", 
     164        &create_uri14, 
     165    }, 
     166    { 
     167        /* Another excercise to the allowed character sets to the hostname. */ 
     168        PJ_SUCCESS, 
     169        "sip:" ALPHANUM "-_.com", 
    161170        &create_uri15, 
    162     }, 
    163     { 
    164         /* Another excercise to the allowed character sets to the hostname. */ 
    165         PJ_SUCCESS, 
    166         "sip:" ALPHANUM "-_.com", 
    167         &create_uri16, 
    168171    }, 
    169172    { 
     
    172175         */ 
    173176        PJ_SUCCESS, 
    174         "sip:" ALPHANUM USER ":" ALPHANUM PASS "@host", 
    175         &create_uri17, 
     177        "sip:" USER_CHAR ":" PASS_CHAR "@host", 
     178        &create_uri16, 
    176179    }, 
    177180    { 
     
    180183         */ 
    181184        PJ_SUCCESS, 
    182         "sip:host;user=ip;" ALPHANUM PARAM_CHAR "=" ALPHANUM PARAM_CHAR  
     185        "sip:host;user=ip;" PARAM_CHAR "%21=" PARAM_CHAR "%21" 
    183186        ";lr;other=1;transport=sctp;other2", 
    184         &create_uri18, 
    185     }, 
    186     { 
    187         /* This should trigger syntax error. */ 
     187        &create_uri17, 
     188    }, 
     189    { 
     190        /* 18: This should trigger syntax error. */ 
    188191        ERR_SYNTAX_ERR, 
    189192        "sip:", 
     
    191194    }, 
    192195    { 
    193         /* Syntax error: whitespace after scheme. */ 
     196        /* 19: Syntax error: whitespace after scheme. */ 
    194197        ERR_SYNTAX_ERR, 
    195198        "sip :host", 
     
    197200    }, 
    198201    { 
    199         /* Syntax error: whitespace before hostname. */ 
     202        /* 20: Syntax error: whitespace before hostname. */ 
    200203        ERR_SYNTAX_ERR, 
    201204        "sip: host", 
     
    203206    }, 
    204207    { 
    205         /* Syntax error: invalid port. */ 
     208        /* 21: Syntax error: invalid port. */ 
    206209        ERR_SYNTAX_ERR, 
    207210        "sip:user:password", 
     
    209212    }, 
    210213    { 
    211         /* Syntax error: no host. */ 
     214        /* 22: Syntax error: no host. */ 
    212215        ERR_SYNTAX_ERR, 
    213216        "sip:user@", 
     
    215218    }, 
    216219    { 
    217         /* Syntax error: no user/host. */ 
     220        /* 23: Syntax error: no user/host. */ 
    218221        ERR_SYNTAX_ERR, 
    219222        "sip:@", 
     
    221224    }, 
    222225    { 
    223         /* Syntax error: empty string. */ 
     226        /* 24: Syntax error: empty string. */ 
    224227        ERR_SYNTAX_ERR, 
    225228        "", 
     
    228231}; 
    229232 
    230 static pjsip_uri *create_uri1(pj_pool_t *pool) 
     233static pjsip_uri *create_uri0(pj_pool_t *pool) 
    231234{ 
    232235    /* "sip:localhost" */ 
     
    237240} 
    238241 
    239 static pjsip_uri *create_uri2(pj_pool_t *pool) 
     242static pjsip_uri *create_uri1(pj_pool_t *pool) 
    240243{ 
    241244    /* "sip:user@localhost" */ 
     
    248251} 
    249252 
    250 static pjsip_uri *create_uri3(pj_pool_t *pool) 
     253static pjsip_uri *create_uri2(pj_pool_t *pool) 
    251254{ 
    252255    /* "sip:user:password@localhost:5060" */ 
     
    261264} 
    262265 
    263 static pjsip_uri *create_uri4(pj_pool_t *pool) 
     266static pjsip_uri *create_uri3(pj_pool_t *pool) 
    264267{ 
    265268    /* Like: "sip:localhost:5060", but without the port. */ 
     
    270273} 
    271274 
    272 static pjsip_uri *create_uri5(pj_pool_t *pool) 
     275static pjsip_uri *create_uri4(pj_pool_t *pool) 
    273276{ 
    274277    /* "sip:localhost;transport=tcp;user=ip;ttl=255;lr;maddr=127.0.0.1;method=ACK" */ 
     
    286289} 
    287290 
    288 static pjsip_uri *create_uri6(pj_pool_t *pool) 
     291#define param_add(list,pname,pvalue)  \ 
     292        do { \ 
     293            pjsip_param *param; \ 
     294            param=pj_pool_alloc(pool, sizeof(pjsip_param)); \ 
     295            param->name = pj_str(pname); \ 
     296            param->value = pj_str(pvalue); \ 
     297            pj_list_insert_before(&list, param); \ 
     298        } while (0) 
     299 
     300static pjsip_uri *create_uri5(pj_pool_t *pool) 
    289301{ 
    290302    /* "sip:localhost;pickup=hurry;user=phone;message=I%20am%20sorry" 
     
    295307    pj_strdup2(pool, &url->host, "localhost"); 
    296308    pj_strdup2(pool, &url->user_param, "phone"); 
    297     pj_strdup2(pool, &url->other_param, ";pickup=hurry;message=I%20am%20sorry"); 
    298     pj_strdup2(pool, &url->header_param, "?Subject=Hello%20There&Server=SIP%20Server"); 
    299     return (pjsip_uri*)url; 
    300  
    301 } 
    302  
    303 static pjsip_uri *create_uri7(pj_pool_t *pool) 
     309 
     310    //pj_strdup2(pool, &url->other_param, ";pickup=hurry;message=I%20am%20sorry"); 
     311    param_add(url->other_param, "pickup", "hurry"); 
     312    param_add(url->other_param, "message", "I am sorry"); 
     313 
     314    //pj_strdup2(pool, &url->header_param, "?Subject=Hello%20There&Server=SIP%20Server"); 
     315    param_add(url->header_param, "Subject", "Hello There"); 
     316    param_add(url->header_param, "Server", "SIP Server"); 
     317    return (pjsip_uri*)url; 
     318 
     319} 
     320 
     321static pjsip_uri *create_uri6(pj_pool_t *pool) 
    304322{ 
    305323    /* "sips:localhost" */ 
     
    310328} 
    311329 
    312 static pjsip_uri *create_uri8(pj_pool_t *pool) 
     330static pjsip_uri *create_uri7(pj_pool_t *pool) 
    313331{ 
    314332    /* "<sip:localhost>" */ 
     
    323341} 
    324342 
    325 static pjsip_uri *create_uri9(pj_pool_t *pool) 
     343static pjsip_uri *create_uri8(pj_pool_t *pool) 
    326344{ 
    327345    /* "  Power Administrator <sips:localhost>" */ 
     
    337355} 
    338356 
    339 static pjsip_uri *create_uri10(pj_pool_t *pool) 
     357static pjsip_uri *create_uri9(pj_pool_t *pool) 
    340358{ 
    341359    /* " \"User\" <sip:user@localhost:5071>" */ 
     
    346364    name_addr->uri = (pjsip_uri*) url; 
    347365 
    348     pj_strdup2(pool, &name_addr->display, "\"User\""); 
     366    pj_strdup2(pool, &name_addr->display, "User"); 
    349367    pj_strdup2(pool, &url->user, "user"); 
    350368    pj_strdup2(pool, &url->host, "localhost"); 
     
    353371} 
    354372 
    355 static pjsip_uri *create_uri11(pj_pool_t *pool) 
     373static pjsip_uri *create_uri10(pj_pool_t *pool) 
    356374{ 
    357375    /* " \"Strange User\\\"\\\\\\\"\" <sip:localhost>" */ 
     
    362380    name_addr->uri = (pjsip_uri*) url; 
    363381 
    364     pj_strdup2(pool, &name_addr->display, "\"Strange User\\\"\\\\\\\"\""); 
     382    pj_strdup2(pool, &name_addr->display, "Strange User\\\"\\\\\\\""); 
    365383    pj_strdup2(pool, &url->host, "localhost"); 
    366384    return (pjsip_uri*)name_addr; 
    367385} 
    368386 
    369 static pjsip_uri *create_uri12(pj_pool_t *pool) 
     387static pjsip_uri *create_uri11(pj_pool_t *pool) 
    370388{ 
    371389    /* " \"Rogue User\\\" <sip:localhost>" */ 
     
    376394    name_addr->uri = (pjsip_uri*) url; 
    377395 
    378     pj_strdup2(pool, &name_addr->display, "\"Rogue User\\\""); 
     396    pj_strdup2(pool, &name_addr->display, "Rogue User\\"); 
    379397    pj_strdup2(pool, &url->host, "localhost"); 
    380398    return (pjsip_uri*)name_addr; 
    381399} 
    382400 
    383 static pjsip_uri *create_uri13(pj_pool_t *pool) 
     401static pjsip_uri *create_uri12(pj_pool_t *pool) 
    384402{ 
    385403    /* "Strange User\" <sip:localhost>" */ 
     
    395413} 
    396414 
     415static pjsip_uri *create_uri13(pj_pool_t *pool) 
     416{ 
     417    /* "sip:localhost;pvalue=\"hello world\"" */ 
     418    pjsip_url *url; 
     419    url = pjsip_url_create(pool, 0); 
     420    pj_strdup2(pool, &url->host, "localhost"); 
     421    //pj_strdup2(pool, &url->other_param, ";pvalue=\"hello world\""); 
     422    param_add(url->other_param, "pvalue", "hello world"); 
     423    return (pjsip_uri*)url; 
     424} 
     425 
    397426static pjsip_uri *create_uri14(pj_pool_t *pool) 
    398427{ 
    399     /* "sip:localhost;pvalue=\"hello world\"" */ 
    400     pjsip_url *url; 
    401     url = pjsip_url_create(pool, 0); 
    402     pj_strdup2(pool, &url->host, "localhost"); 
    403     pj_strdup2(pool, &url->other_param, ";pvalue=\"hello world\""); 
    404     return (pjsip_uri*)url; 
    405 } 
    406  
    407 static pjsip_uri *create_uri15(pj_pool_t *pool) 
    408 { 
    409     /* "This is -. !% *_+`'~ me <sip:a19A&=+$,;?/%2c:%09a&Zz=+$,@my_proxy09.my-domain.com:9801>" */ 
     428    /* "This is -. !% *_+`'~ me <sip:a19A&=+$,;?/%2c:%40a&Zz=+$,@my_proxy09.my-domain.com:9801>" */ 
    410429    pjsip_name_addr *name_addr = pjsip_name_addr_create(pool); 
    411430    pjsip_url *url; 
     
    415434 
    416435    pj_strdup2(pool, &name_addr->display, "This is -. !% *_+`'~ me"); 
    417     pj_strdup2(pool, &url->user, "a19A&=+$,;?/%2c"); 
    418     pj_strdup2(pool, &url->passwd, "%09a&Zz=+$,"); 
     436    pj_strdup2(pool, &url->user, "a19A&=+$,;?/,"); 
     437    pj_strdup2(pool, &url->passwd, "@a&Zz=+$,"); 
    419438    pj_strdup2(pool, &url->host, "my_proxy09.MY-domain.com"); 
    420439    url->port = 9801; 
     
    422441} 
    423442 
     443static pjsip_uri *create_uri15(pj_pool_t *pool) 
     444{ 
     445    /* "sip:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.com" */ 
     446    pjsip_url *url; 
     447    url = pjsip_url_create(pool, 0); 
     448    pj_strdup2(pool, &url->host, ALPHANUM "-_.com"); 
     449    return (pjsip_uri*)url; 
     450} 
     451 
    424452static pjsip_uri *create_uri16(pj_pool_t *pool) 
    425453{ 
    426     /* "sip:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.com" */ 
    427     pjsip_url *url; 
    428     url = pjsip_url_create(pool, 0); 
    429     pj_strdup2(pool, &url->host, ALPHANUM "-_.com"); 
     454    /* "sip:" USER_CHAR ":" PASS_CHAR "@host" */ 
     455    pjsip_url *url; 
     456    url = pjsip_url_create(pool, 0); 
     457    pj_strdup2(pool, &url->user, USER_CHAR); 
     458    pj_strdup2(pool, &url->passwd, PASS_CHAR); 
     459    pj_strdup2(pool, &url->host, "host"); 
    430460    return (pjsip_uri*)url; 
    431461} 
     
    433463static pjsip_uri *create_uri17(pj_pool_t *pool) 
    434464{ 
    435     /* "sip:" ALPHANUM USER ":" ALPHANUM PASS "@host" */ 
    436     pjsip_url *url; 
    437     url = pjsip_url_create(pool, 0); 
    438     pj_strdup2(pool, &url->user, ALPHANUM USER); 
    439     pj_strdup2(pool, &url->passwd, ALPHANUM PASS); 
    440     pj_strdup2(pool, &url->host, "host"); 
    441     return (pjsip_uri*)url; 
    442 } 
    443  
    444 static pjsip_uri *create_uri18(pj_pool_t *pool) 
    445 { 
    446     /* "sip:host;user=ip;" ALPHANUM PARAM_CHAR "=" ALPHANUM PARAM_CHAR ";lr;other=1;transport=sctp;other2" */ 
     465    /* "sip:host;user=ip;" PARAM_CHAR "%21=" PARAM_CHAR "%21;lr;other=1;transport=sctp;other2" */ 
    447466    pjsip_url *url; 
    448467    url = pjsip_url_create(pool, 0); 
     
    450469    pj_strdup2(pool, &url->user_param, "ip"); 
    451470    pj_strdup2(pool, &url->transport_param, "sctp"); 
    452     pj_strdup2(pool, &url->other_param, ";" ALPHANUM PARAM_CHAR "=" ALPHANUM PARAM_CHAR ";other=1;other2");     
     471    param_add(url->other_param, PARAM_CHAR "!", PARAM_CHAR "!"); 
     472    param_add(url->other_param, "other", "1"); 
     473    param_add(url->other_param, "other2", ""); 
    453474    url->lr_param = 1; 
    454475    return (pjsip_uri*)url; 
     
    485506         */ 
    486507        status = entry->status==ERR_SYNTAX_ERR ? PJ_SUCCESS : -10; 
     508        if (status != 0) { 
     509            PJ_LOG(3,("", "   uri parse error!\n" 
     510                          "   uri='%s'\n", 
     511                          entry->str)); 
     512        } 
    487513        goto on_return; 
    488514    } 
    489515    pj_get_timestamp(&t2); 
    490     parse_time += t2.u32.lo - t1.u32.lo; 
     516    pj_sub_timestamp(&t2, &t1); 
     517    pj_add_timestamp(&parse_time, &t2); 
    491518 
    492519    /* Create the reference URI. */ 
     
    503530        goto on_return; 
    504531    } 
     532    s1.ptr[len] = '\0'; 
    505533    s1.slen = len; 
     534 
     535    pj_get_timestamp(&t2); 
     536    pj_sub_timestamp(&t2, &t1); 
     537    pj_add_timestamp(&print_time, &t2); 
    506538 
    507539    len = pjsip_uri_print( PJSIP_URI_IN_OTHER, ref_uri, s2.ptr, PJSIP_MAX_URL_SIZE); 
     
    510542        goto on_return; 
    511543    } 
     544    s2.ptr[len] = '\0'; 
    512545    s2.slen = len; 
    513     pj_get_timestamp(&t2); 
    514     print_time += t2.u32.lo - t1.u32.lo; 
    515546 
    516547    /* Full comparison of parsed URI with reference URI. */ 
    517     if (pjsip_uri_cmp(PJSIP_URI_IN_OTHER, parsed_uri, ref_uri) != 0) { 
     548    status = pjsip_uri_cmp(PJSIP_URI_IN_OTHER, parsed_uri, ref_uri); 
     549    if (status != 0) { 
    518550        /* Not equal. See if this is the expected status. */ 
    519551        status = entry->status==ERR_NOT_EQUAL ? PJ_SUCCESS : -40; 
     552        if (status != 0) { 
     553            PJ_LOG(3,("", "   uri comparison mismatch, status=%d:\n" 
     554                          "    uri1='%s'\n" 
     555                          "    uri2='%s'", 
     556                          status, s1.ptr, s2.ptr)); 
     557        } 
    520558        goto on_return; 
    521559 
     
    540578pj_status_t uri_test() 
    541579{ 
    542     unsigned i; 
     580    unsigned i, loop; 
    543581    pj_pool_t *pool; 
    544582    pj_status_t status; 
    545  
    546     pool = pjsip_endpt_create_pool(endpt, "", 4000, 4000); 
    547  
     583    pj_timestamp zero; 
     584    pj_highprec_t avg_parse, avg_print; 
     585 
     586    zero.u32.hi = zero.u32.lo = 0; 
     587 
     588    PJ_LOG(3,("", "  simple test")); 
     589    pool = pjsip_endpt_create_pool(endpt, "", POOL_SIZE, POOL_SIZE); 
    548590    for (i=0; i<PJ_ARRAY_SIZE(uri_test_array); ++i) { 
    549591        status = do_uri_test(pool, &uri_test_array[i]); 
     
    551593            PJ_LOG(3,("uri_test", "  error %d when testing entry %d", 
    552594                      status, i)); 
    553             break; 
     595            goto on_return; 
    554596        } 
    555597    } 
    556  
     598    pjsip_endpt_destroy_pool(endpt, pool); 
     599 
     600    PJ_LOG(3,("", "  benchmarking...")); 
     601    parse_len = 0; 
     602    parse_time.u32.hi = parse_time.u32.lo = 0; 
     603    print_time.u32.hi = print_time.u32.lo = 0; 
     604    pool = pjsip_endpt_create_pool(endpt, "", POOL_SIZE, POOL_SIZE); 
     605    for (loop=0; loop<LOOP_COUNT; ++loop) { 
     606        for (i=0; i<PJ_ARRAY_SIZE(uri_test_array); ++i) { 
     607            status = do_uri_test(pool, &uri_test_array[i]); 
     608            if (status != PJ_SUCCESS) { 
     609                PJ_LOG(3,("uri_test", "  error %d when testing entry %d", 
     610                          status, i)); 
     611                goto on_return; 
     612            } 
     613        } 
     614    } 
     615 
     616    avg_parse = pj_elapsed_usec(&zero, &parse_time); 
     617    pj_highprec_mul(avg_parse, AVERAGE_URL_LEN); 
     618    pj_highprec_div(avg_parse, parse_len); 
     619    avg_parse = 1000000 / avg_parse; 
     620 
     621    avg_print = pj_elapsed_usec(&zero, &print_time); 
     622    pj_highprec_mul(avg_print, AVERAGE_URL_LEN); 
     623    pj_highprec_div(avg_print, parse_len); 
     624    avg_print = 1000000 / avg_print; 
     625 
     626    PJ_LOG(3,("", "   done. Average parse=%d url/sec, print=%d url/sec", 
     627                  (unsigned)avg_parse, (unsigned)avg_print)); 
     628 
     629    PJ_LOG(3,("", "  multithreaded test")); 
     630 
     631 
     632on_return: 
    557633    pjsip_endpt_destroy_pool(endpt, pool); 
    558634    return status; 
Note: See TracChangeset for help on using the changeset viewer.