diff options
-rw-r--r-- | HACKING | 9 | ||||
-rw-r--r-- | contrib/defaults.conf | 5 | ||||
-rw-r--r-- | m4/argz.m4 | 4 | ||||
-rw-r--r-- | m4/libtool.m4 | 131 | ||||
-rw-r--r-- | m4/ltdl.m4 | 32 | ||||
-rw-r--r-- | m4/ltoptions.m4 | 2 | ||||
-rw-r--r-- | m4/ltsugar.m4 | 20 | ||||
-rw-r--r-- | m4/ltversion.m4 | 10 | ||||
-rw-r--r-- | src/datastore/Makefile.am | 1 | ||||
-rw-r--r-- | src/datastore/datastore_api.c | 108 | ||||
-rw-r--r-- | src/datastore/perf_datastore_api.c | 6 | ||||
-rw-r--r-- | src/datastore/perf_datastore_api_iterators.c | 6 | ||||
-rw-r--r-- | src/datastore/plugin_datastore_sqlite.c | 204 | ||||
-rw-r--r-- | src/datastore/test_datastore_api.c | 198 | ||||
-rw-r--r-- | src/include/gnunet_datastore_service.h | 2 | ||||
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 8 | ||||
-rw-r--r-- | src/transport/test_transport_api_data.conf | 2 | ||||
-rw-r--r-- | src/transport/test_transport_api_peer1.conf | 2 | ||||
-rw-r--r-- | src/transport/test_transport_api_peer2.conf | 2 | ||||
-rw-r--r-- | src/util/disk.c | 8 |
20 files changed, 468 insertions, 292 deletions
@@ -13,6 +13,15 @@ include files: | |||
13 | * gnunet_directories.h --- generated | 13 | * gnunet_directories.h --- generated |
14 | * gettext.h --- external library | 14 | * gettext.h --- external library |
15 | 15 | ||
16 | configuration: | ||
17 | - paths (that are substituted in all filenames) are in PATHS (have as few as possible) | ||
18 | - globals for the daemon are in [gnunetd] (for now, have as few as possible!) | ||
19 | - all options for a particular module (src/MODULE) are under [MODULE] | ||
20 | - options for a plugin of a module are under [MODULE-PLUGINNAME] | ||
21 | - options only for debugging / testing / profiling are under [TESTING], | ||
22 | together with the options for the testing module itself | ||
23 | |||
24 | |||
16 | 25 | ||
17 | exported symbols: | 26 | exported symbols: |
18 | - must start with "GNUNET_modulename_" and be defined in "modulename.c" | 27 | - must start with "GNUNET_modulename_" and be defined in "modulename.c" |
diff --git a/contrib/defaults.conf b/contrib/defaults.conf index d3eb190fc..0af2752fb 100644 --- a/contrib/defaults.conf +++ b/contrib/defaults.conf | |||
@@ -9,7 +9,7 @@ HOSTKEY = $SERVICEHOME/.hostkey | |||
9 | WEAKRANDOM = NO | 9 | WEAKRANDOM = NO |
10 | 10 | ||
11 | 11 | ||
12 | [tcp] | 12 | [transport-tcp] |
13 | PORT = 2086 | 13 | PORT = 2086 |
14 | TIMEOUT = 300000 | 14 | TIMEOUT = 300000 |
15 | ALLOW_SHUTDOWN = NO | 15 | ALLOW_SHUTDOWN = NO |
@@ -174,3 +174,6 @@ ALLOW_SHUTDOWN = YES | |||
174 | QUOTA = 10000000 | 174 | QUOTA = 10000000 |
175 | BLOOMFILTER = $SERVICEHOME/fs/bloomfilter | 175 | BLOOMFILTER = $SERVICEHOME/fs/bloomfilter |
176 | DATABASE = sqlite | 176 | DATABASE = sqlite |
177 | |||
178 | [datastore-sqlite] | ||
179 | FILENAME = $SERVICEHOME/datastore/sqlite.db | ||
diff --git a/m4/argz.m4 b/m4/argz.m4 index edc99bbce..37c1b11e4 100644 --- a/m4/argz.m4 +++ b/m4/argz.m4 | |||
@@ -28,14 +28,14 @@ ARGZ_H= | |||
28 | AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \ | 28 | AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \ |
29 | argz_next argz_stringify], [], [ARGZ_H=argz.h; AC_LIBOBJ([argz])]) | 29 | argz_next argz_stringify], [], [ARGZ_H=argz.h; AC_LIBOBJ([argz])]) |
30 | 30 | ||
31 | dnl if have system argz functions, allow forced use of | 31 | dnl if have system argz functions, allow forced use of |
32 | dnl libltdl-supplied implementation (and default to do so | 32 | dnl libltdl-supplied implementation (and default to do so |
33 | dnl on "known bad" systems). Could use a runtime check, but | 33 | dnl on "known bad" systems). Could use a runtime check, but |
34 | dnl (a) detecting malloc issues is notoriously unreliable | 34 | dnl (a) detecting malloc issues is notoriously unreliable |
35 | dnl (b) only known system that declares argz functions, | 35 | dnl (b) only known system that declares argz functions, |
36 | dnl provides them, yet they are broken, is cygwin | 36 | dnl provides them, yet they are broken, is cygwin |
37 | dnl releases prior to 16-Mar-2007 (1.5.24 and earlier) | 37 | dnl releases prior to 16-Mar-2007 (1.5.24 and earlier) |
38 | dnl So, it's more straightforward simply to special case | 38 | dnl So, it's more straightforward simply to special case |
39 | dnl this for known bad systems. | 39 | dnl this for known bad systems. |
40 | AS_IF([test -z "$ARGZ_H"], | 40 | AS_IF([test -z "$ARGZ_H"], |
41 | [AC_CACHE_CHECK( | 41 | [AC_CACHE_CHECK( |
diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 6e86e5b43..1e7ea47c0 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 | |||
@@ -380,12 +380,12 @@ m4_define([lt_decl_dquote_varnames], | |||
380 | # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) | 380 | # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) |
381 | # --------------------------------------------------- | 381 | # --------------------------------------------------- |
382 | m4_define([lt_decl_varnames_tagged], | 382 | m4_define([lt_decl_varnames_tagged], |
383 | [_$0(m4_quote(m4_default([$1], [[, ]])), | 383 | [m4_assert([$# <= 2])dnl |
384 | m4_quote(m4_if([$2], [], | 384 | _$0(m4_quote(m4_default([$1], [[, ]])), |
385 | m4_quote(lt_decl_tag_varnames), | 385 | m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), |
386 | m4_quote(m4_shift($@)))), | 386 | m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) |
387 | m4_split(m4_normalize(m4_quote(_LT_TAGS))))]) | 387 | m4_define([_lt_decl_varnames_tagged], |
388 | m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)]) | 388 | [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) |
389 | 389 | ||
390 | 390 | ||
391 | # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) | 391 | # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) |
@@ -945,10 +945,10 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ | |||
945 | _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; | 945 | _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; |
946 | darwin1.*) | 946 | darwin1.*) |
947 | _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; | 947 | _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; |
948 | darwin*) # darwin 5.x on | 948 | darwin*) # darwin 5.x on |
949 | # if running on 10.5 or later, the deployment target defaults | 949 | # if running on 10.5 or later, the deployment target defaults |
950 | # to the OS version, if on x86, and 10.4, the deployment | 950 | # to the OS version, if on x86, and 10.4, the deployment |
951 | # target defaults to 10.4. Don't you love it? | 951 | # target defaults to 10.4. Don't you love it? |
952 | case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in | 952 | case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in |
953 | 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) | 953 | 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) |
954 | _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; | 954 | _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; |
@@ -990,7 +990,11 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], | |||
990 | _LT_TAGVAR(whole_archive_flag_spec, $1)='' | 990 | _LT_TAGVAR(whole_archive_flag_spec, $1)='' |
991 | _LT_TAGVAR(link_all_deplibs, $1)=yes | 991 | _LT_TAGVAR(link_all_deplibs, $1)=yes |
992 | _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" | 992 | _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" |
993 | if test "$GCC" = "yes"; then | 993 | case $cc_basename in |
994 | ifort*) _lt_dar_can_shared=yes ;; | ||
995 | *) _lt_dar_can_shared=$GCC ;; | ||
996 | esac | ||
997 | if test "$_lt_dar_can_shared" = "yes"; then | ||
994 | output_verbose_link_cmd=echo | 998 | output_verbose_link_cmd=echo |
995 | _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" | 999 | _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" |
996 | _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" | 1000 | _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" |
@@ -1512,7 +1516,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl | |||
1512 | lt_cv_sys_max_cmd_len=-1; | 1516 | lt_cv_sys_max_cmd_len=-1; |
1513 | ;; | 1517 | ;; |
1514 | 1518 | ||
1515 | cygwin* | mingw*) | 1519 | cygwin* | mingw* | cegcc*) |
1516 | # On Win9x/ME, this test blows up -- it succeeds, but takes | 1520 | # On Win9x/ME, this test blows up -- it succeeds, but takes |
1517 | # about 5 minutes as the teststring grows exponentially. | 1521 | # about 5 minutes as the teststring grows exponentially. |
1518 | # Worse, since 9x/ME are not pre-emptively multitasking, | 1522 | # Worse, since 9x/ME are not pre-emptively multitasking, |
@@ -1680,10 +1684,6 @@ else | |||
1680 | # endif | 1684 | # endif |
1681 | #endif | 1685 | #endif |
1682 | 1686 | ||
1683 | #ifdef __cplusplus | ||
1684 | extern "C" void exit (int); | ||
1685 | #endif | ||
1686 | |||
1687 | void fnord() { int i=42;} | 1687 | void fnord() { int i=42;} |
1688 | int main () | 1688 | int main () |
1689 | { | 1689 | { |
@@ -1699,7 +1699,7 @@ int main () | |||
1699 | else | 1699 | else |
1700 | puts (dlerror ()); | 1700 | puts (dlerror ()); |
1701 | 1701 | ||
1702 | exit (status); | 1702 | return status; |
1703 | }] | 1703 | }] |
1704 | _LT_EOF | 1704 | _LT_EOF |
1705 | if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then | 1705 | if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then |
@@ -1738,7 +1738,7 @@ else | |||
1738 | lt_cv_dlopen_self=yes | 1738 | lt_cv_dlopen_self=yes |
1739 | ;; | 1739 | ;; |
1740 | 1740 | ||
1741 | mingw* | pw32*) | 1741 | mingw* | pw32* | cegcc*) |
1742 | lt_cv_dlopen="LoadLibrary" | 1742 | lt_cv_dlopen="LoadLibrary" |
1743 | lt_cv_dlopen_libs= | 1743 | lt_cv_dlopen_libs= |
1744 | ;; | 1744 | ;; |
@@ -2035,6 +2035,7 @@ m4_defun([_LT_SYS_DYNAMIC_LINKER], | |||
2035 | [AC_REQUIRE([AC_CANONICAL_HOST])dnl | 2035 | [AC_REQUIRE([AC_CANONICAL_HOST])dnl |
2036 | m4_require([_LT_DECL_EGREP])dnl | 2036 | m4_require([_LT_DECL_EGREP])dnl |
2037 | m4_require([_LT_FILEUTILS_DEFAULTS])dnl | 2037 | m4_require([_LT_FILEUTILS_DEFAULTS])dnl |
2038 | m4_require([_LT_DECL_OBJDUMP])dnl | ||
2038 | m4_require([_LT_DECL_SED])dnl | 2039 | m4_require([_LT_DECL_SED])dnl |
2039 | AC_MSG_CHECKING([dynamic linker characteristics]) | 2040 | AC_MSG_CHECKING([dynamic linker characteristics]) |
2040 | m4_if([$1], | 2041 | m4_if([$1], |
@@ -2199,14 +2200,14 @@ bsdi[[45]]*) | |||
2199 | # libtool to hard-code these into programs | 2200 | # libtool to hard-code these into programs |
2200 | ;; | 2201 | ;; |
2201 | 2202 | ||
2202 | cygwin* | mingw* | pw32*) | 2203 | cygwin* | mingw* | pw32* | cegcc*) |
2203 | version_type=windows | 2204 | version_type=windows |
2204 | shrext_cmds=".dll" | 2205 | shrext_cmds=".dll" |
2205 | need_version=no | 2206 | need_version=no |
2206 | need_lib_prefix=no | 2207 | need_lib_prefix=no |
2207 | 2208 | ||
2208 | case $GCC,$host_os in | 2209 | case $GCC,$host_os in |
2209 | yes,cygwin* | yes,mingw* | yes,pw32*) | 2210 | yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) |
2210 | library_names_spec='$libname.dll.a' | 2211 | library_names_spec='$libname.dll.a' |
2211 | # DLL is installed to $(libdir)/../bin by postinstall_cmds | 2212 | # DLL is installed to $(libdir)/../bin by postinstall_cmds |
2212 | postinstall_cmds='base_file=`basename \${file}`~ | 2213 | postinstall_cmds='base_file=`basename \${file}`~ |
@@ -2229,7 +2230,7 @@ cygwin* | mingw* | pw32*) | |||
2229 | soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' | 2230 | soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' |
2230 | sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" | 2231 | sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" |
2231 | ;; | 2232 | ;; |
2232 | mingw*) | 2233 | mingw* | cegcc*) |
2233 | # MinGW DLLs use traditional 'lib' prefix | 2234 | # MinGW DLLs use traditional 'lib' prefix |
2234 | soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' | 2235 | soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' |
2235 | sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` | 2236 | sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` |
@@ -2667,7 +2668,7 @@ tpf*) | |||
2667 | version_type=linux | 2668 | version_type=linux |
2668 | need_lib_prefix=no | 2669 | need_lib_prefix=no |
2669 | need_version=no | 2670 | need_version=no |
2670 | library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' | 2671 | library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' |
2671 | shlibpath_var=LD_LIBRARY_PATH | 2672 | shlibpath_var=LD_LIBRARY_PATH |
2672 | shlibpath_overrides_runpath=no | 2673 | shlibpath_overrides_runpath=no |
2673 | hardcode_into_libs=yes | 2674 | hardcode_into_libs=yes |
@@ -2691,7 +2692,7 @@ variables_saved_for_relink="PATH $shlibpath_var $runpath_var" | |||
2691 | if test "$GCC" = yes; then | 2692 | if test "$GCC" = yes; then |
2692 | variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" | 2693 | variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" |
2693 | fi | 2694 | fi |
2694 | 2695 | ||
2695 | if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then | 2696 | if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then |
2696 | sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" | 2697 | sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" |
2697 | fi | 2698 | fi |
@@ -2968,6 +2969,7 @@ _LT_DECL([], [reload_cmds], [2])dnl | |||
2968 | # -- PORTME fill in with the dynamic library characteristics | 2969 | # -- PORTME fill in with the dynamic library characteristics |
2969 | m4_defun([_LT_CHECK_MAGIC_METHOD], | 2970 | m4_defun([_LT_CHECK_MAGIC_METHOD], |
2970 | [m4_require([_LT_DECL_EGREP]) | 2971 | [m4_require([_LT_DECL_EGREP]) |
2972 | m4_require([_LT_DECL_OBJDUMP]) | ||
2971 | AC_CACHE_CHECK([how to recognize dependent libraries], | 2973 | AC_CACHE_CHECK([how to recognize dependent libraries], |
2972 | lt_cv_deplibs_check_method, | 2974 | lt_cv_deplibs_check_method, |
2973 | [lt_cv_file_magic_cmd='$MAGIC_CMD' | 2975 | [lt_cv_file_magic_cmd='$MAGIC_CMD' |
@@ -3018,6 +3020,12 @@ mingw* | pw32*) | |||
3018 | fi | 3020 | fi |
3019 | ;; | 3021 | ;; |
3020 | 3022 | ||
3023 | cegcc) | ||
3024 | # use the weaker test based on 'objdump'. See mingw*. | ||
3025 | lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' | ||
3026 | lt_cv_file_magic_cmd='$OBJDUMP -f' | ||
3027 | ;; | ||
3028 | |||
3021 | darwin* | rhapsody*) | 3029 | darwin* | rhapsody*) |
3022 | lt_cv_deplibs_check_method=pass_all | 3030 | lt_cv_deplibs_check_method=pass_all |
3023 | ;; | 3031 | ;; |
@@ -3329,7 +3337,7 @@ case $host_os in | |||
3329 | aix*) | 3337 | aix*) |
3330 | symcode='[[BCDT]]' | 3338 | symcode='[[BCDT]]' |
3331 | ;; | 3339 | ;; |
3332 | cygwin* | mingw* | pw32*) | 3340 | cygwin* | mingw* | pw32* | cegcc*) |
3333 | symcode='[[ABCDGISTW]]' | 3341 | symcode='[[ABCDGISTW]]' |
3334 | ;; | 3342 | ;; |
3335 | hpux*) | 3343 | hpux*) |
@@ -3575,7 +3583,7 @@ m4_if([$1], [CXX], [ | |||
3575 | beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) | 3583 | beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) |
3576 | # PIC is the default for these OSes. | 3584 | # PIC is the default for these OSes. |
3577 | ;; | 3585 | ;; |
3578 | mingw* | cygwin* | os2* | pw32*) | 3586 | mingw* | cygwin* | os2* | pw32* | cegcc*) |
3579 | # This hack is so that the source file can tell whether it is being | 3587 | # This hack is so that the source file can tell whether it is being |
3580 | # built for inclusion in a dll (and should export symbols for example). | 3588 | # built for inclusion in a dll (and should export symbols for example). |
3581 | # Although the cygwin gcc ignores -fPIC, still need this for old-style | 3589 | # Although the cygwin gcc ignores -fPIC, still need this for old-style |
@@ -3602,10 +3610,11 @@ m4_if([$1], [CXX], [ | |||
3602 | fi | 3610 | fi |
3603 | ;; | 3611 | ;; |
3604 | hpux*) | 3612 | hpux*) |
3605 | # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but | 3613 | # PIC is the default for 64-bit PA HP-UX, but not for 32-bit |
3606 | # not for PA HP-UX. | 3614 | # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag |
3615 | # sets the default TLS model and affects inlining. | ||
3607 | case $host_cpu in | 3616 | case $host_cpu in |
3608 | hppa*64*|ia64*) | 3617 | hppa*64*) |
3609 | ;; | 3618 | ;; |
3610 | *) | 3619 | *) |
3611 | _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' | 3620 | _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' |
@@ -3703,12 +3712,19 @@ m4_if([$1], [CXX], [ | |||
3703 | _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' | 3712 | _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' |
3704 | _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' | 3713 | _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' |
3705 | ;; | 3714 | ;; |
3706 | icpc* | ecpc* ) | 3715 | ecpc* ) |
3707 | # Intel C++ | 3716 | # old Intel C++ for x86_64 which still supported -KPIC. |
3708 | _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' | 3717 | _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' |
3709 | _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' | 3718 | _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' |
3710 | _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' | 3719 | _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' |
3711 | ;; | 3720 | ;; |
3721 | icpc* ) | ||
3722 | # Intel C++, used to be incompatible with GCC. | ||
3723 | # ICC 10 doesn't accept -KPIC any more. | ||
3724 | _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' | ||
3725 | _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' | ||
3726 | _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' | ||
3727 | ;; | ||
3712 | pgCC* | pgcpp*) | 3728 | pgCC* | pgcpp*) |
3713 | # Portland Group C++ compiler | 3729 | # Portland Group C++ compiler |
3714 | _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' | 3730 | _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' |
@@ -3874,7 +3890,7 @@ m4_if([$1], [CXX], [ | |||
3874 | # PIC is the default for these OSes. | 3890 | # PIC is the default for these OSes. |
3875 | ;; | 3891 | ;; |
3876 | 3892 | ||
3877 | mingw* | cygwin* | pw32* | os2*) | 3893 | mingw* | cygwin* | pw32* | os2* | cegcc*) |
3878 | # This hack is so that the source file can tell whether it is being | 3894 | # This hack is so that the source file can tell whether it is being |
3879 | # built for inclusion in a dll (and should export symbols for example). | 3895 | # built for inclusion in a dll (and should export symbols for example). |
3880 | # Although the cygwin gcc ignores -fPIC, still need this for old-style | 3896 | # Although the cygwin gcc ignores -fPIC, still need this for old-style |
@@ -3890,10 +3906,11 @@ m4_if([$1], [CXX], [ | |||
3890 | ;; | 3906 | ;; |
3891 | 3907 | ||
3892 | hpux*) | 3908 | hpux*) |
3893 | # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but | 3909 | # PIC is the default for 64-bit PA HP-UX, but not for 32-bit |
3894 | # not for PA HP-UX. | 3910 | # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag |
3911 | # sets the default TLS model and affects inlining. | ||
3895 | case $host_cpu in | 3912 | case $host_cpu in |
3896 | hppa*64*|ia64*) | 3913 | hppa*64*) |
3897 | # +Z the default | 3914 | # +Z the default |
3898 | ;; | 3915 | ;; |
3899 | *) | 3916 | *) |
@@ -3943,7 +3960,7 @@ m4_if([$1], [CXX], [ | |||
3943 | fi | 3960 | fi |
3944 | ;; | 3961 | ;; |
3945 | 3962 | ||
3946 | mingw* | cygwin* | pw32* | os2*) | 3963 | mingw* | cygwin* | pw32* | os2* | cegcc*) |
3947 | # This hack is so that the source file can tell whether it is being | 3964 | # This hack is so that the source file can tell whether it is being |
3948 | # built for inclusion in a dll (and should export symbols for example). | 3965 | # built for inclusion in a dll (and should export symbols for example). |
3949 | m4_if([$1], [GCJ], [], | 3966 | m4_if([$1], [GCJ], [], |
@@ -3974,11 +3991,25 @@ m4_if([$1], [CXX], [ | |||
3974 | 3991 | ||
3975 | linux* | k*bsd*-gnu) | 3992 | linux* | k*bsd*-gnu) |
3976 | case $cc_basename in | 3993 | case $cc_basename in |
3977 | icc* | ecc* | ifort*) | 3994 | # old Intel for x86_64 which still supported -KPIC. |
3995 | ecc*) | ||
3978 | _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' | 3996 | _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' |
3979 | _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' | 3997 | _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' |
3980 | _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' | 3998 | _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' |
3981 | ;; | 3999 | ;; |
4000 | # icc used to be incompatible with GCC. | ||
4001 | # ICC 10 doesn't accept -KPIC any more. | ||
4002 | icc* | ifort*) | ||
4003 | _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' | ||
4004 | _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' | ||
4005 | _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' | ||
4006 | ;; | ||
4007 | # Lahey Fortran 8.1. | ||
4008 | lf95*) | ||
4009 | _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' | ||
4010 | _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' | ||
4011 | _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' | ||
4012 | ;; | ||
3982 | pgcc* | pgf77* | pgf90* | pgf95*) | 4013 | pgcc* | pgf77* | pgf90* | pgf95*) |
3983 | # Portland Group compilers (*not* the Pentium gcc compiler, | 4014 | # Portland Group compilers (*not* the Pentium gcc compiler, |
3984 | # which looks to be a dead project) | 4015 | # which looks to be a dead project) |
@@ -4160,7 +4191,7 @@ m4_if([$1], [CXX], [ | |||
4160 | pw32*) | 4191 | pw32*) |
4161 | _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" | 4192 | _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" |
4162 | ;; | 4193 | ;; |
4163 | cygwin* | mingw*) | 4194 | cygwin* | mingw* | cegcc*) |
4164 | _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' | 4195 | _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' |
4165 | ;; | 4196 | ;; |
4166 | linux* | k*bsd*-gnu) | 4197 | linux* | k*bsd*-gnu) |
@@ -4215,7 +4246,7 @@ dnl Note also adjust exclude_expsyms for C++ above. | |||
4215 | extract_expsyms_cmds= | 4246 | extract_expsyms_cmds= |
4216 | 4247 | ||
4217 | case $host_os in | 4248 | case $host_os in |
4218 | cygwin* | mingw* | pw32*) | 4249 | cygwin* | mingw* | pw32* | cegcc*) |
4219 | # FIXME: the MSVC++ port hasn't been tested in a loooong time | 4250 | # FIXME: the MSVC++ port hasn't been tested in a loooong time |
4220 | # When not using gcc, we currently assume that we are using | 4251 | # When not using gcc, we currently assume that we are using |
4221 | # Microsoft Visual C++. | 4252 | # Microsoft Visual C++. |
@@ -4230,6 +4261,9 @@ dnl Note also adjust exclude_expsyms for C++ above. | |||
4230 | openbsd*) | 4261 | openbsd*) |
4231 | with_gnu_ld=no | 4262 | with_gnu_ld=no |
4232 | ;; | 4263 | ;; |
4264 | linux* | k*bsd*-gnu) | ||
4265 | _LT_TAGVAR(link_all_deplibs, $1)=no | ||
4266 | ;; | ||
4233 | esac | 4267 | esac |
4234 | 4268 | ||
4235 | _LT_TAGVAR(ld_shlibs, $1)=yes | 4269 | _LT_TAGVAR(ld_shlibs, $1)=yes |
@@ -4302,7 +4336,7 @@ _LT_EOF | |||
4302 | fi | 4336 | fi |
4303 | ;; | 4337 | ;; |
4304 | 4338 | ||
4305 | cygwin* | mingw* | pw32*) | 4339 | cygwin* | mingw* | pw32* | cegcc*) |
4306 | # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, | 4340 | # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, |
4307 | # as there is no search path for DLLs. | 4341 | # as there is no search path for DLLs. |
4308 | _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' | 4342 | _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' |
@@ -4368,6 +4402,9 @@ _LT_EOF | |||
4368 | tmp_addflag=' -i_dynamic -nofor_main' ;; | 4402 | tmp_addflag=' -i_dynamic -nofor_main' ;; |
4369 | ifc* | ifort*) # Intel Fortran compiler | 4403 | ifc* | ifort*) # Intel Fortran compiler |
4370 | tmp_addflag=' -nofor_main' ;; | 4404 | tmp_addflag=' -nofor_main' ;; |
4405 | lf95*) # Lahey Fortran 8.1 | ||
4406 | _LT_TAGVAR(whole_archive_flag_spec, $1)= | ||
4407 | tmp_sharedflag='--shared' ;; | ||
4371 | xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) | 4408 | xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) |
4372 | tmp_sharedflag='-qmkshrobj' | 4409 | tmp_sharedflag='-qmkshrobj' |
4373 | tmp_addflag= ;; | 4410 | tmp_addflag= ;; |
@@ -4600,6 +4637,7 @@ _LT_EOF | |||
4600 | fi | 4637 | fi |
4601 | fi | 4638 | fi |
4602 | 4639 | ||
4640 | _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' | ||
4603 | # It seems that -bexpall does not export symbols beginning with | 4641 | # It seems that -bexpall does not export symbols beginning with |
4604 | # underscore (_), so it is better to generate a list of symbols to export. | 4642 | # underscore (_), so it is better to generate a list of symbols to export. |
4605 | _LT_TAGVAR(always_export_symbols, $1)=yes | 4643 | _LT_TAGVAR(always_export_symbols, $1)=yes |
@@ -4654,7 +4692,7 @@ _LT_EOF | |||
4654 | _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic | 4692 | _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic |
4655 | ;; | 4693 | ;; |
4656 | 4694 | ||
4657 | cygwin* | mingw* | pw32*) | 4695 | cygwin* | mingw* | pw32* | cegcc*) |
4658 | # When not using gcc, we currently assume that we are using | 4696 | # When not using gcc, we currently assume that we are using |
4659 | # Microsoft Visual C++. | 4697 | # Microsoft Visual C++. |
4660 | # hardcode_libdir_flag_spec is actually meaningless, as there is | 4698 | # hardcode_libdir_flag_spec is actually meaningless, as there is |
@@ -4758,7 +4796,7 @@ _LT_EOF | |||
4758 | _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' | 4796 | _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' |
4759 | ;; | 4797 | ;; |
4760 | ia64*) | 4798 | ia64*) |
4761 | _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' | 4799 | _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' |
4762 | ;; | 4800 | ;; |
4763 | *) | 4801 | *) |
4764 | _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' | 4802 | _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' |
@@ -5543,6 +5581,7 @@ if test "$_lt_caught_CXX_error" != yes; then | |||
5543 | fi | 5581 | fi |
5544 | fi | 5582 | fi |
5545 | 5583 | ||
5584 | _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' | ||
5546 | # It seems that -bexpall does not export symbols beginning with | 5585 | # It seems that -bexpall does not export symbols beginning with |
5547 | # underscore (_), so it is better to generate a list of symbols to | 5586 | # underscore (_), so it is better to generate a list of symbols to |
5548 | # export. | 5587 | # export. |
@@ -5601,7 +5640,7 @@ if test "$_lt_caught_CXX_error" != yes; then | |||
5601 | esac | 5640 | esac |
5602 | ;; | 5641 | ;; |
5603 | 5642 | ||
5604 | cygwin* | mingw* | pw32*) | 5643 | cygwin* | mingw* | pw32* | cegcc*) |
5605 | # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, | 5644 | # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, |
5606 | # as there is no search path for DLLs. | 5645 | # as there is no search path for DLLs. |
5607 | _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' | 5646 | _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' |
@@ -6986,6 +7025,18 @@ AC_SUBST([GREP]) | |||
6986 | ]) | 7025 | ]) |
6987 | 7026 | ||
6988 | 7027 | ||
7028 | # _LT_DECL_OBJDUMP | ||
7029 | # -------------- | ||
7030 | # If we don't have a new enough Autoconf to choose the best objdump | ||
7031 | # available, choose the one first in the user's PATH. | ||
7032 | m4_defun([_LT_DECL_OBJDUMP], | ||
7033 | [AC_CHECK_TOOL(OBJDUMP, objdump, false) | ||
7034 | test -z "$OBJDUMP" && OBJDUMP=objdump | ||
7035 | _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) | ||
7036 | AC_SUBST([OBJDUMP]) | ||
7037 | ]) | ||
7038 | |||
7039 | |||
6989 | # _LT_DECL_SED | 7040 | # _LT_DECL_SED |
6990 | # ------------ | 7041 | # ------------ |
6991 | # Check for a fully-functional sed program, that truncates | 7042 | # Check for a fully-functional sed program, that truncates |
diff --git a/m4/ltdl.m4 b/m4/ltdl.m4 index eb8db0cd1..46535e2e1 100644 --- a/m4/ltdl.m4 +++ b/m4/ltdl.m4 | |||
@@ -7,7 +7,7 @@ | |||
7 | # unlimited permission to copy and/or distribute it, with or without | 7 | # unlimited permission to copy and/or distribute it, with or without |
8 | # modifications, as long as this notice is preserved. | 8 | # modifications, as long as this notice is preserved. |
9 | 9 | ||
10 | # serial 15 LTDL_INIT | 10 | # serial 17 LTDL_INIT |
11 | 11 | ||
12 | # LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE]) | 12 | # LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE]) |
13 | # ------------------------------------------ | 13 | # ------------------------------------------ |
@@ -212,26 +212,10 @@ m4_define([$0], []) | |||
212 | # of into LIBOBJS. | 212 | # of into LIBOBJS. |
213 | AC_DEFUN([_LT_LIBOBJ], [ | 213 | AC_DEFUN([_LT_LIBOBJ], [ |
214 | m4_pattern_allow([^_LT_LIBOBJS$]) | 214 | m4_pattern_allow([^_LT_LIBOBJS$]) |
215 | AS_LITERAL_IF([$1], [_LT_LIBSOURCES([$1.c])])dnl | ||
216 | _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" | 215 | _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" |
217 | ])# _LT_LIBOBJS | 216 | ])# _LT_LIBOBJS |
218 | 217 | ||
219 | 218 | ||
220 | # _LT_LIBSOURCES(MODULE_NAMES) | ||
221 | # ---------------------------- | ||
222 | # Like AC_LIBSOURCES, except the directory where the libltdl source files | ||
223 | # are expected is distinct from the user LIBOBJ directory. | ||
224 | AC_DEFUN([_LT_LIBSOURCES], [ | ||
225 | m4_foreach([_LTNAME], [$1], [ | ||
226 | m4_syscmd([test -r "$lt_libobj_prefix]_LTNAME[" || | ||
227 | test -z "$lt_libobj_prefix" || | ||
228 | test ! -d "$lt_libobj_prefix"])dnl | ||
229 | m4_if(m4_sysval, [0], [], | ||
230 | [AC_FATAL([missing $lt_libobj_prefix/]_LTNAME)]) | ||
231 | ]) | ||
232 | ])# _LT_LIBSOURCES | ||
233 | |||
234 | |||
235 | # LTDL_INIT([OPTIONS]) | 219 | # LTDL_INIT([OPTIONS]) |
236 | # -------------------- | 220 | # -------------------- |
237 | # Clients of libltdl can use this macro to allow the installer to | 221 | # Clients of libltdl can use this macro to allow the installer to |
@@ -245,9 +229,9 @@ _LT_SET_OPTIONS([$0], [$1]) | |||
245 | 229 | ||
246 | dnl We need to keep our own list of libobjs separate from our parent project, | 230 | dnl We need to keep our own list of libobjs separate from our parent project, |
247 | dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while | 231 | dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while |
248 | dnl we look for our own LIBOBJs. Definitions in ltdl-libobj.m4. | 232 | dnl we look for our own LIBOBJs. |
249 | m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) | 233 | m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) |
250 | m4_pushdef([AC_LIBSOURCES], m4_defn([_LT_LIBSOURCES])) | 234 | m4_pushdef([AC_LIBSOURCES]) |
251 | 235 | ||
252 | dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: | 236 | dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: |
253 | m4_if(_LTDL_MODE, [], | 237 | m4_if(_LTDL_MODE, [], |
@@ -264,7 +248,7 @@ if test "x$with_included_ltdl" != xyes; then | |||
264 | # decide whether there is a useful installed version we can use. | 248 | # decide whether there is a useful installed version we can use. |
265 | AC_CHECK_HEADER([ltdl.h], | 249 | AC_CHECK_HEADER([ltdl.h], |
266 | [AC_CHECK_DECL([lt_dlinterface_register], | 250 | [AC_CHECK_DECL([lt_dlinterface_register], |
267 | [AC_CHECK_LIB([ltdl], [lt_dlinterface_register], | 251 | [AC_CHECK_LIB([ltdl], [lt_dladvise_preload], |
268 | [with_included_ltdl=no], | 252 | [with_included_ltdl=no], |
269 | [with_included_ltdl=yes])], | 253 | [with_included_ltdl=yes])], |
270 | [with_included_ltdl=yes], | 254 | [with_included_ltdl=yes], |
@@ -396,12 +380,6 @@ m4_require([_LT_HEADER_DLFCN])dnl | |||
396 | m4_require([_LT_CHECK_DLPREOPEN])dnl | 380 | m4_require([_LT_CHECK_DLPREOPEN])dnl |
397 | m4_require([_LT_DECL_SED])dnl | 381 | m4_require([_LT_DECL_SED])dnl |
398 | 382 | ||
399 | # lt_cv_dlopen_self gets defined by LT_SYS_DLOPEN_SELF, called by LT_INIT | ||
400 | if test "$lt_cv_dlopen_self" = yes; then | ||
401 | AC_DEFINE([LTDL_DLOPEN_SELF_WORKS], [1], | ||
402 | [Define if dlopen(NULL) is able to resolve symbols from the main program.]) | ||
403 | fi | ||
404 | |||
405 | dnl Don't require this, or it will be expanded earlier than the code | 383 | dnl Don't require this, or it will be expanded earlier than the code |
406 | dnl that sets the variables it relies on: | 384 | dnl that sets the variables it relies on: |
407 | _LT_ENABLE_INSTALL | 385 | _LT_ENABLE_INSTALL |
@@ -429,6 +407,8 @@ AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], | |||
429 | AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) | 407 | AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) |
430 | AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) | 408 | AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) |
431 | 409 | ||
410 | AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) | ||
411 | |||
432 | name=ltdl | 412 | name=ltdl |
433 | LTDLOPEN=`eval "\\$ECHO \"$libname_spec\""` | 413 | LTDLOPEN=`eval "\\$ECHO \"$libname_spec\""` |
434 | AC_SUBST([LTDLOPEN]) | 414 | AC_SUBST([LTDLOPEN]) |
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 index e97011948..34151a3ba 100644 --- a/m4/ltoptions.m4 +++ b/m4/ltoptions.m4 | |||
@@ -125,7 +125,7 @@ LT_OPTION_DEFINE([LT_INIT], [win32-dll], | |||
125 | [enable_win32_dll=yes | 125 | [enable_win32_dll=yes |
126 | 126 | ||
127 | case $host in | 127 | case $host in |
128 | *-*-cygwin* | *-*-mingw* | *-*-pw32*) | 128 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) |
129 | AC_CHECK_TOOL(AS, as, false) | 129 | AC_CHECK_TOOL(AS, as, false) |
130 | AC_CHECK_TOOL(DLLTOOL, dlltool, false) | 130 | AC_CHECK_TOOL(DLLTOOL, dlltool, false) |
131 | AC_CHECK_TOOL(OBJDUMP, objdump, false) | 131 | AC_CHECK_TOOL(OBJDUMP, objdump, false) |
diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4 index 0d258e070..9000a057d 100644 --- a/m4/ltsugar.m4 +++ b/m4/ltsugar.m4 | |||
@@ -1,13 +1,13 @@ | |||
1 | # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- | 1 | # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- |
2 | # | 2 | # |
3 | # Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. | 3 | # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. |
4 | # Written by Gary V. Vaughan, 2004 | 4 | # Written by Gary V. Vaughan, 2004 |
5 | # | 5 | # |
6 | # This file is free software; the Free Software Foundation gives | 6 | # This file is free software; the Free Software Foundation gives |
7 | # unlimited permission to copy and/or distribute it, with or without | 7 | # unlimited permission to copy and/or distribute it, with or without |
8 | # modifications, as long as this notice is preserved. | 8 | # modifications, as long as this notice is preserved. |
9 | 9 | ||
10 | # serial 5 ltsugar.m4 | 10 | # serial 6 ltsugar.m4 |
11 | 11 | ||
12 | # This is to help aclocal find these macros, as it can't see m4_define. | 12 | # This is to help aclocal find these macros, as it can't see m4_define. |
13 | AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) | 13 | AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) |
@@ -63,14 +63,14 @@ m4_define([lt_append], | |||
63 | # Produce a SEP delimited list of all paired combinations of elements of | 63 | # Produce a SEP delimited list of all paired combinations of elements of |
64 | # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list | 64 | # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list |
65 | # has the form PREFIXmINFIXSUFFIXn. | 65 | # has the form PREFIXmINFIXSUFFIXn. |
66 | # Needed until we can rely on m4_combine added in Autoconf 2.62. | ||
66 | m4_define([lt_combine], | 67 | m4_define([lt_combine], |
67 | [m4_if([$2], [], [], | 68 | [m4_if(m4_eval([$# > 3]), [1], |
68 | [m4_if([$4], [], [], | 69 | [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl |
69 | [lt_join(m4_quote(m4_default([$1], [[, ]])), | 70 | [[m4_foreach([_Lt_prefix], [$2], |
70 | lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_prefix, [$2], | 71 | [m4_foreach([_Lt_suffix], |
71 | [m4_foreach(_Lt_suffix, lt_car([m4_shiftn(3, $@)]), | 72 | ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, |
72 | [_Lt_prefix[]$3[]_Lt_suffix ])])))))])])dnl | 73 | [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) |
73 | ]) | ||
74 | 74 | ||
75 | 75 | ||
76 | # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) | 76 | # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) |
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 index 45cb1557c..b8e154fe6 100644 --- a/m4/ltversion.m4 +++ b/m4/ltversion.m4 | |||
@@ -9,15 +9,15 @@ | |||
9 | 9 | ||
10 | # Generated from ltversion.in. | 10 | # Generated from ltversion.in. |
11 | 11 | ||
12 | # serial 2976 ltversion.m4 | 12 | # serial 3012 ltversion.m4 |
13 | # This file is part of GNU Libtool | 13 | # This file is part of GNU Libtool |
14 | 14 | ||
15 | m4_define([LT_PACKAGE_VERSION], [2.2.4]) | 15 | m4_define([LT_PACKAGE_VERSION], [2.2.6]) |
16 | m4_define([LT_PACKAGE_REVISION], [1.2976]) | 16 | m4_define([LT_PACKAGE_REVISION], [1.3012]) |
17 | 17 | ||
18 | AC_DEFUN([LTVERSION_VERSION], | 18 | AC_DEFUN([LTVERSION_VERSION], |
19 | [macro_version='2.2.4' | 19 | [macro_version='2.2.6' |
20 | macro_revision='1.2976' | 20 | macro_revision='1.3012' |
21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) | 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) |
22 | _LT_DECL(, macro_revision, 0) | 22 | _LT_DECL(, macro_revision, 0) |
23 | ]) | 23 | ]) |
diff --git a/src/datastore/Makefile.am b/src/datastore/Makefile.am index 1ad59099c..c3b8a9b15 100644 --- a/src/datastore/Makefile.am +++ b/src/datastore/Makefile.am | |||
@@ -43,6 +43,7 @@ plugin_LTLIBRARIES = \ | |||
43 | libgnunet_plugin_datastore_sqlite_la_SOURCES = \ | 43 | libgnunet_plugin_datastore_sqlite_la_SOURCES = \ |
44 | plugin_datastore_sqlite.c | 44 | plugin_datastore_sqlite.c |
45 | libgnunet_plugin_datastore_sqlite_la_LIBADD = \ | 45 | libgnunet_plugin_datastore_sqlite_la_LIBADD = \ |
46 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | ||
46 | $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 | 47 | $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 |
47 | libgnunet_plugin_datastore_sqlite_la_LDFLAGS = \ | 48 | libgnunet_plugin_datastore_sqlite_la_LDFLAGS = \ |
48 | $(GN_PLUGIN_LDFLAGS) | 49 | $(GN_PLUGIN_LDFLAGS) |
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c index 968e09b20..3b9e22a3a 100644 --- a/src/datastore/datastore_api.c +++ b/src/datastore/datastore_api.c | |||
@@ -113,6 +113,32 @@ struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (struct | |||
113 | 113 | ||
114 | 114 | ||
115 | /** | 115 | /** |
116 | * Transmit DROP message to Database service. | ||
117 | */ | ||
118 | static size_t | ||
119 | transmit_drop (void *cls, | ||
120 | size_t size, void *buf) | ||
121 | { | ||
122 | struct GNUNET_DATASTORE_Handle *h = cls; | ||
123 | struct GNUNET_MessageHeader *hdr; | ||
124 | |||
125 | if (buf == NULL) | ||
126 | { | ||
127 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
128 | _("Failed to transmit request to drop database.\n")); | ||
129 | GNUNET_DATASTORE_disconnect (h, GNUNET_NO); | ||
130 | return 0; | ||
131 | } | ||
132 | GNUNET_assert (size >= sizeof(struct GNUNET_MessageHeader)); | ||
133 | hdr = buf; | ||
134 | hdr->size = htons(sizeof(struct GNUNET_MessageHeader)); | ||
135 | hdr->type = htons(GNUNET_MESSAGE_TYPE_DATASTORE_DROP)); | ||
136 | GNUNET_DATASTORE_disconnect (h, GNUNET_NO); | ||
137 | return sizeof(struct GNUNET_MessageHeader); | ||
138 | } | ||
139 | |||
140 | |||
141 | /** | ||
116 | * Disconnect from the datastore service (and free | 142 | * Disconnect from the datastore service (and free |
117 | * associated resources). | 143 | * associated resources). |
118 | * | 144 | * |
@@ -124,7 +150,14 @@ void GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, | |||
124 | { | 150 | { |
125 | if (GNUNET_YES == drop) | 151 | if (GNUNET_YES == drop) |
126 | { | 152 | { |
127 | /* FIXME: send 'drop' request */ | 153 | if (NULL != |
154 | GNUNET_CLIENT_notify_transmit_ready (h->client, | ||
155 | sizeof(struct GNUNET_MessageHeader), | ||
156 | GNUNET_TIME_UNIT_MINUTES, | ||
157 | &transmit_drop, | ||
158 | h)) | ||
159 | return; | ||
160 | GNUNET_break (0); | ||
128 | } | 161 | } |
129 | GNUNET_CLIENT_disconnect (h->client); | 162 | GNUNET_CLIENT_disconnect (h->client); |
130 | GNUNET_free (h); | 163 | GNUNET_free (h); |
@@ -132,6 +165,45 @@ void GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, | |||
132 | 165 | ||
133 | 166 | ||
134 | /** | 167 | /** |
168 | * The closure is followed by the data message. | ||
169 | */ | ||
170 | struct PutClosure | ||
171 | { | ||
172 | struct GNUNET_DATASTORE_Handle *h; | ||
173 | GNUNET_DATASTORE_ContinuationWithStatus cont; | ||
174 | void *cont_cls; | ||
175 | }; | ||
176 | |||
177 | |||
178 | /** | ||
179 | * Transmit PUT message to Database service. | ||
180 | */ | ||
181 | static size_t | ||
182 | transmit_put (void *cls, | ||
183 | size_t size, void *buf) | ||
184 | { | ||
185 | struct PutClosure *pc = cls; | ||
186 | struct DataMessage *dm; | ||
187 | uint16_t msize; | ||
188 | |||
189 | if (buf == NULL) | ||
190 | { | ||
191 | pc->cont (pc->cont_cls, GNUNET_SYSERR, | ||
192 | gettext_noop ("Error transmitting `PUT' message to datastore service.\n")); | ||
193 | GNUNET_free (pc); | ||
194 | return 0; | ||
195 | } | ||
196 | dm = (struct DataMessage*) &pc[1]; | ||
197 | msize = ntohs(dm->size); | ||
198 | GNUNET_assert (msize <= size); | ||
199 | memcpy (buf, dm, msize); | ||
200 | /* FIXME: wait for response from datastore, then | ||
201 | call our continuation! */ | ||
202 | return msize; | ||
203 | } | ||
204 | |||
205 | |||
206 | /** | ||
135 | * Store an item in the datastore. If the item is already present, | 207 | * Store an item in the datastore. If the item is already present, |
136 | * the priorities are summed up and the higher expiration time and | 208 | * the priorities are summed up and the higher expiration time and |
137 | * lower anonymity level is used. | 209 | * lower anonymity level is used. |
@@ -144,6 +216,7 @@ void GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, | |||
144 | * @param priority priority of the content | 216 | * @param priority priority of the content |
145 | * @param anonymity anonymity-level for the content | 217 | * @param anonymity anonymity-level for the content |
146 | * @param expiration expiration time for the content | 218 | * @param expiration expiration time for the content |
219 | * @param timeout timeout for the operation | ||
147 | * @param cont continuation to call when done | 220 | * @param cont continuation to call when done |
148 | * @param cont_cls closure for cont | 221 | * @param cont_cls closure for cont |
149 | */ | 222 | */ |
@@ -157,10 +230,41 @@ GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, | |||
157 | uint32_t priority, | 230 | uint32_t priority, |
158 | uint32_t anonymity, | 231 | uint32_t anonymity, |
159 | struct GNUNET_TIME_Absolute expiration, | 232 | struct GNUNET_TIME_Absolute expiration, |
233 | struct GNUNET_TIME_Relative timeout, | ||
160 | GNUNET_DATASTORE_ContinuationWithStatus cont, | 234 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
161 | void *cont_cls) | 235 | void *cont_cls) |
162 | { | 236 | { |
163 | cont (cont_cls, GNUNET_SYSERR, "not implemented"); | 237 | struct PutClosure *pc; |
238 | struct DataMessage *dm; | ||
239 | |||
240 | pc = GNUNET_malloc (sizeof(struct PutClosure) + | ||
241 | sizeof(struct DataMessage) + | ||
242 | size); | ||
243 | dm = (struct DataMessage*) &pc[1]; | ||
244 | pc->h = h; | ||
245 | pc->cont = cont; | ||
246 | pc->cont_cls = cont_cls; | ||
247 | dm->header.type = htons(GNUNET_MESSAGE_TYPE_DATASTORE_PUT); | ||
248 | dm->header.size = htons(sizeof(struct DataMessage) + size); | ||
249 | dm->rid = htonl(rid); | ||
250 | dm->size = htonl(size); | ||
251 | dm->type = htonl(type); | ||
252 | dm->priority = htonl(priority); | ||
253 | dm->anonymity = htonl(anonymity); | ||
254 | dm->uid = GNUNET_htonll(0); | ||
255 | dm->expiration = GNUNET_htonll(expiration); | ||
256 | dm->key = *key; | ||
257 | memcpy (&dm[1], data, size); | ||
258 | if (NULL == GNUNET_CLIENT_notify_transmit_ready (h->client, | ||
259 | sizeof(struct DataMessage) + size, | ||
260 | timeout, | ||
261 | &transmit_put, | ||
262 | pc)) | ||
263 | { | ||
264 | GNUNET_break (0); | ||
265 | cont (cont_cls, GNUNET_SYSERR, | ||
266 | gettext_noop ("Not ready to transmit request to datastore service")); | ||
267 | } | ||
164 | } | 268 | } |
165 | 269 | ||
166 | 270 | ||
diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c index 95ee18dad..f10f6d0f5 100644 --- a/src/datastore/perf_datastore_api.c +++ b/src/datastore/perf_datastore_api.c | |||
@@ -104,6 +104,9 @@ static unsigned long long stored_ops; | |||
104 | 104 | ||
105 | static struct GNUNET_TIME_Absolute start_time; | 105 | static struct GNUNET_TIME_Absolute start_time; |
106 | 106 | ||
107 | static int ok; | ||
108 | |||
109 | |||
107 | static int | 110 | static int |
108 | putValue (int i, int k) | 111 | putValue (int i, int k) |
109 | { | 112 | { |
@@ -206,7 +209,6 @@ run (void *cls, | |||
206 | static int | 209 | static int |
207 | check () | 210 | check () |
208 | { | 211 | { |
209 | int ok = 1 + 2 + 4 + 8; | ||
210 | pid_t pid; | 212 | pid_t pid; |
211 | char *const argv[] = { "perf-datastore-api", | 213 | char *const argv[] = { "perf-datastore-api", |
212 | "-c", | 214 | "-c", |
@@ -228,7 +230,7 @@ check () | |||
228 | sleep (1); | 230 | sleep (1); |
229 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, | 231 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, |
230 | argv, "perf-datastore-api", "nohelp", | 232 | argv, "perf-datastore-api", "nohelp", |
231 | options, &run, &ok); | 233 | options, &run, NULL); |
232 | if (0 != PLIBC_KILL (pid, SIGTERM)) | 234 | if (0 != PLIBC_KILL (pid, SIGTERM)) |
233 | { | 235 | { |
234 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 236 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
diff --git a/src/datastore/perf_datastore_api_iterators.c b/src/datastore/perf_datastore_api_iterators.c index 328cceb75..635fa1f28 100644 --- a/src/datastore/perf_datastore_api_iterators.c +++ b/src/datastore/perf_datastore_api_iterators.c | |||
@@ -52,6 +52,9 @@ static unsigned long long stored_ops; | |||
52 | static struct GNUNET_CONFIGURATION_Handle *cfg; | 52 | static struct GNUNET_CONFIGURATION_Handle *cfg; |
53 | 53 | ||
54 | static struct GNUNET_SCHEDULER_Handle *sched; | 54 | static struct GNUNET_SCHEDULER_Handle *sched; |
55 | |||
56 | static int ok; | ||
57 | |||
55 | 58 | ||
56 | static int | 59 | static int |
57 | putValue (struct GNUNET_DATASTORE_PluginFunctions * api, int i, int k) | 60 | putValue (struct GNUNET_DATASTORE_PluginFunctions * api, int i, int k) |
@@ -271,7 +274,6 @@ run (void *cls, | |||
271 | static int | 274 | static int |
272 | check () | 275 | check () |
273 | { | 276 | { |
274 | int ok = 1 + 2 + 4 + 8; | ||
275 | char *const argv[] = { "perf-datastore-api-iterators", | 277 | char *const argv[] = { "perf-datastore-api-iterators", |
276 | "-c", | 278 | "-c", |
277 | "test_datastore_api_data.conf", | 279 | "test_datastore_api_data.conf", |
@@ -285,7 +287,7 @@ check () | |||
285 | }; | 287 | }; |
286 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, | 288 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, |
287 | argv, "perf-datastore-api-iterators", "nohelp", | 289 | argv, "perf-datastore-api-iterators", "nohelp", |
288 | options, &run, &ok); | 290 | options, &run, NULL); |
289 | if (ok != 0) | 291 | if (ok != 0) |
290 | fprintf (stderr, "Missed some testcases: %u\n", ok); | 292 | fprintf (stderr, "Missed some testcases: %u\n", ok); |
291 | return ok; | 293 | return ok; |
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c index 5ae03b9bb..6abb08dd8 100644 --- a/src/datastore/plugin_datastore_sqlite.c +++ b/src/datastore/plugin_datastore_sqlite.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | (C) 2009 Christian Grothoff (and other contributing authors) | 3 | (C) 2009 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
@@ -63,11 +63,11 @@ | |||
63 | "ORDER BY prio ASC, hash ASC LIMIT 1" | 63 | "ORDER BY prio ASC, hash ASC LIMIT 1" |
64 | 64 | ||
65 | #define SELECT_IT_NON_ANONYMOUS_1 \ | 65 | #define SELECT_IT_NON_ANONYMOUS_1 \ |
66 | "SELECT size,type,prio,anonLevel,expire,hash,value,_ROWID_ FROM gn080 WHERE (prio = ? AND hash < ? AND anonLevel = 0) "\ | 66 | "SELECT size,type,prio,anonLevel,expire,hash,value,_ROWID_ FROM gn080 WHERE (prio = ? AND hash < ? AND anonLevel = 0 AND expire > %llu) "\ |
67 | " ORDER BY hash DESC LIMIT 1" | 67 | " ORDER BY hash DESC LIMIT 1" |
68 | 68 | ||
69 | #define SELECT_IT_NON_ANONYMOUS_2 \ | 69 | #define SELECT_IT_NON_ANONYMOUS_2 \ |
70 | "SELECT size,type,prio,anonLevel,expire,hash,value,_ROWID_ FROM gn080 WHERE (prio < ? AND anonLevel = 0)"\ | 70 | "SELECT size,type,prio,anonLevel,expire,hash,value,_ROWID_ FROM gn080 WHERE (prio < ? AND anonLevel = 0 AND expire > %llu)"\ |
71 | " ORDER BY prio DESC, hash DESC LIMIT 1" | 71 | " ORDER BY prio DESC, hash DESC LIMIT 1" |
72 | 72 | ||
73 | #define SELECT_IT_EXPIRATION_TIME_1 \ | 73 | #define SELECT_IT_EXPIRATION_TIME_1 \ |
@@ -83,7 +83,7 @@ | |||
83 | " ORDER BY hash DESC LIMIT 1" | 83 | " ORDER BY hash DESC LIMIT 1" |
84 | 84 | ||
85 | #define SELECT_IT_MIGRATION_ORDER_2 \ | 85 | #define SELECT_IT_MIGRATION_ORDER_2 \ |
86 | "SELECT size,type,prio,anonLevel,expire,hash,value,_ROWID_ FROM gn080 WHERE (expire < ?) "\ | 86 | "SELECT size,type,prio,anonLevel,expire,hash,value,_ROWID_ FROM gn080 WHERE (expire < ? AND expire > %llu) "\ |
87 | " ORDER BY expire DESC, hash DESC LIMIT 1" | 87 | " ORDER BY expire DESC, hash DESC LIMIT 1" |
88 | 88 | ||
89 | /** | 89 | /** |
@@ -220,7 +220,6 @@ database_setup (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
220 | struct Plugin *plugin) | 220 | struct Plugin *plugin) |
221 | { | 221 | { |
222 | sqlite3_stmt *stmt; | 222 | sqlite3_stmt *stmt; |
223 | char *dir; | ||
224 | char *afsdir; | 223 | char *afsdir; |
225 | #if ENULL_DEFINED | 224 | #if ENULL_DEFINED |
226 | char *e; | 225 | char *e; |
@@ -228,33 +227,31 @@ database_setup (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
228 | 227 | ||
229 | if (GNUNET_OK != | 228 | if (GNUNET_OK != |
230 | GNUNET_CONFIGURATION_get_value_filename (cfg, | 229 | GNUNET_CONFIGURATION_get_value_filename (cfg, |
231 | "FS", | 230 | "datastore-sqlite", |
232 | "DIR", | 231 | "FILENAME", |
233 | &afsdir)) | 232 | &afsdir)) |
234 | { | 233 | { |
235 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, | 234 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, |
236 | "sqlite", | 235 | "sqlite", |
237 | _("Option `%s' in section `%s' missing in configuration!\n"), | 236 | _("Option `%s' in section `%s' missing in configuration!\n"), |
238 | "DIR", | 237 | "FILENAME", |
239 | "FS"); | 238 | "datastore-sqlite"); |
240 | return GNUNET_SYSERR; | 239 | return GNUNET_SYSERR; |
241 | } | 240 | } |
242 | GNUNET_asprintf (&dir, "%s/content/gnunet.dat", afsdir); | 241 | if (GNUNET_OK != GNUNET_DISK_directory_create_for_file (afsdir)) |
243 | GNUNET_free (afsdir); | ||
244 | if (GNUNET_OK != GNUNET_DISK_directory_create_for_file (dir)) | ||
245 | { | 242 | { |
246 | GNUNET_break (0); | 243 | GNUNET_break (0); |
247 | GNUNET_free (dir); | 244 | GNUNET_free (afsdir); |
248 | return GNUNET_SYSERR; | 245 | return GNUNET_SYSERR; |
249 | } | 246 | } |
250 | plugin->fn = GNUNET_STRINGS_to_utf8 (dir, strlen (dir), | 247 | plugin->fn = GNUNET_STRINGS_to_utf8 (afsdir, strlen (afsdir), |
251 | #ifdef ENABLE_NLS | 248 | #ifdef ENABLE_NLS |
252 | nl_langinfo (CODESET) | 249 | nl_langinfo (CODESET) |
253 | #else | 250 | #else |
254 | "UTF-8" /* good luck */ | 251 | "UTF-8" /* good luck */ |
255 | #endif | 252 | #endif |
256 | ); | 253 | ); |
257 | GNUNET_free (dir); | 254 | GNUNET_free (afsdir); |
258 | 255 | ||
259 | /* Open database and precompile statements */ | 256 | /* Open database and precompile statements */ |
260 | if (sqlite3_open (plugin->fn, &plugin->dbh) != SQLITE_OK) | 257 | if (sqlite3_open (plugin->fn, &plugin->dbh) != SQLITE_OK) |
@@ -794,7 +791,7 @@ iter_next_prepare (void *cls, | |||
794 | { | 791 | { |
795 | struct IterContext *ic = cls; | 792 | struct IterContext *ic = cls; |
796 | struct Plugin *plugin = nc->plugin; | 793 | struct Plugin *plugin = nc->plugin; |
797 | struct GNUNET_TIME_Absolute now; | 794 | int ret; |
798 | 795 | ||
799 | if (nc == NULL) | 796 | if (nc == NULL) |
800 | { | 797 | { |
@@ -802,7 +799,6 @@ iter_next_prepare (void *cls, | |||
802 | sqlite3_finalize (ic->stmt_2); | 799 | sqlite3_finalize (ic->stmt_2); |
803 | return GNUNET_SYSERR; | 800 | return GNUNET_SYSERR; |
804 | } | 801 | } |
805 | now = GNUNET_TIME_absolute_get (); | ||
806 | if (ic->is_prio) | 802 | if (ic->is_prio) |
807 | { | 803 | { |
808 | sqlite3_bind_int (ic->stmt_1, 1, nc->lastPriority); | 804 | sqlite3_bind_int (ic->stmt_1, 1, nc->lastPriority); |
@@ -817,13 +813,7 @@ iter_next_prepare (void *cls, | |||
817 | &ic->key, | 813 | &ic->key, |
818 | sizeof (GNUNET_HashCode), | 814 | sizeof (GNUNET_HashCode), |
819 | SQLITE_TRANSIENT); | 815 | SQLITE_TRANSIENT); |
820 | datum_1 = NULL; | 816 | if (SQLITE_ROW == (ret = sqlite3_step (ic->stmt_1))) |
821 | datum_2 = last_datum_2; | ||
822 | last_datum_2 = NULL; | ||
823 | |||
824 | if ( (SQLITE_ROW == (ret = sqlite3_step (stmt_1))) && | ||
825 | ( (GNUNET_NO == ic->is_migr) || | ||
826 | (sqlite3_column_int64 (stmt_1, 4) >= now.value) ) ) | ||
827 | { | 817 | { |
828 | nc->stmt = ic->stmt_1; | 818 | nc->stmt = ic->stmt_1; |
829 | return GNUNET_OK; | 819 | return GNUNET_OK; |
@@ -836,117 +826,30 @@ iter_next_prepare (void *cls, | |||
836 | "sqlite3_step"); | 826 | "sqlite3_step"); |
837 | return GNUNET_SYSERR; | 827 | return GNUNET_SYSERR; |
838 | } | 828 | } |
839 | if (SQLITE_OK != sqlite3_reset (stmt_1)) | 829 | if (SQLITE_OK != sqlite3_reset (ic->stmt_1)) |
840 | LOG_SQLITE (handle, NULL, | 830 | LOG_SQLITE (plugin, NULL, |
841 | GNUNET_ERROR_TYPE_ERROR | | 831 | GNUNET_ERROR_TYPE_ERROR | |
842 | GNUNET_ERROR_TYPE_BULK, | 832 | GNUNET_ERROR_TYPE_BULK, |
843 | "sqlite3_reset"); | 833 | "sqlite3_reset"); |
844 | 834 | if (SQLITE_ROW == (ret = sqlite3_step (ic->stmt_2))) | |
845 | if (datum_2 == NULL) | ||
846 | { | ||
847 | if ( (SQLITE_ROW == (ret = sqlite3_step (ic->stmt_2))) && | ||
848 | ( (GNUNET_NO == ic->is_migr) || | ||
849 | sqlite3_column_int64 (stmt_2, 4) >= now.value) ) | ||
850 | { | ||
851 | nc->stmt = ic->stmt_2; | ||
852 | return GNUNET_OK; | ||
853 | } | ||
854 | if (ret != SQLITE_DONE) | ||
855 | { | ||
856 | LOG_SQLITE (plugin, NULL, | ||
857 | GNUNET_ERROR_TYPE_ERROR | | ||
858 | GNUNET_ERROR_TYPE_BULK, | ||
859 | "sqlite3_step"); | ||
860 | return GNUNET_SYSERR; | ||
861 | } | ||
862 | if (SQLITE_OK != sqlite3_reset (stmt_2)) | ||
863 | LOG_SQLITE (plugin, NULL, | ||
864 | GNUNET_ERROR_TYPE_ERROR | | ||
865 | GNUNET_ERROR_TYPE_BULK, | ||
866 | "sqlite3_reset"); | ||
867 | } | ||
868 | datum = NULL; | ||
869 | if (datum_1 == NULL) | ||
870 | { | ||
871 | datum = datum_2; | ||
872 | rowid = rowid_2; | ||
873 | key = key_2; | ||
874 | } | ||
875 | else if (datum_2 == NULL) | ||
876 | { | 835 | { |
877 | datum = datum_1; | 836 | nc->stmt = ic->stmt_2; |
878 | rowid = rowid_1; | 837 | return GNUNET_OK; |
879 | key = key_1; | ||
880 | } | ||
881 | else | ||
882 | { | ||
883 | /* have to pick between 1 and 2 */ | ||
884 | if (is_prio) | ||
885 | { | ||
886 | if ((ntohl (datum_1->priority) < ntohl (datum_2->priority)) == | ||
887 | is_asc) | ||
888 | { | ||
889 | datum = datum_1; | ||
890 | rowid = rowid_1; | ||
891 | key = key_1; | ||
892 | last_datum_2 = datum_2; | ||
893 | } | ||
894 | else | ||
895 | { | ||
896 | datum = datum_2; | ||
897 | rowid = rowid_2; | ||
898 | key = key_2; | ||
899 | GNUNET_free (datum_1); | ||
900 | } | ||
901 | } | ||
902 | else | ||
903 | { | ||
904 | if ((GNUNET_ntohll (datum_1->expiration_time) < | ||
905 | GNUNET_ntohll (datum_2->expiration_time)) == is_asc) | ||
906 | { | ||
907 | datum = datum_1; | ||
908 | rowid = rowid_1; | ||
909 | key = key_1; | ||
910 | last_datum_2 = datum_2; | ||
911 | } | ||
912 | else | ||
913 | { | ||
914 | datum = datum_2; | ||
915 | rowid = rowid_2; | ||
916 | key = key_2; | ||
917 | GNUNET_free (datum_1); | ||
918 | } | ||
919 | } | ||
920 | } | 838 | } |
921 | if (datum == NULL) | 839 | if (ret != SQLITE_DONE) |
922 | break; | ||
923 | #if 0 | ||
924 | printf ("FOUND %4u prio %4u exp %20llu old: %4u, %20llu\n", | ||
925 | (ntohl (datum->size) - sizeof (GNUNET_DatastoreValue)), | ||
926 | ntohl (datum->priority), | ||
927 | GNUNET_ntohll (datum->expiration_time), lastPrio, lastExp); | ||
928 | #endif | ||
929 | if (((GNUNET_NO == limit_nonanonymous) || | ||
930 | (ntohl (datum->anonymity_level) == 0)) && | ||
931 | ((type == GNUNET_ECRS_BLOCKTYPE_ANY) || | ||
932 | (type == ntohl (datum->type)))) | ||
933 | { | 840 | { |
934 | count++; | 841 | LOG_SQLITE (plugin, NULL, |
935 | if (iter != NULL) | 842 | GNUNET_ERROR_TYPE_ERROR | |
936 | { | 843 | GNUNET_ERROR_TYPE_BULK, |
937 | ret = iter (&key, datum, closure, rowid); | 844 | "sqlite3_step"); |
938 | if (ret == GNUNET_SYSERR) | 845 | return GNUNET_SYSERR; |
939 | { | ||
940 | GNUNET_free (datum); | ||
941 | break; | ||
942 | } | ||
943 | if (ret == GNUNET_NO) | ||
944 | { | ||
945 | payload -= getContentDatastoreSize (datum); | ||
946 | delete_by_rowid (handle, rowid); | ||
947 | } | ||
948 | } | ||
949 | } | 846 | } |
847 | if (SQLITE_OK != sqlite3_reset (ic->stmt_2)) | ||
848 | LOG_SQLITE (plugin, NULL, | ||
849 | GNUNET_ERROR_TYPE_ERROR | | ||
850 | GNUNET_ERROR_TYPE_BULK, | ||
851 | "sqlite3_reset"); | ||
852 | return GNUNET_NO; | ||
950 | } | 853 | } |
951 | 854 | ||
952 | 855 | ||
@@ -1070,8 +973,13 @@ sqlite_plugin_iter_zero_anonymity (void *cls, | |||
1070 | PluginIterator iter, | 973 | PluginIterator iter, |
1071 | void *iter_cls) | 974 | void *iter_cls) |
1072 | { | 975 | { |
1073 | static struct GNUNET_TIME_Absolute zero; | 976 | basic_iter (cls, |
1074 | iter (iter_cls, NULL, NULL, 0, NULL, 0, 0, 0, zero, 0); | 977 | type, |
978 | GNUNET_NO, GNUNET_YES, | ||
979 | GNUNET_NO, GNUNET_YES, | ||
980 | SELECT_IT_NON_ANONYMOUS_1, | ||
981 | SELECT_IT_NON_ANONYMOUS_2, | ||
982 | iter, iter_cls); | ||
1075 | } | 983 | } |
1076 | 984 | ||
1077 | 985 | ||
@@ -1092,10 +1000,24 @@ sqlite_plugin_iter_ascending_expiration (void *cls, | |||
1092 | PluginIterator iter, | 1000 | PluginIterator iter, |
1093 | void *iter_cls) | 1001 | void *iter_cls) |
1094 | { | 1002 | { |
1095 | static struct GNUNET_TIME_Absolute zero; | 1003 | struct GNUNET_TIME_Absolute now; |
1096 | iter (iter_cls, NULL, NULL, 0, NULL, 0, 0, 0, zero, 0); | 1004 | char *q1; |
1097 | } | 1005 | char *q2; |
1098 | 1006 | ||
1007 | now = GNUNET_TIME_absolute_get (); | ||
1008 | GNUNET_asprintf (&q1, SELECT_IT_EXPIRATION_TIME_1, | ||
1009 | now.value); | ||
1010 | GNUNET_asprintf (&q2, SELECT_IT_EXPIRATION_TIME_2, | ||
1011 | now.value); | ||
1012 | basic_iter (cls, | ||
1013 | type, | ||
1014 | GNUNET_YES, GNUNET_NO, | ||
1015 | GNUNET_NO, GNUNET_NO, | ||
1016 | q1, q2, | ||
1017 | iter, iter_cls); | ||
1018 | GNUNET_free (q1); | ||
1019 | GNUNET_free (q2); | ||
1020 | } | ||
1099 | 1021 | ||
1100 | 1022 | ||
1101 | /** | 1023 | /** |
@@ -1114,8 +1036,20 @@ sqlite_plugin_iter_migration_order (void *cls, | |||
1114 | PluginIterator iter, | 1036 | PluginIterator iter, |
1115 | void *iter_cls) | 1037 | void *iter_cls) |
1116 | { | 1038 | { |
1117 | static struct GNUNET_TIME_Absolute zero; | 1039 | struct GNUNET_TIME_Absolute now; |
1118 | iter (iter_cls, NULL, NULL, 0, NULL, 0, 0, 0, zero, 0); | 1040 | char *q; |
1041 | |||
1042 | now = GNUNET_TIME_absolute_get (); | ||
1043 | GNUNET_asprintf (&q, SELECT_IT_MIGRATION_ORDER_2, | ||
1044 | now.value); | ||
1045 | basic_iter (cls, | ||
1046 | type, | ||
1047 | GNUNET_NO, GNUNET_NO, | ||
1048 | GNUNET_YES, GNUNET_NO, | ||
1049 | SELECT_IT_MIGRATION_ORDER_1, | ||
1050 | q, | ||
1051 | iter, iter_cls); | ||
1052 | GNUNET_free (q); | ||
1119 | } | 1053 | } |
1120 | 1054 | ||
1121 | 1055 | ||
diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c index 0b08cfe8f..b4da05fda 100644 --- a/src/datastore/test_datastore_api.c +++ b/src/datastore/test_datastore_api.c | |||
@@ -37,6 +37,8 @@ static struct GNUNET_DATASTORE_Handle *datastore; | |||
37 | 37 | ||
38 | static struct GNUNET_TIME_Absolute now; | 38 | static struct GNUNET_TIME_Absolute now; |
39 | 39 | ||
40 | static int ok; | ||
41 | |||
40 | 42 | ||
41 | static size_t | 43 | static size_t |
42 | get_size (int i) | 44 | get_size (int i) |
@@ -84,13 +86,47 @@ get_expiration (int i) | |||
84 | return av; | 86 | return av; |
85 | } | 87 | } |
86 | 88 | ||
89 | enum RunPhase | ||
90 | { | ||
91 | RP_DONE = 0, | ||
92 | RP_PUT, | ||
93 | RP_GET, | ||
94 | RP_DEL, | ||
95 | RP_DELVALIDATE | ||
96 | }; | ||
97 | |||
98 | |||
99 | struct CpsRunContext | ||
100 | { | ||
101 | GNUNET_HashCode key; | ||
102 | int i; | ||
103 | int *iptr; | ||
104 | struct GNUNET_SCHEDULER_Handle *sched; | ||
105 | struct GNUNET_CONFIGURATION_Handle *cfg; | ||
106 | enum RunPhase phase; | ||
107 | }; | ||
108 | |||
109 | |||
110 | static void | ||
111 | run_continuation (void *cls, | ||
112 | const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
113 | |||
87 | 114 | ||
88 | static void | 115 | static void |
89 | check_success (void *cls, | 116 | check_success (void *cls, |
90 | int success, | 117 | int success, |
91 | const char *msg) | 118 | const char *msg) |
92 | { | 119 | { |
120 | struct CpsRunContext *crc = cls; | ||
121 | if (GNUNET_OK != success) | ||
122 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
123 | "%s\n", msg); | ||
93 | GNUNET_assert (GNUNET_OK == success); | 124 | GNUNET_assert (GNUNET_OK == success); |
125 | GNUNET_SCHEDULER_add_continuation (crc->sched, | ||
126 | GNUNET_NO, | ||
127 | &run_continuation, | ||
128 | crc, | ||
129 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
94 | } | 130 | } |
95 | 131 | ||
96 | 132 | ||
@@ -99,8 +135,14 @@ check_failure (void *cls, | |||
99 | int success, | 135 | int success, |
100 | const char *msg) | 136 | const char *msg) |
101 | { | 137 | { |
138 | struct CpsRunContext *crc = cls; | ||
102 | GNUNET_assert (GNUNET_OK != success); | 139 | GNUNET_assert (GNUNET_OK != success); |
103 | GNUNET_assert (NULL != msg); | 140 | GNUNET_assert (NULL != msg); |
141 | GNUNET_SCHEDULER_add_continuation (crc->sched, | ||
142 | GNUNET_NO, | ||
143 | &run_continuation, | ||
144 | crc, | ||
145 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
104 | } | 146 | } |
105 | 147 | ||
106 | 148 | ||
@@ -115,18 +157,23 @@ check_value (void *cls, | |||
115 | struct GNUNET_TIME_Absolute | 157 | struct GNUNET_TIME_Absolute |
116 | expiration, uint64_t uid) | 158 | expiration, uint64_t uid) |
117 | { | 159 | { |
118 | int *iptr = cls; | 160 | struct CpsRunContext *crc = cls; |
119 | int i; | 161 | int i; |
120 | 162 | ||
121 | if (key == NULL) | 163 | if (key == NULL) |
122 | return; | 164 | return; |
123 | i = *iptr; | 165 | i = crc->i; |
124 | GNUNET_assert (size == get_size (i)); | 166 | GNUNET_assert (size == get_size (i)); |
125 | GNUNET_assert (0 == memcmp (data, get_data(i), size)); | 167 | GNUNET_assert (0 == memcmp (data, get_data(i), size)); |
126 | GNUNET_assert (type == get_type (i)); | 168 | GNUNET_assert (type == get_type (i)); |
127 | GNUNET_assert (priority == get_priority (i)); | 169 | GNUNET_assert (priority == get_priority (i)); |
128 | GNUNET_assert (anonymity == get_anonymity(i)); | 170 | GNUNET_assert (anonymity == get_anonymity(i)); |
129 | GNUNET_assert (expiration.value == get_expiration(i).value); | 171 | GNUNET_assert (expiration.value == get_expiration(i).value); |
172 | GNUNET_SCHEDULER_add_continuation (crc->sched, | ||
173 | GNUNET_NO, | ||
174 | &run_continuation, | ||
175 | crc, | ||
176 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
130 | } | 177 | } |
131 | 178 | ||
132 | 179 | ||
@@ -141,6 +188,7 @@ delete_value (void *cls, | |||
141 | struct GNUNET_TIME_Absolute | 188 | struct GNUNET_TIME_Absolute |
142 | expiration, uint64_t uid) | 189 | expiration, uint64_t uid) |
143 | { | 190 | { |
191 | struct CpsRunContext *crc = cls; | ||
144 | if (key == NULL) | 192 | if (key == NULL) |
145 | return; | 193 | return; |
146 | GNUNET_DATASTORE_remove (datastore, | 194 | GNUNET_DATASTORE_remove (datastore, |
@@ -156,6 +204,11 @@ delete_value (void *cls, | |||
156 | data, | 204 | data, |
157 | &check_failure, | 205 | &check_failure, |
158 | NULL); | 206 | NULL); |
207 | GNUNET_SCHEDULER_add_continuation (crc->sched, | ||
208 | GNUNET_NO, | ||
209 | &run_continuation, | ||
210 | crc, | ||
211 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
159 | } | 212 | } |
160 | 213 | ||
161 | 214 | ||
@@ -171,78 +224,112 @@ check_nothing (void *cls, | |||
171 | struct GNUNET_TIME_Absolute | 224 | struct GNUNET_TIME_Absolute |
172 | expiration, uint64_t uid) | 225 | expiration, uint64_t uid) |
173 | { | 226 | { |
227 | struct CpsRunContext *crc = cls; | ||
174 | GNUNET_assert (key == NULL); | 228 | GNUNET_assert (key == NULL); |
229 | GNUNET_SCHEDULER_add_continuation (crc->sched, | ||
230 | GNUNET_NO, | ||
231 | &run_continuation, | ||
232 | crc, | ||
233 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
175 | } | 234 | } |
176 | 235 | ||
177 | 236 | ||
178 | |||
179 | static void | 237 | static void |
180 | run (void *cls, | 238 | run_continuation (void *cls, |
181 | struct GNUNET_SCHEDULER_Handle *sched, | 239 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
182 | char *const *args, | ||
183 | const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) | ||
184 | { | 240 | { |
185 | GNUNET_HashCode key; | 241 | struct CpsRunContext *crc = cls; |
186 | int i; | 242 | ok = (int) crc->phase; |
187 | int *iptr; | 243 | switch (crc->phase) |
188 | |||
189 | datastore = GNUNET_DATASTORE_connect (cfg, sched); | ||
190 | now.value = 1000000; | ||
191 | for (i = 0; i < 256; i++) | ||
192 | { | 244 | { |
193 | memset (&key, 256 - i, sizeof (GNUNET_HashCode)); | 245 | case RP_PUT: |
246 | memset (&crc->key, 256 - crc->i, sizeof (GNUNET_HashCode)); | ||
194 | GNUNET_DATASTORE_put (datastore, | 247 | GNUNET_DATASTORE_put (datastore, |
195 | 0, | 248 | 0, |
196 | &key, | 249 | &crc->key, |
197 | get_size (i), | 250 | get_size (crc->i), |
198 | get_data (i), | 251 | get_data (crc->i), |
199 | get_type (i), | 252 | get_type (crc->i), |
200 | get_priority (i), | 253 | get_priority (crc->i), |
201 | get_anonymity (i), | 254 | get_anonymity (crc->i), |
202 | get_expiration (i), | 255 | get_expiration (crc->i), |
203 | &check_success, | 256 | &check_success, |
204 | NULL); | 257 | crc); |
205 | } | 258 | crc->i++; |
206 | for (i = 255; i >= 0; i--) | 259 | if (crc->i == 256) |
207 | { | 260 | crc->phase = RP_GET; |
208 | memset (&key, 256 - i, sizeof (GNUNET_HashCode)); | 261 | break; |
209 | iptr = GNUNET_malloc(sizeof(int)); | 262 | case RP_GET: |
210 | *iptr = i; | 263 | crc->i--; |
264 | memset (&crc->key, 256 - crc->i, sizeof (GNUNET_HashCode)); | ||
211 | GNUNET_DATASTORE_get (datastore, | 265 | GNUNET_DATASTORE_get (datastore, |
212 | &key, | 266 | &crc->key, |
213 | get_type (i), | 267 | get_type (crc->i), |
214 | &check_value, | 268 | &check_value, |
215 | iptr); | 269 | crc); |
216 | } | 270 | if (crc->i == 0) |
217 | for (i = 255; i >= 0; i--) | 271 | { |
218 | { | 272 | crc->phase = RP_DEL; |
219 | memset (&key, 256 - i, sizeof (GNUNET_HashCode)); | 273 | crc->i = 256; |
220 | iptr = GNUNET_malloc(sizeof(int)); | 274 | } |
221 | *iptr = i; | 275 | break; |
276 | case RP_DEL: | ||
277 | crc->i--; | ||
278 | memset (&crc->key, 256 - crc->i, sizeof (GNUNET_HashCode)); | ||
222 | GNUNET_DATASTORE_get (datastore, | 279 | GNUNET_DATASTORE_get (datastore, |
223 | &key, | 280 | &crc->key, |
224 | get_type (i), | 281 | get_type (crc->i), |
225 | &delete_value, | 282 | &delete_value, |
226 | iptr); | 283 | crc); |
227 | } | 284 | if (crc->i == 0) |
228 | for (i = 255; i >= 0; i--) | 285 | { |
229 | { | 286 | crc->phase = RP_DELVALIDATE; |
230 | memset (&key, 256 - i, sizeof (GNUNET_HashCode)); | 287 | crc->i = 256; |
231 | iptr = GNUNET_malloc(sizeof(int)); | 288 | } |
232 | *iptr = i; | 289 | break; |
290 | case RP_DELVALIDATE: | ||
291 | crc->i--; | ||
292 | memset (&crc->key, 256 - crc->i, sizeof (GNUNET_HashCode)); | ||
233 | GNUNET_DATASTORE_get (datastore, | 293 | GNUNET_DATASTORE_get (datastore, |
234 | &key, | 294 | &crc->key, |
235 | get_type (i), | 295 | get_type (crc->i), |
236 | &check_nothing, | 296 | &check_nothing, |
237 | iptr); | 297 | crc); |
238 | } | 298 | if (crc->i == 0) |
299 | { | ||
300 | crc->phase = RP_DONE; | ||
301 | } | ||
302 | break; | ||
239 | /* check reservations */ | 303 | /* check reservations */ |
240 | |||
241 | /* check update */ | 304 | /* check update */ |
242 | |||
243 | /* test multiple results */ | 305 | /* test multiple results */ |
306 | case RP_DONE: | ||
307 | GNUNET_DATASTORE_disconnect (datastore, GNUNET_YES); | ||
308 | ok = 0; | ||
309 | } | ||
310 | } | ||
311 | |||
312 | |||
313 | static void | ||
314 | run (void *cls, | ||
315 | struct GNUNET_SCHEDULER_Handle *sched, | ||
316 | char *const *args, | ||
317 | const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg) | ||
318 | { | ||
319 | struct CpsRunContext *crc; | ||
320 | |||
321 | crc = GNUNET_malloc(sizeof(struct CpsRunContext)); | ||
322 | crc->sched = sched; | ||
323 | crc->cfg = cfg; | ||
324 | crc->phase = RP_PUT; | ||
325 | now.value = 1000000; | ||
326 | datastore = GNUNET_DATASTORE_connect (cfg, sched); | ||
327 | GNUNET_SCHEDULER_add_continuation (crc->sched, | ||
328 | GNUNET_NO, | ||
329 | &run_continuation, | ||
330 | crc, | ||
331 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
244 | 332 | ||
245 | GNUNET_DATASTORE_disconnect (datastore, GNUNET_YES); | ||
246 | } | 333 | } |
247 | 334 | ||
248 | 335 | ||
@@ -250,7 +337,6 @@ run (void *cls, | |||
250 | static int | 337 | static int |
251 | check () | 338 | check () |
252 | { | 339 | { |
253 | int ok = 1 + 2 + 4 + 8; | ||
254 | pid_t pid; | 340 | pid_t pid; |
255 | char *const argv[] = { "test-datastore-api", | 341 | char *const argv[] = { "test-datastore-api", |
256 | "-c", | 342 | "-c", |
@@ -272,7 +358,7 @@ check () | |||
272 | sleep (1); | 358 | sleep (1); |
273 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, | 359 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, |
274 | argv, "test-datastore-api", "nohelp", | 360 | argv, "test-datastore-api", "nohelp", |
275 | options, &run, &ok); | 361 | options, &run, NULL); |
276 | if (0 != PLIBC_KILL (pid, SIGTERM)) | 362 | if (0 != PLIBC_KILL (pid, SIGTERM)) |
277 | { | 363 | { |
278 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 364 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h index 10b2157d3..2dcc153e6 100644 --- a/src/include/gnunet_datastore_service.h +++ b/src/include/gnunet_datastore_service.h | |||
@@ -122,6 +122,7 @@ GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h, | |||
122 | * @param priority priority of the content | 122 | * @param priority priority of the content |
123 | * @param anonymity anonymity-level for the content | 123 | * @param anonymity anonymity-level for the content |
124 | * @param expiration expiration time for the content | 124 | * @param expiration expiration time for the content |
125 | * @param timeout timeout for the operation | ||
125 | * @param cont continuation to call when done | 126 | * @param cont continuation to call when done |
126 | * @param cont_cls closure for cont | 127 | * @param cont_cls closure for cont |
127 | */ | 128 | */ |
@@ -135,6 +136,7 @@ GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, | |||
135 | uint32_t priority, | 136 | uint32_t priority, |
136 | uint32_t anonymity, | 137 | uint32_t anonymity, |
137 | struct GNUNET_TIME_Absolute expiration, | 138 | struct GNUNET_TIME_Absolute expiration, |
139 | struct GNUNET_TIME_Relative timeout, | ||
138 | GNUNET_DATASTORE_ContinuationWithStatus cont, | 140 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
139 | void *cont_cls); | 141 | void *cont_cls); |
140 | 142 | ||
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 792f777ed..629e355ad 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -1683,7 +1683,7 @@ libgnunet_plugin_transport_tcp_init (void *cls) | |||
1683 | unsigned long long aport; | 1683 | unsigned long long aport; |
1684 | unsigned long long bport; | 1684 | unsigned long long bport; |
1685 | 1685 | ||
1686 | service = GNUNET_SERVICE_start ("tcp", env->sched, env->cfg); | 1686 | service = GNUNET_SERVICE_start ("transport-tcp", env->sched, env->cfg); |
1687 | if (service == NULL) | 1687 | if (service == NULL) |
1688 | { | 1688 | { |
1689 | GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, | 1689 | GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, |
@@ -1696,13 +1696,13 @@ libgnunet_plugin_transport_tcp_init (void *cls) | |||
1696 | aport = 0; | 1696 | aport = 0; |
1697 | if ((GNUNET_OK != | 1697 | if ((GNUNET_OK != |
1698 | GNUNET_CONFIGURATION_get_value_number (env->cfg, | 1698 | GNUNET_CONFIGURATION_get_value_number (env->cfg, |
1699 | "tcp", | 1699 | "transport-tcp", |
1700 | "PORT", | 1700 | "PORT", |
1701 | &bport)) || | 1701 | &bport)) || |
1702 | (bport > 65535) || | 1702 | (bport > 65535) || |
1703 | ((GNUNET_OK == | 1703 | ((GNUNET_OK == |
1704 | GNUNET_CONFIGURATION_get_value_number (env->cfg, | 1704 | GNUNET_CONFIGURATION_get_value_number (env->cfg, |
1705 | "tcp", | 1705 | "transport-tcp", |
1706 | "ADVERTISED-PORT", | 1706 | "ADVERTISED-PORT", |
1707 | &aport)) && (aport > 65535))) | 1707 | &aport)) && (aport > 65535))) |
1708 | { | 1708 | { |
@@ -1710,7 +1710,7 @@ libgnunet_plugin_transport_tcp_init (void *cls) | |||
1710 | "tcp", | 1710 | "tcp", |
1711 | _ | 1711 | _ |
1712 | ("Require valid port number for service `%s' in configuration!\n"), | 1712 | ("Require valid port number for service `%s' in configuration!\n"), |
1713 | "tcp"); | 1713 | "transport-tcp"); |
1714 | GNUNET_SERVICE_stop (service); | 1714 | GNUNET_SERVICE_stop (service); |
1715 | return NULL; | 1715 | return NULL; |
1716 | } | 1716 | } |
diff --git a/src/transport/test_transport_api_data.conf b/src/transport/test_transport_api_data.conf index 0fa611350..518f0d09d 100644 --- a/src/transport/test_transport_api_data.conf +++ b/src/transport/test_transport_api_data.conf | |||
@@ -14,7 +14,7 @@ PORT = 2366 | |||
14 | [statistics] | 14 | [statistics] |
15 | PORT = 2367 | 15 | PORT = 2367 |
16 | 16 | ||
17 | [tcp] | 17 | [transport-tcp] |
18 | PORT = 2368 | 18 | PORT = 2368 |
19 | 19 | ||
20 | [peerinfo] | 20 | [peerinfo] |
diff --git a/src/transport/test_transport_api_peer1.conf b/src/transport/test_transport_api_peer1.conf index dcc0ab4cf..46d7ceec9 100644 --- a/src/transport/test_transport_api_peer1.conf +++ b/src/transport/test_transport_api_peer1.conf | |||
@@ -15,7 +15,7 @@ PORT = 12366 | |||
15 | [statistics] | 15 | [statistics] |
16 | PORT = 12367 | 16 | PORT = 12367 |
17 | 17 | ||
18 | [tcp] | 18 | [transport-tcp] |
19 | PORT = 12368 | 19 | PORT = 12368 |
20 | 20 | ||
21 | [peerinfo] | 21 | [peerinfo] |
diff --git a/src/transport/test_transport_api_peer2.conf b/src/transport/test_transport_api_peer2.conf index 8567c6ac8..f980fbe1b 100644 --- a/src/transport/test_transport_api_peer2.conf +++ b/src/transport/test_transport_api_peer2.conf | |||
@@ -15,7 +15,7 @@ PORT = 22366 | |||
15 | [statistics] | 15 | [statistics] |
16 | PORT = 22367 | 16 | PORT = 22367 |
17 | 17 | ||
18 | [tcp] | 18 | [transport-tcp] |
19 | PORT = 22368 | 19 | PORT = 22368 |
20 | 20 | ||
21 | [peerinfo] | 21 | [peerinfo] |
diff --git a/src/util/disk.c b/src/util/disk.c index df6e5df8a..a7e4a0865 100644 --- a/src/util/disk.c +++ b/src/util/disk.c | |||
@@ -981,16 +981,19 @@ GNUNET_DISK_file_open (const char *fn, int flags, ...) | |||
981 | char *expfn; | 981 | char *expfn; |
982 | struct GNUNET_IO_Handle *ret; | 982 | struct GNUNET_IO_Handle *ret; |
983 | #ifdef MINGW | 983 | #ifdef MINGW |
984 | DWORD access, disp; | 984 | DWORD access; |
985 | DWORD disp; | ||
985 | HANDLE h; | 986 | HANDLE h; |
986 | #else | 987 | #else |
987 | int oflags, mode; | 988 | int oflags; |
989 | int mode; | ||
988 | int fd; | 990 | int fd; |
989 | #endif | 991 | #endif |
990 | 992 | ||
991 | expfn = GNUNET_STRINGS_filename_expand (fn); | 993 | expfn = GNUNET_STRINGS_filename_expand (fn); |
992 | 994 | ||
993 | #ifndef MINGW | 995 | #ifndef MINGW |
996 | mode = 0; | ||
994 | oflags = 0; | 997 | oflags = 0; |
995 | if (GNUNET_DISK_OPEN_READWRITE == (flags & GNUNET_DISK_OPEN_READWRITE)) | 998 | if (GNUNET_DISK_OPEN_READWRITE == (flags & GNUNET_DISK_OPEN_READWRITE)) |
996 | oflags = O_RDWR; /* note: O_RDWR is NOT always O_RDONLY | O_WRONLY */ | 999 | oflags = O_RDWR; /* note: O_RDWR is NOT always O_RDONLY | O_WRONLY */ |
@@ -1020,7 +1023,6 @@ GNUNET_DISK_file_open (const char *fn, int flags, ...) | |||
1020 | perm = va_arg (arg, int); | 1023 | perm = va_arg (arg, int); |
1021 | va_end (arg); | 1024 | va_end (arg); |
1022 | 1025 | ||
1023 | mode = 0; | ||
1024 | if (perm & GNUNET_DISK_PERM_USER_READ) | 1026 | if (perm & GNUNET_DISK_PERM_USER_READ) |
1025 | mode |= S_IRUSR; | 1027 | mode |= S_IRUSR; |
1026 | if (perm & GNUNET_DISK_PERM_USER_WRITE) | 1028 | if (perm & GNUNET_DISK_PERM_USER_WRITE) |