Changeset 1282 for pjproject/trunk


Ignore:
Timestamp:
May 16, 2007 1:41:00 PM (18 years ago)
Author:
bennylp
Message:

Fixed ticet #277: GUID generation cannot generate more than 216 unique numbers (thanks Igor Sobinov)

Location:
pjproject/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/aconfigure

    r1279 r1282  
    33413341 
    33423342 
     3343echo "$as_me:$LINENO: checking for uuid_generate in -luuid" >&5 
     3344echo $ECHO_N "checking for uuid_generate in -luuid... $ECHO_C" >&6 
     3345if test "${ac_cv_lib_uuid_uuid_generate+set}" = set; then 
     3346  echo $ECHO_N "(cached) $ECHO_C" >&6 
     3347else 
     3348  ac_check_lib_save_LIBS=$LIBS 
     3349LIBS="-luuid  $LIBS" 
     3350cat >conftest.$ac_ext <<_ACEOF 
     3351/* confdefs.h.  */ 
     3352_ACEOF 
     3353cat confdefs.h >>conftest.$ac_ext 
     3354cat >>conftest.$ac_ext <<_ACEOF 
     3355/* end confdefs.h.  */ 
     3356 
     3357/* Override any gcc2 internal prototype to avoid an error.  */ 
     3358#ifdef __cplusplus 
     3359extern "C" 
     3360#endif 
     3361/* We use char because int might match the return type of a gcc2 
     3362   builtin and then its argument prototype would still apply.  */ 
     3363char uuid_generate (); 
     3364int 
     3365main () 
     3366{ 
     3367uuid_generate (); 
     3368  ; 
     3369  return 0; 
     3370} 
     3371_ACEOF 
     3372rm -f conftest.$ac_objext conftest$ac_exeext 
     3373if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 
     3374  (eval $ac_link) 2>conftest.er1 
     3375  ac_status=$? 
     3376  grep -v '^ *+' conftest.er1 >conftest.err 
     3377  rm -f conftest.er1 
     3378  cat conftest.err >&5 
     3379  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     3380  (exit $ac_status); } && 
     3381         { ac_try='test -z "$ac_c_werror_flag" 
     3382                         || test ! -s conftest.err' 
     3383  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     3384  (eval $ac_try) 2>&5 
     3385  ac_status=$? 
     3386  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     3387  (exit $ac_status); }; } && 
     3388         { ac_try='test -s conftest$ac_exeext' 
     3389  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     3390  (eval $ac_try) 2>&5 
     3391  ac_status=$? 
     3392  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     3393  (exit $ac_status); }; }; then 
     3394  ac_cv_lib_uuid_uuid_generate=yes 
     3395else 
     3396  echo "$as_me: failed program was:" >&5 
     3397sed 's/^/| /' conftest.$ac_ext >&5 
     3398 
     3399ac_cv_lib_uuid_uuid_generate=no 
     3400fi 
     3401rm -f conftest.err conftest.$ac_objext \ 
     3402      conftest$ac_exeext conftest.$ac_ext 
     3403LIBS=$ac_check_lib_save_LIBS 
     3404fi 
     3405echo "$as_me:$LINENO: result: $ac_cv_lib_uuid_uuid_generate" >&5 
     3406echo "${ECHO_T}$ac_cv_lib_uuid_uuid_generate" >&6 
     3407if test $ac_cv_lib_uuid_uuid_generate = yes; then 
     3408  cat >>confdefs.h <<_ACEOF 
     3409#define HAVE_LIBUUID 1 
     3410_ACEOF 
     3411 
     3412  LIBS="-luuid $LIBS" 
     3413 
     3414fi 
     3415 
     3416echo "$as_me:$LINENO: checking for uuid_generate in -luuid" >&5 
     3417echo $ECHO_N "checking for uuid_generate in -luuid... $ECHO_C" >&6 
     3418if test "${ac_cv_lib_uuid_uuid_generate+set}" = set; then 
     3419  echo $ECHO_N "(cached) $ECHO_C" >&6 
     3420else 
     3421  ac_check_lib_save_LIBS=$LIBS 
     3422LIBS="-luuid  $LIBS" 
     3423cat >conftest.$ac_ext <<_ACEOF 
     3424/* confdefs.h.  */ 
     3425_ACEOF 
     3426cat confdefs.h >>conftest.$ac_ext 
     3427cat >>conftest.$ac_ext <<_ACEOF 
     3428/* end confdefs.h.  */ 
     3429 
     3430/* Override any gcc2 internal prototype to avoid an error.  */ 
     3431#ifdef __cplusplus 
     3432extern "C" 
     3433#endif 
     3434/* We use char because int might match the return type of a gcc2 
     3435   builtin and then its argument prototype would still apply.  */ 
     3436char uuid_generate (); 
     3437int 
     3438main () 
     3439{ 
     3440uuid_generate (); 
     3441  ; 
     3442  return 0; 
     3443} 
     3444_ACEOF 
     3445rm -f conftest.$ac_objext conftest$ac_exeext 
     3446if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 
     3447  (eval $ac_link) 2>conftest.er1 
     3448  ac_status=$? 
     3449  grep -v '^ *+' conftest.er1 >conftest.err 
     3450  rm -f conftest.er1 
     3451  cat conftest.err >&5 
     3452  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     3453  (exit $ac_status); } && 
     3454         { ac_try='test -z "$ac_c_werror_flag" 
     3455                         || test ! -s conftest.err' 
     3456  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     3457  (eval $ac_try) 2>&5 
     3458  ac_status=$? 
     3459  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     3460  (exit $ac_status); }; } && 
     3461         { ac_try='test -s conftest$ac_exeext' 
     3462  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     3463  (eval $ac_try) 2>&5 
     3464  ac_status=$? 
     3465  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     3466  (exit $ac_status); }; }; then 
     3467  ac_cv_lib_uuid_uuid_generate=yes 
     3468else 
     3469  echo "$as_me: failed program was:" >&5 
     3470sed 's/^/| /' conftest.$ac_ext >&5 
     3471 
     3472ac_cv_lib_uuid_uuid_generate=no 
     3473fi 
     3474rm -f conftest.err conftest.$ac_objext \ 
     3475      conftest$ac_exeext conftest.$ac_ext 
     3476LIBS=$ac_check_lib_save_LIBS 
     3477fi 
     3478echo "$as_me:$LINENO: result: $ac_cv_lib_uuid_uuid_generate" >&5 
     3479echo "${ECHO_T}$ac_cv_lib_uuid_uuid_generate" >&6 
     3480if test $ac_cv_lib_uuid_uuid_generate = yes; then 
     3481  ac_has_uuid_lib=1 
     3482fi 
     3483 
     3484 
    33433485echo "$as_me:$LINENO: result: Setting PJ_M_NAME to $target_cpu" >&5 
    33443486echo "${ECHO_T}Setting PJ_M_NAME to $target_cpu" >&6 
     
    80148156 
    80158157 
     8158if test "${ac_cv_header_uuid_uuid_h+set}" = set; then 
     8159  echo "$as_me:$LINENO: checking for uuid/uuid.h" >&5 
     8160echo $ECHO_N "checking for uuid/uuid.h... $ECHO_C" >&6 
     8161if test "${ac_cv_header_uuid_uuid_h+set}" = set; then 
     8162  echo $ECHO_N "(cached) $ECHO_C" >&6 
     8163fi 
     8164echo "$as_me:$LINENO: result: $ac_cv_header_uuid_uuid_h" >&5 
     8165echo "${ECHO_T}$ac_cv_header_uuid_uuid_h" >&6 
     8166else 
     8167  # Is the header compilable? 
     8168echo "$as_me:$LINENO: checking uuid/uuid.h usability" >&5 
     8169echo $ECHO_N "checking uuid/uuid.h usability... $ECHO_C" >&6 
     8170cat >conftest.$ac_ext <<_ACEOF 
     8171/* confdefs.h.  */ 
     8172_ACEOF 
     8173cat confdefs.h >>conftest.$ac_ext 
     8174cat >>conftest.$ac_ext <<_ACEOF 
     8175/* end confdefs.h.  */ 
     8176$ac_includes_default 
     8177#include <uuid/uuid.h> 
     8178_ACEOF 
     8179rm -f conftest.$ac_objext 
     8180if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 
     8181  (eval $ac_compile) 2>conftest.er1 
     8182  ac_status=$? 
     8183  grep -v '^ *+' conftest.er1 >conftest.err 
     8184  rm -f conftest.er1 
     8185  cat conftest.err >&5 
     8186  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     8187  (exit $ac_status); } && 
     8188         { ac_try='test -z "$ac_c_werror_flag" 
     8189                         || test ! -s conftest.err' 
     8190  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     8191  (eval $ac_try) 2>&5 
     8192  ac_status=$? 
     8193  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     8194  (exit $ac_status); }; } && 
     8195         { ac_try='test -s conftest.$ac_objext' 
     8196  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     8197  (eval $ac_try) 2>&5 
     8198  ac_status=$? 
     8199  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     8200  (exit $ac_status); }; }; then 
     8201  ac_header_compiler=yes 
     8202else 
     8203  echo "$as_me: failed program was:" >&5 
     8204sed 's/^/| /' conftest.$ac_ext >&5 
     8205 
     8206ac_header_compiler=no 
     8207fi 
     8208rm -f conftest.err conftest.$ac_objext conftest.$ac_ext 
     8209echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 
     8210echo "${ECHO_T}$ac_header_compiler" >&6 
     8211 
     8212# Is the header present? 
     8213echo "$as_me:$LINENO: checking uuid/uuid.h presence" >&5 
     8214echo $ECHO_N "checking uuid/uuid.h presence... $ECHO_C" >&6 
     8215cat >conftest.$ac_ext <<_ACEOF 
     8216/* confdefs.h.  */ 
     8217_ACEOF 
     8218cat confdefs.h >>conftest.$ac_ext 
     8219cat >>conftest.$ac_ext <<_ACEOF 
     8220/* end confdefs.h.  */ 
     8221#include <uuid/uuid.h> 
     8222_ACEOF 
     8223if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 
     8224  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 
     8225  ac_status=$? 
     8226  grep -v '^ *+' conftest.er1 >conftest.err 
     8227  rm -f conftest.er1 
     8228  cat conftest.err >&5 
     8229  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     8230  (exit $ac_status); } >/dev/null; then 
     8231  if test -s conftest.err; then 
     8232    ac_cpp_err=$ac_c_preproc_warn_flag 
     8233    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag 
     8234  else 
     8235    ac_cpp_err= 
     8236  fi 
     8237else 
     8238  ac_cpp_err=yes 
     8239fi 
     8240if test -z "$ac_cpp_err"; then 
     8241  ac_header_preproc=yes 
     8242else 
     8243  echo "$as_me: failed program was:" >&5 
     8244sed 's/^/| /' conftest.$ac_ext >&5 
     8245 
     8246  ac_header_preproc=no 
     8247fi 
     8248rm -f conftest.err conftest.$ac_ext 
     8249echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 
     8250echo "${ECHO_T}$ac_header_preproc" >&6 
     8251 
     8252# So?  What about this header? 
     8253case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in 
     8254  yes:no: ) 
     8255    { echo "$as_me:$LINENO: WARNING: uuid/uuid.h: accepted by the compiler, rejected by the preprocessor!" >&5 
     8256echo "$as_me: WARNING: uuid/uuid.h: accepted by the compiler, rejected by the preprocessor!" >&2;} 
     8257    { echo "$as_me:$LINENO: WARNING: uuid/uuid.h: proceeding with the compiler's result" >&5 
     8258echo "$as_me: WARNING: uuid/uuid.h: proceeding with the compiler's result" >&2;} 
     8259    ac_header_preproc=yes 
     8260    ;; 
     8261  no:yes:* ) 
     8262    { echo "$as_me:$LINENO: WARNING: uuid/uuid.h: present but cannot be compiled" >&5 
     8263echo "$as_me: WARNING: uuid/uuid.h: present but cannot be compiled" >&2;} 
     8264    { echo "$as_me:$LINENO: WARNING: uuid/uuid.h:     check for missing prerequisite headers?" >&5 
     8265echo "$as_me: WARNING: uuid/uuid.h:     check for missing prerequisite headers?" >&2;} 
     8266    { echo "$as_me:$LINENO: WARNING: uuid/uuid.h: see the Autoconf documentation" >&5 
     8267echo "$as_me: WARNING: uuid/uuid.h: see the Autoconf documentation" >&2;} 
     8268    { echo "$as_me:$LINENO: WARNING: uuid/uuid.h:     section \"Present But Cannot Be Compiled\"" >&5 
     8269echo "$as_me: WARNING: uuid/uuid.h:     section \"Present But Cannot Be Compiled\"" >&2;} 
     8270    { echo "$as_me:$LINENO: WARNING: uuid/uuid.h: proceeding with the preprocessor's result" >&5 
     8271echo "$as_me: WARNING: uuid/uuid.h: proceeding with the preprocessor's result" >&2;} 
     8272    { echo "$as_me:$LINENO: WARNING: uuid/uuid.h: in the future, the compiler will take precedence" >&5 
     8273echo "$as_me: WARNING: uuid/uuid.h: in the future, the compiler will take precedence" >&2;} 
     8274    ( 
     8275      cat <<\_ASBOX 
     8276## ------------------------------------ ## 
     8277## Report this to the pjproject lists.  ## 
     8278## ------------------------------------ ## 
     8279_ASBOX 
     8280    ) | 
     8281      sed "s/^/$as_me: WARNING:     /" >&2 
     8282    ;; 
     8283esac 
     8284echo "$as_me:$LINENO: checking for uuid/uuid.h" >&5 
     8285echo $ECHO_N "checking for uuid/uuid.h... $ECHO_C" >&6 
     8286if test "${ac_cv_header_uuid_uuid_h+set}" = set; then 
     8287  echo $ECHO_N "(cached) $ECHO_C" >&6 
     8288else 
     8289  ac_cv_header_uuid_uuid_h=$ac_header_preproc 
     8290fi 
     8291echo "$as_me:$LINENO: result: $ac_cv_header_uuid_uuid_h" >&5 
     8292echo "${ECHO_T}$ac_cv_header_uuid_uuid_h" >&6 
     8293 
     8294fi 
     8295if test $ac_cv_header_uuid_uuid_h = yes; then 
     8296  ac_has_uuid_h=1 
     8297fi 
     8298 
     8299 
    80168300 
    80178301echo "$as_me:$LINENO: result: Setting PJ_OS_NAME to $target" >&5 
     
    83568640        ;; 
    83578641  *) 
    8358         ac_os_objs="file_access_unistd.o file_io_ansi.o os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o guid_simple.o ioqueue_select.o" 
     8642        ac_os_objs="file_access_unistd.o file_io_ansi.o os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o ioqueue_select.o" 
     8643        # UUID 
     8644        if test "$ac_has_uuid_lib" = "1" -a "$ac_has_uuid_h" = "1"; then 
     8645                ac_os_objs="$ac_os_objs guid_uuid.o" 
     8646        else 
     8647                ac_os_objs="$ac_os_objs guid_simple.o" 
     8648        fi 
    83598649        ;; 
    83608650esac 
     8651 
    83618652 
    83628653 
  • pjproject/trunk/aconfigure.ac

    r1279 r1282  
    4949AC_CHECK_LIB(rt,puts) 
    5050AC_CHECK_LIB(nsl,puts) 
     51AC_CHECK_LIB(uuid,uuid_generate) 
     52AC_CHECK_LIB(uuid,uuid_generate,[ac_has_uuid_lib=1]) 
    5153 
    5254AC_MSG_RESULT([Setting PJ_M_NAME to $target_cpu]) 
     
    152154AC_CHECK_HEADER(winsock.h,[AC_DEFINE(PJ_HAS_WINSOCK_H,1)]) 
    153155AC_CHECK_HEADER(winsock2.h,[AC_DEFINE(PJ_HAS_WINSOCK2_H,1)]) 
     156AC_CHECK_HEADER(uuid/uuid.h,[ac_has_uuid_h=1]) 
    154157 
    155158AC_MSG_RESULT([Setting PJ_OS_NAME to $target]) 
     
    233236        ;; 
    234237  *) 
    235         ac_os_objs="file_access_unistd.o file_io_ansi.o os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o guid_simple.o ioqueue_select.o" 
    236         ;; 
    237 esac 
     238        ac_os_objs="file_access_unistd.o file_io_ansi.o os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o ioqueue_select.o" 
     239        # UUID 
     240        if test "$ac_has_uuid_lib" = "1" -a "$ac_has_uuid_h" = "1"; then 
     241                ac_os_objs="$ac_os_objs guid_uuid.o" 
     242        else 
     243                ac_os_objs="$ac_os_objs guid_simple.o" 
     244        fi 
     245        ;; 
     246esac 
     247 
    238248 
    239249 
  • pjproject/trunk/pjlib/include/pj/guid.h

    r974 r1282  
    4949 * PJ_GUID_STRING_LENGTH specifies length of GUID string. The value is 
    5050 * dependent on the algorithm used internally to generate the GUID string. 
    51  * If real GUID generator is used, then the length will be 128bit or  
    52  * 32 bytes. If shadow GUID generator is used, then the length 
     51 * If real GUID generator is used, then the length will be between 32 and 
     52 * 36 bytes. If shadow GUID generator is used, then the length 
    5353 * will be 20 bytes. Application should not assume which algorithm will 
    5454 * be used by GUID generator. 
     55 * 
     56 * Regardless of the actual length of the GUID, it will not exceed 
     57 * PJ_GUID_MAX_LENGTH characters. 
    5558 */ 
    5659extern const unsigned PJ_GUID_STRING_LENGTH; 
     
    6063 * regardless of which algorithm to use. 
    6164 */ 
    62 #define PJ_GUID_MAX_LENGTH  32 
     65#define PJ_GUID_MAX_LENGTH  36 
    6366 
    6467/** 
  • pjproject/trunk/pjlib/src/pj/config.c

    r1279 r1282  
    2222 
    2323static const char *id = "config.c"; 
    24 const char *PJ_VERSION = "0.7.0-rc1"; 
     24const char *PJ_VERSION = "0.7.0-pre-rc2"; 
    2525 
    2626PJ_DEF(void) pj_dump_config(void) 
Note: See TracChangeset for help on using the changeset viewer.