diff options
author | David Barksdale <amatus@amat.us> | 2020-01-19 18:44:45 -0600 |
---|---|---|
committer | David Barksdale <amatus@amat.us> | 2020-01-19 18:44:45 -0600 |
commit | 421d0471e8b1a9bb21d6cd25892a3c2b3b8af5bc (patch) | |
tree | 2a04d8d15dafcbcc5b224b56c3e2a55679276758 | |
parent | a08675381220cadf62cede4017177f921e4e215b (diff) |
Update emscripten to 1.39.6
23 files changed, 177 insertions, 127 deletions
diff --git a/gnunet-build/packages/build-utils/emscripten-fastcomp/Buildrules b/gnunet-build/packages/build-utils/emscripten-fastcomp/Buildrules index 6032f13..fbb5a60 100644 --- a/gnunet-build/packages/build-utils/emscripten-fastcomp/Buildrules +++ b/gnunet-build/packages/build-utils/emscripten-fastcomp/Buildrules @@ -1,8 +1,8 @@ -VERSION="1.37.28" +VERSION="1.39.6" DESCRIPTION="LLVM with the emscripten fastcomp javascript backend." SOURCE_URI=" -git://github.com/kripken/${NAME}.git?${VERSION}&archive=${NAME}-${VERSION}.${ARCHIVE_FORMAT} -git://github.com/kripken/${NAME}-clang.git?${VERSION}&archive=${NAME}-clang-${VERSION}.${ARCHIVE_FORMAT} +git://github.com/emscripten-core/${NAME}.git?${VERSION}&archive=${NAME}-${VERSION}.${ARCHIVE_FORMAT} +git://github.com/emscripten-core/${NAME}-clang.git?${VERSION}&archive=${NAME}-clang-${VERSION}.${ARCHIVE_FORMAT} " pkg_prep() diff --git a/gnunet-build/packages/build-utils/emscripten/Buildrules b/gnunet-build/packages/build-utils/emscripten/Buildrules index bf0d525..5011d43 100644 --- a/gnunet-build/packages/build-utils/emscripten/Buildrules +++ b/gnunet-build/packages/build-utils/emscripten/Buildrules @@ -1,6 +1,6 @@ -VERSION="1.37.28" +VERSION="1.39.6" DESCRIPTION="Emscripten is an LLVM-to-JavaScript compiler." -SOURCE_URI="git://github.com/kripken/${NAME}.git?${VERSION}&archive=${NAME}-${VERSION}.${ARCHIVE_FORMAT}" +SOURCE_URI="git://github.com/emscripten-core/${NAME}.git?${VERSION}&archive=${NAME}-${VERSION}.${ARCHIVE_FORMAT}" RDEPENDS="build-utils/emscripten-fastcomp build-utils/node" pkg_compile() { @@ -22,6 +22,7 @@ TEMP_DIR = os.path.expanduser(os.getenv('TEMP_DIR')) CRUNCH = os.path.expanduser(os.getenv('CRUNCH') or 'crunch') COMPILER_ENGINE = NODE_JS JS_ENGINES = [NODE_JS] +BINARYEN_ROOT = '/no_binaryen' EOF } diff --git a/gnunet-build/packages/gnunet/gnunet/Buildrules b/gnunet-build/packages/gnunet/gnunet/Buildrules index b8423d4..07fb822 100644 --- a/gnunet-build/packages/gnunet/gnunet/Buildrules +++ b/gnunet-build/packages/gnunet/gnunet/Buildrules @@ -13,7 +13,8 @@ BDEPENDS="${BDEPENDS} " pkg_compile() { - cp "${F}/scheduler.c" "${S}/src/util/" + cp "${F}/scheduler_em.c" \ + "${S}/src/util/" cp "${F}/plugin_transport_http_client_emscripten.c" \ "${S}/src/transport/" cp "${F}/plugin_transport_webrtc.c" \ @@ -23,12 +24,14 @@ pkg_compile() { cp "${F}/plugin_datastore_emscripten.c" \ "${S}/src/datastore/" export TEMP_DIR="${T}" + export LDFLAGS="${LDFLAGS} -s NO_WASM -L${SYSROOT}/usr/lib" ./bootstrap EMCONFIGURE_JS=1 emconfigure ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --with-libgcrypt-prefix="${SYSROOT}/usr" \ --without-libcurl \ + --without-ltdl \ --disable-testing \ --disable-nls \ --disable-documentation \ @@ -37,9 +40,11 @@ pkg_compile() { ac_cv_func_srandom=no \ ac_cv_func_getifaddrs=yes \ ac_cv_lib_socket_socket=no \ + ac_cv_search___atomic_load_8=no \ + ac_cv_search_memset_s=no \ CPPFLAGS="-I${SYSROOT}/usr/include" \ - LDFLAGS="-L${SYSROOT}/usr/lib" - emmake make LDFLAGS="${LDFLAGS} -Wc,--ignore-dynamic-linking" + LDFLAGS="${LDFLAGS}" + emmake make LDFLAGS="${LDFLAGS} -Wc,--ignore-dynamic-linking" V=1 mkdir -p "${D}/var/lib/gnunet/js" OPT_LEVEL="-O2" # @@ -48,7 +53,8 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ - -s SIDE_MODULE=1 \ + ${LDFLAGS} \ + -s SIDE_MODULE \ -s EXPORTED_FUNCTIONS='["_libgnunet_plugin_block_dht_init"]' \ "-I${SYSROOT}/usr/include" "-L${SYSROOT}/usr/lib" \ -o "${S}/src/dht/libgnunet_plugin_block_dht.js" \ @@ -56,7 +62,8 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ - -s SIDE_MODULE=1 \ + ${LDFLAGS} \ + -s SIDE_MODULE \ -s EXPORTED_FUNCTIONS='["_libgnunet_plugin_block_fs_init"]' \ "-I${SYSROOT}/usr/include" "-L${SYSROOT}/usr/lib" \ -o "${S}/src/fs/libgnunet_plugin_block_fs.js" \ @@ -70,6 +77,8 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ + ${LDFLAGS} \ + -s ALLOW_MEMORY_GROWTH \ -s EXPORTED_FUNCTIONS=@"${F}/imports" \ --memory-init-file 1 \ --use-preload-plugins \ @@ -82,6 +91,7 @@ pkg_compile() { "${SYSROOT}/usr/lib/libgcrypt.la" \ "${SYSROOT}/usr/lib/libgpg-error.la" \ -lz \ + -lidbfs.js \ --js-library "${F}/configuration.js" \ --js-library "${F}/network.js" \ --js-library "${F}/scheduler.js" \ @@ -95,7 +105,8 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ - -s SIDE_MODULE=1 \ + ${LDFLAGS} \ + -s SIDE_MODULE \ -s EXPORTED_FUNCTIONS='[ "_libgnunet_plugin_datacache_heap_init" ]' \ @@ -110,9 +121,10 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ - -s SIDE_MODULE=1 \ + ${LDFLAGS} \ + -s SIDE_MODULE \ -s EXPORTED_FUNCTIONS='[ - "_libgnunet_plugin_datastore_emscripten_init", + "_libgnunet_plugin_datastore_emscripten_init" ]' \ "-I${SYSROOT}/usr/include" "-L${SYSROOT}/usr/lib" \ -o "${S}/src/datastore/libgnunet_plugin_datastore_emscripten.js" \ @@ -120,11 +132,12 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ - -s MAIN_MODULE=1 \ - -s EXPORTED_FUNCTIONS=@"${F}/imports" \ + ${LDFLAGS} \ + -s MAIN_MODULE \ + -s EXPORT_ALL \ + -s TOTAL_MEMORY=$((80 * 1024 * 1024)) \ --memory-init-file 1 \ --use-preload-plugins \ - -s TOTAL_MEMORY=$((80 * 1024 * 1024)) \ "-I${SYSROOT}/usr/include" "-L${SYSROOT}/usr/lib" \ -o "${S}/src/datastore/gnunet-service-datastore.js" \ "${S}/src/datastore/gnunet-service-datastore.o" \ @@ -132,6 +145,7 @@ pkg_compile() { "${S}/src/util/libgnunetutil.la" \ "${SYSROOT}/usr/lib/libgcrypt.la" \ "${SYSROOT}/usr/lib/libgpg-error.la" \ + -lidbfs.js \ --js-library "${F}/configuration.js" \ --js-library "${F}/network.js" \ --js-library "${F}/plugin.js" \ @@ -149,7 +163,8 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ - -s SIDE_MODULE=1 \ + ${LDFLAGS} \ + -s SIDE_MODULE \ -s EXPORTED_FUNCTIONS='[ "_libgnunet_plugin_ats_proportional_init" ]' \ @@ -159,14 +174,16 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ - -s MAIN_MODULE=1 \ - -s EXPORTED_FUNCTIONS=@"${F}/imports" \ + ${LDFLAGS} \ + -s MAIN_MODULE \ + -s EXPORT_ALL \ --memory-init-file 1 \ --use-preload-plugins \ "-I${SYSROOT}/usr/include" "-L${SYSROOT}/usr/lib" \ -o "${S}/src/ats/gnunet-service-ats.js" \ "${S}/src/ats/gnunet-service-ats"*.o \ "${S}/src/ats/libgnunetats.la" \ + "${S}/src/nt/libgnunetnt.la" \ "${S}/src/statistics/libgnunetstatistics.la" \ "${S}/src/util/libgnunetutil.la" \ "${SYSROOT}/usr/lib/libgcrypt.la" \ @@ -187,9 +204,10 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ - -s SIDE_MODULE=1 \ + ${LDFLAGS} \ + -s SIDE_MODULE \ -s EXPORTED_FUNCTIONS='[ - "_libgnunet_plugin_transport_http_client_init", + "_libgnunet_plugin_transport_http_client_init" ]' \ "-I${SYSROOT}/usr/include" "-L${SYSROOT}/usr/lib" \ -o "${S}/src/transport/libgnunet_plugin_transport_http_client.js" \ @@ -198,26 +216,31 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ - -s SIDE_MODULE=1 \ + ${LDFLAGS} \ + -s SIDE_MODULE \ -s EXPORTED_FUNCTIONS='[ - "_libgnunet_plugin_transport_webrtc_init", + "_libgnunet_plugin_transport_webrtc_init" ]' \ "-I${SYSROOT}/usr/include" "-L${SYSROOT}/usr/lib" \ -o "${S}/src/transport/libgnunet_plugin_transport_webrtc.js" \ - "${S}/src/transport/libgnunet_plugin_transport_webrtc_la-plugin_transport_webrtc.lo" + "${S}/src/transport/plugin_transport_webrtc.lo" ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ - -s MAIN_MODULE=1 \ - -s EXPORTED_FUNCTIONS=@"${F}/imports" \ + ${LDFLAGS} \ + -s MAIN_MODULE \ + -s EXPORT_ALL \ + -s TOTAL_MEMORY=$((32 * 1024 * 1024)) \ --memory-init-file 1 \ --use-preload-plugins \ "-I${SYSROOT}/usr/include" "-L${SYSROOT}/usr/lib" \ -o "${S}/src/transport/gnunet-service-transport.js" \ "${S}/src/transport/gnunet_service_transport-gnunet-service-transport"*.o \ "${S}/src/transport/libgnunettransport.la" \ + "${S}/src/cadet/libgnunetcadet.la" \ "${S}/src/ats/libgnunetats.la" \ "${S}/src/hello/libgnunethello.la" \ + "${S}/src/nt/libgnunetnt.la" \ "${S}/src/peerinfo/libgnunetpeerinfo.la" \ "${S}/src/statistics/libgnunetstatistics.la" \ "${S}/src/util/libgnunetutil.la" \ @@ -241,6 +264,8 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ + ${LDFLAGS} \ + -s ALLOW_MEMORY_GROWTH \ -s EXPORTED_FUNCTIONS=@"${F}/imports" \ --memory-init-file 1 \ --use-preload-plugins \ @@ -267,6 +292,8 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ + ${LDFLAGS} \ + -s ALLOW_MEMORY_GROWTH \ -s EXPORTED_FUNCTIONS=@"${F}/imports" \ --memory-init-file 1 \ --use-preload-plugins \ @@ -280,6 +307,7 @@ pkg_compile() { "${SYSROOT}/usr/lib/libgcrypt.la" \ "${SYSROOT}/usr/lib/libgpg-error.la" \ -lz \ + -lidbfs.js \ --js-library "${F}/configuration.js" \ --js-library "${F}/network.js" \ --js-library "${F}/scheduler.js" \ @@ -293,11 +321,12 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ - -s MAIN_MODULE=1 \ - -s EXPORTED_FUNCTIONS=@"${F}/imports" \ + ${LDFLAGS} \ + -s MAIN_MODULE \ + -s EXPORT_ALL \ + -s TOTAL_MEMORY=$((32 * 1024 * 1024)) \ --memory-init-file 1 \ --use-preload-plugins \ - -s TOTAL_MEMORY=$((32 * 1024 * 1024)) \ "-I${SYSROOT}/usr/include" "-L${SYSROOT}/usr/lib" \ -o "${S}/src/dht/gnunet-service-dht.js" \ "${S}/src/dht/gnunet-service-dht"*.o \ @@ -314,7 +343,6 @@ pkg_compile() { "${S}/src/util/libgnunetutil.la" \ "${SYSROOT}/usr/lib/libgcrypt.la" \ "${SYSROOT}/usr/lib/libgpg-error.la" \ - -lz \ --js-library "${F}/configuration.js" \ --js-library "${F}/network.js" \ --js-library "${F}/plugin.js" \ @@ -329,6 +357,8 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ + ${LDFLAGS} \ + -s ALLOW_MEMORY_GROWTH \ -s EXPORTED_FUNCTIONS=@"${F}/imports" \ --memory-init-file 1 \ --use-preload-plugins \ @@ -358,8 +388,9 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ - -s MAIN_MODULE=1 \ - -s EXPORTED_FUNCTIONS=@"${F}/imports" \ + ${LDFLAGS} \ + -s MAIN_MODULE \ + -s EXPORT_ALL \ --memory-init-file 1 \ --use-preload-plugins \ "-I${SYSROOT}/usr/include" "-L${SYSROOT}/usr/lib" \ @@ -376,7 +407,6 @@ pkg_compile() { "${S}/src/util/libgnunetutil.la" \ "${SYSROOT}/usr/lib/libgcrypt.la" \ "${SYSROOT}/usr/lib/libgpg-error.la" \ - -lz \ --js-library "${F}/configuration.js" \ --js-library "${F}/network.js" \ --js-library "${F}/plugin.js" \ @@ -391,9 +421,10 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ - -s SIDE_MODULE=1 \ + ${LDFLAGS} \ + -s SIDE_MODULE \ -s EXPORTED_FUNCTIONS='[ - "_libgnunet_plugin_peerstore_emscripten_init", + "_libgnunet_plugin_peerstore_emscripten_init" ]' \ "-I${SYSROOT}/usr/include" "-L${SYSROOT}/usr/lib" \ -o "${S}/src/peerstore/libgnunet_plugin_peerstore_emscripten.js" \ @@ -401,8 +432,9 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ - -s MAIN_MODULE=1 \ - -s EXPORTED_FUNCTIONS=@"${F}/imports" \ + ${LDFLAGS} \ + -s MAIN_MODULE \ + -s EXPORT_ALL \ --memory-init-file 1 \ --use-preload-plugins \ "-I${SYSROOT}/usr/include" "-L${SYSROOT}/usr/lib" \ @@ -428,11 +460,12 @@ pkg_compile() { ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ ${OPT_LEVEL} \ - -s MAIN_MODULE=1 \ - -s EXPORTED_FUNCTIONS=@"${F}/imports" \ + ${LDFLAGS} \ + -s MAIN_MODULE \ + -s EXPORT_ALL \ + -s TOTAL_MEMORY=$((32 * 1024 * 1024)) \ --memory-init-file 1 \ --use-preload-plugins \ - -s TOTAL_MEMORY=$((32 * 1024 * 1024)) \ "-I${SYSROOT}/usr/include" "-L${SYSROOT}/usr/lib" \ -o "${S}/src/fs/gnunet-service-fs.js" \ "${S}/src/fs/gnunet-service-fs"*.o \ @@ -449,7 +482,7 @@ pkg_compile() { "${S}/src/util/libgnunetutil.la" \ "${SYSROOT}/usr/lib/libgcrypt.la" \ "${SYSROOT}/usr/lib/libgpg-error.la" \ - -lz \ + -lidbfs.js \ --js-library "${F}/configuration.js" \ --js-library "${F}/network.js" \ --js-library "${F}/plugin.js" \ @@ -468,6 +501,8 @@ pkg_compile() { "${F}/client-lib.c" ./libtool --tag=CC --mode=link \ emcc -fno-strict-aliasing -Wall \ + ${LDFLAGS} \ + -s ALLOW_MEMORY_GROWTH \ -s EXPORTED_FUNCTIONS=@${F}/client-lib.exports \ -s RESERVED_FUNCTION_POINTERS=100 \ "-I${SYSROOT}/usr/include" "-L${SYSROOT}/usr/lib" \ diff --git a/gnunet-build/packages/gnunet/gnunet/files/client-lib.exports b/gnunet-build/packages/gnunet/gnunet/files/client-lib.exports index fee5472..5e1b621 100644 --- a/gnunet-build/packages/gnunet/gnunet/files/client-lib.exports +++ b/gnunet-build/packages/gnunet/gnunet/files/client-lib.exports @@ -38,8 +38,6 @@ "_GNUNET_FS_uri_parse", "_GNUNET_FS_uri_to_string", "_GNUNET_HELLO_get_id", -"_GNUNET_MQ_queue_for_connection_client", -"_GNUNET_SCHEDULER_run_task", "_GNUNET_STRINGS_data_to_string", "_GNUNET_TRANSPORT_hello_get", "_GNUNET_TRANSPORT_hello_get_cancel", diff --git a/gnunet-build/packages/gnunet/gnunet/files/client-pre.js b/gnunet-build/packages/gnunet/gnunet/files/client-pre.js index 5afee0d..db585cd 100644 --- a/gnunet-build/packages/gnunet/gnunet/files/client-pre.js +++ b/gnunet-build/packages/gnunet/gnunet/files/client-pre.js @@ -44,7 +44,7 @@ function ccallFunc(func, returnType, argTypes, args) { } } var ret = func.apply(null, cArgs); - if (returnType === 'string') ret = Pointer_stringify(ret); + if (returnType === 'string') ret = UTF8ToString(ret); if (stack !== 0) { stackRestore(stack); } diff --git a/gnunet-build/packages/gnunet/gnunet/files/configuration.js b/gnunet-build/packages/gnunet/gnunet/files/configuration.js index f227ec6..e9bab65 100644 --- a/gnunet-build/packages/gnunet/gnunet/files/configuration.js +++ b/gnunet-build/packages/gnunet/gnunet/files/configuration.js @@ -98,8 +98,8 @@ mergeInto(LibraryManager.library, { }, GNUNET_CONFIGURATION_get_value__deps: ['$CONFIG'], GNUNET_CONFIGURATION_get_value: function(section, option) { - var section = Pointer_stringify(section).toLowerCase(); - var option = Pointer_stringify(option).toUpperCase(); + var section = UTF8ToString(section).toLowerCase(); + var option = UTF8ToString(option).toUpperCase(); console.debug('GNUNET_CONFIGURATION_get_value(' + section + ',' + option + ')'); if (!(section in CONFIG)) { @@ -186,11 +186,11 @@ mergeInto(LibraryManager.library, { GNUNET_CONFIGURATION_iterate_section_values__deps: ['$CONFIG'], GNUNET_CONFIGURATION_iterate_section_values: function(cfg, section, iter, iter_cls) { - var section_name = Pointer_stringify(section); + var section_name = UTF8ToString(section); console.debug('GNUNET_CONFIGURATION_iterate_section_values(' + section_name + ')'); if (!(section_name in CONFIG)) { - Module.print(section_name + ' not in CONFIG'); + console.log(section_name + ' not in CONFIG'); return; } section = CONFIG[section_name]; @@ -202,9 +202,9 @@ mergeInto(LibraryManager.library, { } }, GNUNET_CONFIGURATION_set_value_string: function(cfg, section, option, value) { - var section_name = Pointer_stringify(section); - var option_str = Pointer_stringify(option); - var value_str = Pointer_stringify(value); + var section_name = UTF8ToString(section); + var option_str = UTF8ToString(option); + var value_str = UTF8ToString(value); if(!(section_name in CONFIG)) { CONFIG[section_name] = {} } diff --git a/gnunet-build/packages/gnunet/gnunet/files/gnunet-git-e8533c-all.patch b/gnunet-build/packages/gnunet/gnunet/files/gnunet-git-e8533c-all.patch index ffa4361..297fce7 100644 --- a/gnunet-build/packages/gnunet/gnunet/files/gnunet-git-e8533c-all.patch +++ b/gnunet-build/packages/gnunet/gnunet/files/gnunet-git-e8533c-all.patch @@ -1028,7 +1028,7 @@ index 4e8c8140d..7f75b2852 100644 olen = sizeof(uc); if ((0 == getsockopt (GNUNET_NETWORK_get_fd (sock), diff --git a/src/util/Makefile.am b/src/util/Makefile.am -index 387f22a9f..ae1ebd988 100644 +index 387f22a9f..a5622755b 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am @@ -43,8 +43,6 @@ libgnunetutil_la_SOURCES = \ @@ -1040,7 +1040,7 @@ index 387f22a9f..ae1ebd988 100644 container_bloomfilter.c \ container_heap.c \ container_meta_data.c \ -@@ -78,13 +76,11 @@ libgnunetutil_la_SOURCES = \ +@@ -78,17 +76,15 @@ libgnunetutil_la_SOURCES = \ mst.c \ mq.c \ nc.c \ @@ -1054,3 +1054,16 @@ index 387f22a9f..ae1ebd988 100644 program.c \ regex.c \ resolver_api.c resolver.h \ +- scheduler.c \ ++ scheduler_em.c \ + service.c \ + signal.c \ + strings.c \ +@@ -127,7 +123,6 @@ libgnunetutil_la_LIBADD = \ + $(LIBGCRYPT_LIBS) \ + $(LTLIBICONV) \ + $(LTLIBINTL) \ +- -lltdl \ + $(LIBIDN) $(LIBIDN2) \ + $(Z_LIBS) \ + -lunistring \ diff --git a/gnunet-build/packages/gnunet/gnunet/files/imports b/gnunet-build/packages/gnunet/gnunet/files/imports index 1d5c97f..cf80020 100644 --- a/gnunet-build/packages/gnunet/gnunet/files/imports +++ b/gnunet-build/packages/gnunet/gnunet/files/imports @@ -1,7 +1,4 @@ [ -"_GNUNET_CONFIGURATION_get_value_float", -"_GNUNET_MQ_queue_for_connection_client", -"_GNUNET_SCHEDULER_run_task", "_GNUNET_STRINGS_fancy_size_to_bytes", "_GNUNET_STRINGS_fancy_time_to_relative", "_GNUNET_log_setup", diff --git a/gnunet-build/packages/gnunet/gnunet/files/network.js b/gnunet-build/packages/gnunet/gnunet/files/network.js index 4d5c717..8bcc763 100644 --- a/gnunet-build/packages/gnunet/gnunet/files/network.js +++ b/gnunet-build/packages/gnunet/gnunet/files/network.js @@ -19,7 +19,7 @@ mergeInto(LibraryManager.library, { $NEXT_SOCKET: 1, GNUNET_NETWORK_socket_create__deps: ['$SOCKETS', '$NEXT_SOCKET'], GNUNET_NETWORK_socket_create: function(domain, type, protocol) { - console.debug("socket_create(", domain, type, protocol, ")"); + //console.debug("socket_create(", domain, type, protocol, ")"); if (domain != 1) { ___setErrNo(ERRNO_CODES.EAFNOSUPPORT); return 0; @@ -33,7 +33,7 @@ mergeInto(LibraryManager.library, { }, GNUNET_NETWORK_socket_connect__deps: ['$SOCKETS'], GNUNET_NETWORK_socket_connect: function(desc, address, address_len) { - console.debug("socket_connect(", desc, address, address_len, ")"); + //console.debug("socket_connect(", desc, address, address_len, ")"); if (desc in SOCKETS) { console.error("socket already connected?"); ___setErrNo(ERRNO_CODES.EISCONN); @@ -44,8 +44,8 @@ mergeInto(LibraryManager.library, { ___setErrNo(ERRNO_CODES.EAFNOSUPPORT); return -1; } - var path = Pointer_stringify(address + 2); - console.debug("connecting to", path); + var path = UTF8ToString(address + 2); + //console.debug("connecting to", path); var channel; try { channel = new MessageChannel(); @@ -60,10 +60,10 @@ mergeInto(LibraryManager.library, { queue: [], }; channel.port1.onmessage = function(ev) { - console.debug("got message on socket", desc, ev); + //console.debug("got message on socket", desc, ev); socket.queue.push(ev.data); if ("task" in socket) { - console.debug("calling read handler"); + //console.debug("calling read handler"); delete SCHEDULER_TASKS[socket.task]; delete socket["task"]; dynCall('vi', socket.handler, [socket.cls]); @@ -84,7 +84,7 @@ mergeInto(LibraryManager.library, { }, GNUNET_NETWORK_socket_send__deps: ['$SOCKETS'], GNUNET_NETWORK_socket_send: function(desc, buffer, length) { - console.debug("socket_send(", desc, buffer, length, ")"); + //console.debug("socket_send(", desc, buffer, length, ")"); if (!(desc in SOCKETS)) { console.error("socket not connected?"); ___setErrNo(ERRNO_CODES.ENOTCONN); @@ -103,7 +103,7 @@ mergeInto(LibraryManager.library, { }, GNUNET_NETWORK_socket_close__deps: ['$SOCKETS'], GNUNET_NETWORK_socket_close: function(desc) { - console.debug("socket_close(", desc, ")"); + //console.debug("socket_close(", desc, ")"); if (!(desc in SOCKETS)) { return 1; } @@ -117,7 +117,7 @@ mergeInto(LibraryManager.library, { }, GNUNET_NETWORK_socket_bind__deps: ['$SOCKETS'], GNUNET_NETWORK_socket_bind: function(desc, address, address_len) { - console.debug("socket_bind(", desc, address, address_len, ")"); + //console.debug("socket_bind(", desc, address, address_len, ")"); if (desc in SOCKETS) { console.error("socket already bound?"); ___setErrNo(ERRNO_CODES.EINVAL); @@ -127,14 +127,14 @@ mergeInto(LibraryManager.library, { ___setErrNo(ERRNO_CODES.EINVAL); return -1; } - var path = Pointer_stringify(address + 2); - console.debug("binding to", path); + var path = UTF8ToString(address + 2); + //console.debug("binding to", path); SOCKETS[desc] = {}; return 1; }, GNUNET_NETWORK_socket_listen__deps: ['$SOCKETS'], GNUNET_NETWORK_socket_listen: function(desc, backlog) { - console.debug("socket_listen(", desc, backlog, ")"); + //console.debug("socket_listen(", desc, backlog, ")"); if ("listening" in SOCKETS) { console.error("only one listening socket is supported"); return -1; @@ -144,14 +144,14 @@ mergeInto(LibraryManager.library, { }, GNUNET_NETWORK_socket_accept__deps: ['$SOCKETS', '$NEXT_SOCKET'], GNUNET_NETWORK_socket_accept: function(desc, address, address_len) { - console.debug("socket_accept(", desc, address, address_len, ")"); + //console.debug("socket_accept(", desc, address, address_len, ")"); if (desc != SOCKETS.listening) { console.error("socket is not listening"); ___setErrNo(ERRNO_CODES.EINVAL); return 0; } if (0 == SOCKETS.incoming.length) { - console.debug("no incoming connections"); + //console.debug("no incoming connections"); ___setErrNo(ERRNO_CODES.EWOULDBLOCK); return 0; } @@ -168,10 +168,10 @@ mergeInto(LibraryManager.library, { queue: [], }; data.port.onmessage = function(ev) { - console.debug("got message on socket", sd, ev); + //console.debug("got message on socket", sd, ev); socket.queue.push(ev.data); if ("task" in socket) { - console.debug("calling read handler"); + //console.debug("calling read handler"); delete SCHEDULER_TASKS[socket.task]; delete socket["task"]; dynCall('vi', socket.handler, [socket.cls]); @@ -184,7 +184,7 @@ mergeInto(LibraryManager.library, { }, GNUNET_NETWORK_socket_recv__deps: ['$SOCKETS'], GNUNET_NETWORK_socket_recv: function(desc, buffer, length) { - console.debug("socket_recv(", desc, buffer, length, ")"); + //console.debug("socket_recv(", desc, buffer, length, ")"); if (!(desc in SOCKETS)) { console.error("socket not connected?"); ___setErrNo(ERRNO_CODES.ENOTCONN); @@ -192,13 +192,13 @@ mergeInto(LibraryManager.library, { } var socket = SOCKETS[desc]; if (0 == socket.queue.length) { - console.debug("nothing to read"); + //console.debug("nothing to read"); ___setErrNo(ERRNO_CODES.EWOULDBLOCK); return -1; } var data = socket.queue[0]; if ("close" == data) { - console.debug("socket closed"); + //console.debug("socket closed"); return 0; } var sub = data.subarray(0, length); @@ -208,7 +208,7 @@ mergeInto(LibraryManager.library, { } else { socket.queue[0] = data.subarray(sub.length); } - console.debug("read", sub.length, "bytes"); + //console.debug("read", sub.length, "bytes"); return sub.length; }, GNUNET_NETWORK_fdset_isset__deps: ['$SOCKETS'], @@ -245,6 +245,12 @@ mergeInto(LibraryManager.library, { GNUNET_NETWORK_socket_select: function(rfds, wfds, efds, timeout) { console.error("GNUNET_NETWORK_socket_select should not be called"); return -1; + }, + GNUNET_NETWORK_test_pf: function(pf) { + if (1 == pf) { + return 1; + } + return 0; } }); diff --git a/gnunet-build/packages/gnunet/gnunet/files/plugin.js b/gnunet-build/packages/gnunet/gnunet/files/plugin.js index 534b4d8..181c95b 100644 --- a/gnunet-build/packages/gnunet/gnunet/files/plugin.js +++ b/gnunet-build/packages/gnunet/gnunet/files/plugin.js @@ -17,7 +17,7 @@ mergeInto(LibraryManager.library, { GNUNET_PLUGIN_load__deps: ['dlclose', 'dlsym', 'dlopen'], GNUNET_PLUGIN_load: function(library_name, arg) { - var lib = Pointer_stringify(library_name); + var lib = UTF8ToString(library_name); var handle = ccallFunc(_dlopen, 'number', ['string', 'number'], [lib + '.js', 0]); @@ -40,7 +40,7 @@ mergeInto(LibraryManager.library, { }, GNUNET_PLUGIN_load_all__deps: ['$FS', 'GNUNET_PLUGIN_load'], GNUNET_PLUGIN_load_all: function(basename, arg, cb, cb_cls) { - var prefix = Pointer_stringify(basename); + var prefix = UTF8ToString(basename); var entries = []; try { entries = FS.readdir('.'); diff --git a/gnunet-build/packages/gnunet/gnunet/files/plugin_peerstore_emscripten_int.js b/gnunet-build/packages/gnunet/gnunet/files/plugin_peerstore_emscripten_int.js index f1e576e..2e98663 100644 --- a/gnunet-build/packages/gnunet/gnunet/files/plugin_peerstore_emscripten_int.js +++ b/gnunet-build/packages/gnunet/gnunet/files/plugin_peerstore_emscripten_int.js @@ -26,7 +26,7 @@ mergeInto(LibraryManager.library, { if (cursor) { count++; cursor.delete().onerror = function(e) { - Module.print('expiry request failed'); + console.error('expiry request failed'); }; cursor.continue(); } else { @@ -36,18 +36,18 @@ mergeInto(LibraryManager.library, { } }; request.onerror = function(e) { - Module.print('cursor request failed'); + console.error('cursor request failed'); dynCall('vii', cont, [cont_cls, -1]); }; }, peerstore_emscripten_iterate_records_int: function(sub_system_pointer, peer_pointer, key_pointer, iter, iter_cls, wrapper) { - var sub_system = Pointer_stringify(sub_system_pointer); + var sub_system = UTF8ToString(sub_system_pointer); var peer = peer_pointer ? Array.prototype.slice.call( HEAP8.subarray(peer_pointer, peer_pointer + 32)) : null; - var key = key_pointer ? Pointer_stringify(key_pointer) : null; + var key = key_pointer ? UTF8ToString(key_pointer) : null; var key_range = [sub_system]; if (peer) { key_range.push(peer); @@ -89,7 +89,7 @@ mergeInto(LibraryManager.library, { } }; request.onerror = function(e) { - Module.print('cursor request failed'); + console.error('cursor request failed'); dynCall('viii', iter, [iter_cls, 0, -1]); }; }, @@ -97,10 +97,10 @@ mergeInto(LibraryManager.library, { peer_pointer, key_pointer, value_pointer, size, expiry, options, cont, cont_cls) { - var sub_system = Pointer_stringify(sub_system_pointer); + var sub_system = UTF8ToString(sub_system_pointer); var peer = Array.prototype.slice.call(HEAP8.subarray(peer_pointer, peer_pointer + 32)); - var key = Pointer_stringify(key_pointer); + var key = UTF8ToString(key_pointer); var value = new Uint8Array(HEAP8.subarray(value_pointer, value_pointer + size)); var store = @@ -113,7 +113,7 @@ mergeInto(LibraryManager.library, { value: value, expiry: expiry}); request.onerror = function(e) { - Module.print('put request failed'); + console.error('put request failed'); dynCall('vii', cont, [cont_cls, -1]); }; request.onsuccess = function(e) { @@ -127,7 +127,7 @@ mergeInto(LibraryManager.library, { var cursor = e.target.result; if (cursor) { cursor.delete().onerror = function(e) { - Module.print('replace request failed'); + console.error('replace request failed'); }; cursor.continue(); } else { @@ -135,7 +135,7 @@ mergeInto(LibraryManager.library, { } }; request.onerror = function(e) { - Module.print('cursor request failed'); + console.error('cursor request failed'); dynCall('vii', cont, [cont_cls, -1]); }; } else { diff --git a/gnunet-build/packages/gnunet/gnunet/files/plugin_transport_http_client_emscripten.c b/gnunet-build/packages/gnunet/gnunet/files/plugin_transport_http_client_emscripten.c index 3e100cc..70385d1 100644 --- a/gnunet-build/packages/gnunet/gnunet/files/plugin_transport_http_client_emscripten.c +++ b/gnunet-build/packages/gnunet/gnunet/files/plugin_transport_http_client_emscripten.c @@ -737,8 +737,7 @@ http_client_plugin_get_network_for_address (void *cls, * @param tc scheduler context */ static void -client_session_timeout (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc) +client_session_timeout (void *cls) { struct GNUNET_ATS_Session *s = cls; struct GNUNET_TIME_Relative left; diff --git a/gnunet-build/packages/gnunet/gnunet/files/plugin_transport_http_client_emscripten_int.js b/gnunet-build/packages/gnunet/gnunet/files/plugin_transport_http_client_emscripten_int.js index da8c478..b7a501d 100644 --- a/gnunet-build/packages/gnunet/gnunet/files/plugin_transport_http_client_emscripten_int.js +++ b/gnunet-build/packages/gnunet/gnunet/files/plugin_transport_http_client_emscripten_int.js @@ -16,24 +16,24 @@ mergeInto(LibraryManager.library, { abort_xhr: function(xhr) { - Module.print('Aborting xhr: ' + xhr); + //console.debug('Aborting xhr: ' + xhr); xhrs[xhr].abort(); }, http_client_plugin_send_int: function(url_pointer, data_pointer, data_size, cont, cont_cls, target) { - var url = Pointer_stringify(url_pointer); + var url = UTF8ToString(url_pointer); var data = HEAP8.subarray(data_pointer, data_pointer + data_size); var xhr = new XMLHttpRequest(); xhr.open('PUT', url); xhr.send(data); xhr.onload = function(e) { - Module.print('put onload readyState ' + xhr.readyState + ' status ' + xhr.status); + //console.debug('put onload readyState ' + xhr.readyState + ' status ' + xhr.status); if (cont) { dynCall('viiiii', cont, [cont_cls, target, 1, data_size, data_size]); } }; xhr.onerror = function(e) { - Module.print('put onerror readyState ' + xhr.readyState + ' status ' + xhr.status); + //console.debug('put onerror readyState ' + xhr.readyState + ' status ' + xhr.status); if (cont) { dynCall('viiiii', cont, [cont_cls, target, -1, data_size, data_size]); } @@ -41,8 +41,8 @@ mergeInto(LibraryManager.library, { }, client_connect_get_int: function(get, s, url_pointer, client_receive, session_disconnect, plugin) { - var url = Pointer_stringify(url_pointer); - Module.print('Creating new get xhr: ' + get); + var url = UTF8ToString(url_pointer); + //console.debug('Creating new get xhr: ' + get); var xhr = new XMLHttpRequest(); xhrs[get] = xhr; xhr.responseType = 'arraybuffer'; @@ -51,20 +51,20 @@ mergeInto(LibraryManager.library, { xhr.send(); }; xhr.onreadystatechange = function() { - Module.print('xhr' + get + ' readyState ' + xhr.readyState + - ' status ' + xhr.status + ':' + xhr.statusText); + //console.debug('xhr' + get + ' readyState ' + xhr.readyState + + // ' status ' + xhr.status + ':' + xhr.statusText); }; xhr.onload = function(e) { var response = new Uint8Array(e.target.response); - Module.print('xhr' + get + ' got ' + response.length + ' bytes'); + //console.debug('xhr' + get + ' got ' + response.length + ' bytes'); ccallFunc(getFuncWrapper(client_receive, 'iiiii'), 'number', ['array', 'number', 'number', 'number'], [response, response.length, 1, s]); xhr.resend(); }; xhr.onerror = function(e) { - Module.print('xhr' + get + ' status:' - + xhr.status + ':' + xhr.statusText); + //console.debug('xhr' + get + ' status:' + // + xhr.status + ':' + xhr.statusText); ccallFunc( getFuncWrapper(session_disconnect, 'iii'), 'number', @@ -72,10 +72,10 @@ mergeInto(LibraryManager.library, { [plugin, s]); }; xhr.onabort = function() { - Module.print('xhr' + get + ' aborted'); + //console.debug('xhr' + get + ' aborted'); }; xhr.ontimeout = function() { - Module.print('xhr' + get + ' timedout'); + //console.debug('xhr' + get + ' timedout'); xhr.resend(); }; xhr.resend(); diff --git a/gnunet-build/packages/gnunet/gnunet/files/plugin_transport_webrtc_int.js b/gnunet-build/packages/gnunet/gnunet/files/plugin_transport_webrtc_int.js index cafc2f7..a682c15 100644 --- a/gnunet-build/packages/gnunet/gnunet/files/plugin_transport_webrtc_int.js +++ b/gnunet-build/packages/gnunet/gnunet/files/plugin_transport_webrtc_int.js @@ -21,7 +21,7 @@ mergeInto(LibraryManager.library, { peer_connect: function(offer_cb, answer_cb, message_cb, offer_ptr, offer_size, cls) { var offer; if (0 != offer_ptr) { - offer = Pointer_stringify(offer_ptr, offer_size); + offer = UTF8ToString(offer_ptr, offer_size); } var channel = new MessageChannel(); var port = channel.port1; @@ -56,7 +56,7 @@ mergeInto(LibraryManager.library, { set_remote_answer__deps: ["$CONNECTIONS"], set_remote_answer: function(num, answer_ptr, answer_size) { var port = CONNECTIONS[num]; - port.postMessage({type: 'answer', sdp: Pointer_stringify(answer_ptr, answer_size)}); + port.postMessage({type: 'answer', sdp: UTF8ToString(answer_ptr, answer_size)}); }, peer_disconnect__deps: ["$CONNECTIONS"], peer_disconnect: function(num) { @@ -67,4 +67,4 @@ mergeInto(LibraryManager.library, { } }); -// vim: set expandtab ts=2 sw=2:
\ No newline at end of file +// vim: set expandtab ts=2 sw=2: diff --git a/gnunet-build/packages/gnunet/gnunet/files/pre.js b/gnunet-build/packages/gnunet/gnunet/files/pre.js index af0ba65..dae5bba 100644 --- a/gnunet-build/packages/gnunet/gnunet/files/pre.js +++ b/gnunet-build/packages/gnunet/gnunet/files/pre.js @@ -46,7 +46,7 @@ gnunet_prerun = function() { random_bytes[random_offset++] = 0; } if (i < length) - Module.printErr('Random bytes exausted!'); + console.error('Random bytes exausted!'); return i; }, }); @@ -78,7 +78,7 @@ gnunet_prerun = function() { } if (typeof(Module['preInit']) === "undefined") Module = { 'preInit': [] }; Module['preInit'].push(gnunet_prerun); -Module['arguments'] = ["-L", "DEBUG"]; +Module['arguments'] = ["-L", "ERROR"]; // a map of window index to port var windows = {}; @@ -175,7 +175,7 @@ function ccallFunc(func, returnType, argTypes, args) { } } var ret = func.apply(null, cArgs); - if (returnType === 'string') ret = Pointer_stringify(ret); + if (returnType === 'string') ret = UTF8ToString(ret); if (stack !== 0) { stackRestore(stack); } diff --git a/gnunet-build/packages/gnunet/gnunet/files/scheduler.js b/gnunet-build/packages/gnunet/gnunet/files/scheduler.js index bb470fa..23e4373 100644 --- a/gnunet-build/packages/gnunet/gnunet/files/scheduler.js +++ b/gnunet-build/packages/gnunet/gnunet/files/scheduler.js @@ -19,7 +19,7 @@ mergeInto(LibraryManager.library, { GNUNET_SCHEDULER_add_delayed_with_priority_js__deps: ['$SCHEDULER_TASKS'], GNUNET_SCHEDULER_add_delayed_with_priority_js: function(delay, priority, task, task_cls) { - //Module.print('GNUNET_SCHEDULER_add_delayed_with_priority(delay='+delay+',pirority='+priority+',task='+task+',task_cls='+task_cls+')'); + //console.log('GNUNET_SCHEDULER_add_delayed_with_priority(delay=', delay, ',pirority=', priority, ',task=', task, ',task_cls=', task_cls, ')'); var id; id = setTimeout(function() { delete SCHEDULER_TASKS[id]; @@ -33,7 +33,7 @@ mergeInto(LibraryManager.library, { }, GNUNET_SCHEDULER_cancel__deps: ['$SCHEDULER_TASKS'], GNUNET_SCHEDULER_cancel: function(task) { - console.debug("cancelling task", task); + //console.debug("cancelling task", task); clearTimeout(task); if (task in SCHEDULER_TASKS) { var t = SCHEDULER_TASKS[task]; @@ -49,7 +49,7 @@ mergeInto(LibraryManager.library, { }, GNUNET_SCHEDULER_add_read_net__deps: ['$SOCKETS'], GNUNET_SCHEDULER_add_read_net: function(delay, rfd, task, task_cls) { - console.debug("add_read_net(", delay, rfd, task, task_cls, ")"); + //console.debug("add_read_net(", delay, rfd, task, task_cls, ")"); if (!(rfd in SOCKETS)) { console.error("socket is not connected?"); return 0; @@ -80,7 +80,7 @@ mergeInto(LibraryManager.library, { socket["handler"] = task; socket["cls"] = task_cls; socket["task"] = id; - console.debug("read task is", id); + //console.debug("read task is", id); return id; }, GNUNET_SCHEDULER_add_read_net_with_priority__deps: [ @@ -92,7 +92,7 @@ mergeInto(LibraryManager.library, { }, GNUNET_SCHEDULER_add_write_net__deps: ['$SOCKETS'], GNUNET_SCHEDULER_add_write_net: function(delay, wfd, task, task_cls) { - console.debug("add_write_net(", delay, wfd, task, task_cls, ")"); + //console.debug("add_write_net(", delay, wfd, task, task_cls, ")"); if (!(wfd in SOCKETS)) { console.error("socket is not connected?"); return 0; @@ -110,7 +110,7 @@ mergeInto(LibraryManager.library, { }, GNUNET_SCHEDULER_run: function(task, task_cls) { dynCall('vi', task, [task_cls]); - throw 'SimulateInfiniteLoop'; + throw 'unwind'; }, }); diff --git a/gnunet-build/packages/gnunet/gnunet/files/scheduler.c b/gnunet-build/packages/gnunet/gnunet/files/scheduler_em.c index ba3c5aa..ba3c5aa 100644 --- a/gnunet-build/packages/gnunet/gnunet/files/scheduler.c +++ b/gnunet-build/packages/gnunet/gnunet/files/scheduler_em.c diff --git a/src/cljs/gnunet_web/extractor.cljs b/src/cljs/gnunet_web/extractor.cljs index cae5076..ff387c8 100644 --- a/src/cljs/gnunet_web/extractor.cljs +++ b/src/cljs/gnunet_web/extractor.cljs @@ -29,12 +29,12 @@ (defn metatype-to-string [type] - (js/Pointer_stringify + (js/UTF8ToString (js/_EXTRACTOR_metatype_to_string type))) (defn metatype-to-description [type] - (js/Pointer_stringify + (js/UTF8ToString (js/_EXTRACTOR_metatype_to_description type))) (defn metadata-destroy diff --git a/src/cljs/gnunet_web/filesharing.cljs b/src/cljs/gnunet_web/filesharing.cljs index 3c67a3d..0019c6a 100644 --- a/src/cljs/gnunet_web/filesharing.cljs +++ b/src/cljs/gnunet_web/filesharing.cljs @@ -36,7 +36,7 @@ (defn uri-pointer-to-string [uri-pointer] (let [uri-string-pointer (js/_GNUNET_FS_uri_to_string uri-pointer) - uri-string (js/Pointer_stringify uri-string-pointer)] + uri-string (js/UTF8ToString uri-string-pointer)] (js/_free uri-string-pointer) uri-string)) @@ -52,7 +52,7 @@ [metadata] (let [uri-pointer (js/_GNUNET_FS_uri_ksk_create_from_meta_data metadata) keywords-pointer (js/_GNUNET_FS_uri_ksk_to_string_fancy uri-pointer) - keywords (js/Pointer_stringify keywords-pointer)] + keywords (js/UTF8ToString keywords-pointer)] (js/_free keywords-pointer) (js/_GNUNET_FS_uri_destroy uri-pointer) keywords)) @@ -61,13 +61,13 @@ [cls plugin-name type format mime-type data data-size] (let [metadata (get-object cls)] (swap! metadata conj - {:plugin-name (js/Pointer_stringify plugin-name) + {:plugin-name (js/UTF8ToString plugin-name) :type type :format format - :mime-type (js/Pointer_stringify mime-type) + :mime-type (js/UTF8ToString mime-type) :data (if (or (= format e/format-utf8) (= format e/format-string)) - (js/Pointer_stringify data) + (js/UTF8ToString data) (read-memory data data-size))}))) (def metadata-iterator-pointer diff --git a/src/cljs/gnunet_web/service.cljs b/src/cljs/gnunet_web/service.cljs index 0eea5a2..efa49bf 100644 --- a/src/cljs/gnunet_web/service.cljs +++ b/src/cljs/gnunet_web/service.cljs @@ -75,7 +75,7 @@ (js/console.error "REKT" e)))) (.start port) (.postMessage port (js-obj "type" "init" - "private-key" (to-array private-key) + "private-key" (js/Uint8Array.from private-key) "random-bytes" random-bytes)) worker)) diff --git a/src/cljs/gnunet_web/transport.cljs b/src/cljs/gnunet_web/transport.cljs index 59332d8..5a1ee11 100644 --- a/src/cljs/gnunet_web/transport.cljs +++ b/src/cljs/gnunet_web/transport.cljs @@ -89,11 +89,11 @@ {:state state :peer peer :address (when-not (zero? transport-pointer) - (let [transport (js/Pointer_stringify transport-pointer)] + (let [transport (js/UTF8ToString transport-pointer)] (when (and (= "http_client" transport) (<= 9 address-length)) - (js/Pointer_stringify (+ 8 address-pointer) - (- address-length 9)))))}))) + (js/UTF8ToString (+ 8 address-pointer) + (- address-length 9)))))}))) (def monitor-callback-pointer (+++ (js/addFunction monitor-callback))) diff --git a/src/cljs/gnunet_web/util.cljs b/src/cljs/gnunet_web/util.cljs index b58f629..a326d4a 100644 --- a/src/cljs/gnunet_web/util.cljs +++ b/src/cljs/gnunet_web/util.cljs @@ -66,6 +66,6 @@ "number" (array "array" "number" "number" "number") (array data-array data-len string-pointer strlen)) - (let [string (js/Pointer_stringify string-pointer strlen)] + (let [string (js/UTF8ToString string-pointer strlen)] (js/_free string-pointer) string))) diff --git a/src/js/window.crypto.ext.js b/src/js/window.crypto.ext.js index 6613e2c..a92c05f 100644 --- a/src/js/window.crypto.ext.js +++ b/src/js/window.crypto.ext.js @@ -1 +1,2 @@ window.crypto.getRandomValues = function() {}; +Uint8Array.from = function() {}; |