Projects
Extra
gtk-gnutella
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 10
View file
gtk-gnutella.changes
Changed
@@ -1,4 +1,141 @@ ------------------------------------------------------------------- +Wed Mar 29 09:16:51 UTC 2023 - Luigi Baldoni <aloisio@gmx.com> + +- Update to version 1.2.2 + Improvements: + * Extended "props" shell command with -e (exact) and -i + (ignore missing). + * The "props" command now takes a set of properties, handled + as one batch. + Bug Fixes: + * Properly recompute bandwidth stealing on DHT changes. + * Avoid crashing in D-Bus lib when filename is improperly + UTF-8 encoded. + * DHT: protect against corrupted database. + * bw_available(): fix invalid logic for I/O source capping. + * pong_all_neighbours_but_one(): iterate on local list. + * dq_node_removed(): must free dq object asynchronously. + Under the Hood: + * Update IRC network information: moved from freenode to + libera.chat + * Chunk size limiting for uploads accounts for bandwidth. + * Reduce memory footprint for statx_t if no data kept. + * CQ: defer freeing of dispatched event. + * watchdog: be more verbose within critical messages. + * node_parse(): signal to callers when we have BYE-ed the node. + * cq_event_called(): use better diagnostic on assert failure. + * dbus_util_send_message(): protect against invalid text. + * prepare_entry(): ensure entry invariant remains true. + * wd_expire(): do nothing if watchdog was asleep. + version 1.2.1: + Improvements: + * Show command to clean stale lockfile. + * Add properties to track bytes exchanged by schedulers. + * Add -t switch to shell "status" command. + * Make use of libera.chat instead of freenode. + * Expiration time now increased from 1 to 2 years. + * New --no-expire switch to disable GUI popup when expired. + Bug Fixes: + * pattern_prefix_period(): don't corrupt end-of-block. + * Fix subtle recursive resizing bug. + * Do not emit empty leading description in saved properties. + * For time sync over UDP, write replying time later! + * hash_table_resize(): clear last cached lookup! + * ev_link(): insert events in the proper bucket! + Under the Hood: + * Updated GeoIP databases. + * Ad bit_generic_count_set(). + * Add plural_child(). + * Add progstart_was_called(). + * Add H_STRFREEV_NULL(). + * Add syn=c to *.ht and *.ct files for vim. + * Add hash_table_copy_foreach(). + * Add tm_precise_elapsed_ns() convenience routine. + * Add thread_stack_size() to get configured stack size. + * Add pattern_string() to get the string being looked for. + * Add str_2c_from() to grab C string from a given offset. + * Add eval_subst_atom(). + * Add stacktrace_caller_fast() and stack-test program. + * Add thread_{un}suspend(). + * Add tmalloc_contains() for assertions. + * Add public VMM validate/invalidate routines. + * Add macros to ease printing for tmval and tmspec. + * Add node_check() to node traversal loops. + * Avoid branches in SIGN() as well. + * Avoid regeneration of Geo DB if no data changes. + * Bump python dependency for jhbuild on OSX. + * Better clock skew computation. + * Handle time-sync exchanges via UDP better. + * Make use of travis cache feature for OSX builds. + * Only include <sys/sysctl.h> if we actually need it. + * Allow compilation with usemymalloc=n on 32-bit CPUs. + * Let mem_test() run only once. + * When no backtrace(), ensure we compile with a frame pointer. + * Compile with -DTRACK_MALLOC -DREMAP_ZALLOC again. + * Made -DTRACK_ZALLOC usable again. + * Do not check stack at longjmp() if on altstack. + * Do not trap hash_list_{new,free}() under REMAP_ZALLOC. + * Ensure properties use xmalloc() for their values. + * Wait until main() starts to allocate the signal chunk. + * Made ascii_toupper() and ascii_tolower() avoid branching. + * Trace saving time whithin property files. + * Trace page (PA) and offset within page on SEGV. + * Trace page protection on SEGV faults, if possible. + * Trace how and where symbols were loaded in crash log. + * Symbol quality definition moved to symbols! + * Windows: handle freopen("a") specially to allow read sharing. + * Windows: no need to dump stack again if no gdb. + * mutex: supply more context on lock errors. + * ostream: now also accepts str_t as output medium. + * rwlock: added debug option to track wlock location. + * random-test: added -a to benchmark all routines. + * random-test: add -v to be verbose when -a is used. + * VMM: added extra debugging tools / assertions. + * VMM: trace new compile-time options. + * clock: simplify code by using aging table. + * xmalloc: avoid late page pool creation. + * xmalloc: extended assertions to detect freelist corruption. + * zalloc: avoid warnings when compiling with REMAP_ZALLOC. + * zalloc: with ZONE_SAFE, ensure block tagging never changes! + * malloc.c: enhanced and fixed some errors with + multi-threading. + * malloc.c: huge refactoring and cleanup. + * aging_destroy(): remove periodic GC before cleanup. + * bfd_util_init(): avoid warning on bfd_init() call. + * clock_adjust(): removed MAX_SDEV. + * clock_adjust(): stop pruning if we keep everything. + * clock_update(): lowered required amount of data. + * compat_setjmp(): protect against gone contexts. + * crash_handler_process(): only call crash_auto_restart() if + needed. + * ev_free(): assert event is not linked in queue! + * ev_unlink(): added list consistency assertions. + * eval_subst(): remove the size limitation on the susbtituted + string. + * evq_close(): be silent if event queue not created. + * fi_pick_rarest_chunk(): fixed assertion failure. + * fi_pick_rarest_chunk(): log assertion values. + * get_prop(): also trace failing property when ps is NULL. + * ggept_filesize_encode(): can return 0 if given 0. + * hash_compute_increment(): make it odd without branch. + * main(): do not set a crash dir if not running for long. + * name_to_single_host_addr(): use pslist_random(). + * ntp_send_probes(): comment updates, cleanup. + * once_recursive(): avoid calling stacktrace_function_name(). + * progstart_duplicate(): added assertions. + * prop_lock(): use macro for locking (hiding lock type). + * rwlock_deadlocked(): trace write owner if known. + * spinlock_loop(): document why no memory barrier. + * statusbar_gui_push_v(): be safe if called early. + * str_avail(): new implementation and semantics. + * str_ichar() and str_istr() can now append. + * strvec_cpy(): was failing when called with cnt=0. + * thread_id_name_to_buf(): be nicer with negative IDs. + * thread_lock_waiting_done(): cleanup when no problems. + * tok_version_valid(): no longer run clock_update(). + * xcopy(): not defined as inlined routine when TRACK_MALLOC. + +------------------------------------------------------------------- Mon Dec 28 10:10:10 UTC 2020 - olaf@aepfle.de - Update to 1.2.0
View file
gtk-gnutella.spec
Changed
@@ -1,7 +1,7 @@ # # spec file for package gtk-gnutella # -# Copyright (c) 2016 Packman Team <packman@links2linux.de> +# Copyright (c) 2023 Packman Team <packman@links2linux.de> # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,24 +18,23 @@ %define _lto_cflags %{nil} Name: gtk-gnutella -Version: 1.2.0 +Version: 1.2.2 Release: 0 Summary: Gnutella Peer to Peer Client -License: GPL-2.0+ (GPL-2.0+) +License: GPL-2.0-or-later Url: http://gtk-gnutella.sourceforge.net/ -Source: gtk-gnutella-%{version}.tar.xz +Source: https://sourceforge.net/projects/gtk-gnutella/files/%{name}/%{version}/%{name}-%{version}.tar.xz Patch0: gtk-gnutella.enum-msg.patch -BuildRequires: dbus-1-devel BuildRequires: dbus-1-glib-devel -BuildRequires: gcc -BuildRequires: glibc-devel -BuildRequires: gtk2-devel -BuildRequires: libgnutls-devel >= 3.2.4 -BuildRequires: make +BuildRequires: fdupes BuildRequires: pkgconfig BuildRequires: update-desktop-files -BuildRequires: zlib-devel -BuildRequires: fdupes +BuildRequires: pkgconfig(dbus-1) +BuildRequires: pkgconfig(dbus-glib-1) +BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(gnutls) >= 3.2.4 +BuildRequires: pkgconfig(gtk+-2.0) +BuildRequires: pkgconfig(zlib) %description Gtk-Gnutella is a full-featured Gnutella client using GTK+. It contains all
View file
gtk-gnutella-1.2.0.tar.xz/ChangeLog -> gtk-gnutella-1.2.2.tar.xz/ChangeLog
Changed
@@ -1,6 +1,184 @@ -At 50f33c5a1774f782f877975608e19f4db0913877 (current) +# v 1.2.2 2022-02-25 stable -# v 1.2.0 2020-06-14 stable +This is a maintenance release with major bug fixes. + +There were several shortcomings with bandwidth management: capping was not +performed correctly and could overuse uploading bandwidth. Also when the DHT +is turned off or on, we need to recompute proper bandwidth stealing. + +Corruption of the DHT disk databases could also lead to a crash. + +There was a critical old bug in the Dynamic Querying layer that affected +Ultrapeers mostly: we could corrupt memory and/or crash when the current node +was removed and we were processing a Dynamic Query for that node. This is +more likely to happen when running as an Ultrapeer but it could also affect +nodes running as leaves, although the probability of that bug happening is +much less in that case. + +Finally, it is best to not iterate on a global list that could get changed +due to a node removal. This was the case when sending pongs to neighbouring +nodes, so we now take a private copy. + +Improvements: +- Extended "props" shell command with -e (exact) and -i (ignore missing). +- The "props" command now takes a set of properties, handled as one batch. + +Bug Fixes: +- Properly recompute bandwidth stealing on DHT changes. +- Avoid crashing in D-Bus lib when filename is improperly UTF-8 encoded. +- DHT: protect against corrupted database. +- bw_available(): fix invalid logic for I/O source capping. +- pong_all_neighbours_but_one(): iterate on local list. +- dq_node_removed(): must free dq object asynchronously. + +Under the Hood: +- Update IRC network information: moved from freenode to libera.chat +- Chunk size limiting for uploads accounts for bandwidth. +- Reduce memory footprint for statx_t if no data kept. +- CQ: defer freeing of dispatched event. +- watchdog: be more verbose within critical messages. +- node_parse(): signal to callers when we have BYE-ed the node. +- cq_event_called(): use better diagnostic on assert failure. +- dbus_util_send_message(): protect against invalid text. +- prepare_entry(): ensure entry invariant remains true. +- wd_expire(): do nothing if watchdog was asleep. + +# v 1.2.1 2021-07-12 stable + +This is a maintenance release with minor bug fixes. + +Note that our project IRC #gtk-gnutella channel is now on irc.libera.chat. + +When launching gtk-gnutella and there is a stale lockfile present, listing +some PID, and it happens that there is already another process running +under this PID, we abort, complaining that another gtk-gnutella is running. +However, if the lockfile is really stale, and the PID listed in there has +nothing to do with gtk-gnutella at the moment, the user will need to remove +the stale lockfile. Hence we show them the command to run, listing the +full lockfile path so that it is easy to overcome this little inconvenience! + +When using hashtables for memory management, it was possible to trigger a +resizing and, during the course of operations, have further memory used, +requiring tracking of new items in the same hashtable we were in the +process of resizing. That led to double VMM freeing of the region used +to store the data. + +Add properties to track bytes exchanged by schedulers. These properties +track the amount of bytes exchanged by session and are reset to 0 whenever +a new user session starts. It allows users to see the actual amount of +data consumed by running gtk-gnutella sessions, programmatically via the +shell interface. + +Add -t switch to shell "status" command: this displays the total amount +of bandwidth consumed during the session for the different schedulers. + +Improvements: +- Show command to clean stale lockfile. +- Add properties to track bytes exchanged by schedulers. +- Add -t switch to shell "status" command. +- Make use of libera.chat instead of freenode. +- Expiration time now increased from 1 to 2 years. +- New --no-expire switch to disable GUI popup when expired. + +Bug Fixes: +- pattern_prefix_period(): don't corrupt end-of-block. +- Fix subtle recursive resizing bug. +- Do not emit empty leading description in saved properties. +- For time sync over UDP, write replying time later! +- hash_table_resize(): clear last cached lookup! +- ev_link(): insert events in the proper bucket! + +Under the Hood: +- Updated GeoIP databases. +- Ad bit_generic_count_set(). +- Add plural_child(). +- Add progstart_was_called(). +- Add H_STRFREEV_NULL(). +- Add syn=c to *.ht and *.ct files for vim. +- Add hash_table_copy_foreach(). +- Add tm_precise_elapsed_ns() convenience routine. +- Add thread_stack_size() to get configured stack size. +- Add pattern_string() to get the string being looked for. +- Add str_2c_from() to grab C string from a given offset. +- Add eval_subst_atom(). +- Add stacktrace_caller_fast() and stack-test program. +- Add thread_{un}suspend(). +- Add tmalloc_contains() for assertions. +- Add public VMM validate/invalidate routines. +- Add macros to ease printing for tmval and tmspec. +- Add node_check() to node traversal loops. +- Avoid branches in SIGN() as well. +- Avoid regeneration of Geo DB if no data changes. +- Bump python dependency for jhbuild on OSX. +- Better clock skew computation. +- Handle time-sync exchanges via UDP better. +- Make use of travis cache feature for OSX builds. +- Only include <sys/sysctl.h> if we actually need it. +- Allow compilation with usemymalloc=n on 32-bit CPUs. +- Let mem_test() run only once. +- When no backtrace(), ensure we compile with a frame pointer. +- Compile with -DTRACK_MALLOC -DREMAP_ZALLOC again. +- Made -DTRACK_ZALLOC usable again. +- Do not check stack at longjmp() if on altstack. +- Do not trap hash_list_{new,free}() under REMAP_ZALLOC. +- Ensure properties use xmalloc() for their values. +- Wait until main() starts to allocate the signal chunk. +- Made ascii_toupper() and ascii_tolower() avoid branching. +- Trace saving time whithin property files. +- Trace page (PA) and offset within page on SEGV. +- Trace page protection on SEGV faults, if possible. +- Trace how and where symbols were loaded in crash log. +- Symbol quality definition moved to symbols! +- Windows: handle freopen("a") specially to allow read sharing. +- Windows: no need to dump stack again if no gdb. +- mutex: supply more context on lock errors. +- ostream: now also accepts str_t as output medium. +- rwlock: added debug option to track wlock location. +- random-test: added -a to benchmark all routines. +- random-test: add -v to be verbose when -a is used. +- VMM: added extra debugging tools / assertions. +- VMM: trace new compile-time options. +- clock: simplify code by using aging table. +- xmalloc: avoid late page pool creation. +- xmalloc: extended assertions to detect freelist corruption. +- zalloc: avoid warnings when compiling with REMAP_ZALLOC. +- zalloc: with ZONE_SAFE, ensure block tagging never changes! +- malloc.c: enhanced and fixed some errors with multi-threading. +- malloc.c: huge refactoring and cleanup. +- aging_destroy(): remove periodic GC before cleanup. +- bfd_util_init(): avoid warning on bfd_init() call. +- clock_adjust(): removed MAX_SDEV. +- clock_adjust(): stop pruning if we keep everything. +- clock_update(): lowered required amount of data. +- compat_setjmp(): protect against gone contexts. +- crash_handler_process(): only call crash_auto_restart() if needed. +- ev_free(): assert event is not linked in queue! +- ev_unlink(): added list consistency assertions. +- eval_subst(): remove the size limitation on the susbtituted string. +- evq_close(): be silent if event queue not created. +- fi_pick_rarest_chunk(): fixed assertion failure. +- fi_pick_rarest_chunk(): log assertion values. +- get_prop(): also trace failing property when ps is NULL. +- ggept_filesize_encode(): can return 0 if given 0. +- hash_compute_increment(): make it odd without branch. +- main(): do not set a crash dir if not running for long. +- name_to_single_host_addr(): use pslist_random(). +- ntp_send_probes(): comment updates, cleanup. +- once_recursive(): avoid calling stacktrace_function_name(). +- progstart_duplicate(): added assertions. +- prop_lock(): use macro for locking (hiding lock type). +- rwlock_deadlocked(): trace write owner if known. +- spinlock_loop(): document why no memory barrier. +- statusbar_gui_push_v(): be safe if called early. +- str_avail(): new implementation and semantics. +- str_ichar() and str_istr() can now append. +- strvec_cpy(): was failing when called with cnt=0. +- thread_id_name_to_buf(): be nicer with negative IDs. +- thread_lock_waiting_done(): cleanup when no problems. +- tok_version_valid(): no longer run clock_update(). +- xcopy(): not defined as inlined routine when TRACK_MALLOC. + +# v 1.2.0 2020-07-09 stable This is an evolution release, hence the minor version bump.
View file
gtk-gnutella-1.2.0.tar.xz/Configure -> gtk-gnutella-1.2.2.tar.xz/Configure
Changed
@@ -18,7 +18,7 @@ # $Id$ # -# Generated on Sat May 16 10:27:46 CEST 2020 metaconfig 3.5-255 +# Generated on Sun Jul 12 10:41:08 CEST 2020 metaconfig 3.5-255 cat >c1$$ <<EOF ARGGGHHHH!!!!! @@ -11083,17 +11083,28 @@ eval $inhdr : see whether we can omit the frame pointer +needframe= case "$gccversion" in '') ;; *) echo " " + needframe=y + case "$d_backtrace" in + "$define") needframe=n;; + esac $cat >try.c <<'EOC' int main() { return 0; } EOC - if $cc $ccflags -momit-leaf-frame-pointer $ldflags -o try try.c >/dev/null 2>&1 + ;; +esac +case "$needframe" in +n) + if + $cc $ccflags -momit-leaf-frame-pointer $ldflags \ + -o try try.c >/dev/null 2>&1 then case "$ccflags $optimize" in *-momit-leaf-frame-pointer*) ;; @@ -11112,7 +11123,29 @@ esac fi ;; +y) + if + $cc $ccflags -fno-omit-frame-pointer $ldflags \ + -o try try.c >/dev/null 2>&1 + then + case "$ccflags" in + *-fno-omit-frame-pointer*) ;; + *) + ccflags="-fno-omit-frame-pointer $ccflags" + echo "Added -fno-omit-frame-pointer to the cc flags." >&4 + ;; + esac + else + case "$ccflags" in + *-fno-omit-frame-pointer*) + echo "Stripping -fno-omit-frame-pointer from cc flags." >&4 + ccflags=`echo $ccflags | $sed 's/ *-fno-omit-frame-pointer//'` + ;; + esac + fi + ;; esac +$rm -f try try.c : see if deflate exists $cat >try.c <<EOC
View file
gtk-gnutella-1.2.0.tar.xz/MANIFEST -> gtk-gnutella-1.2.2.tar.xz/MANIFEST
Changed
@@ -852,6 +852,7 @@ src/lib/idtable.h src/lib/inputevt.c src/lib/inputevt.h +src/lib/iovec.c src/lib/iovec.h src/lib/iprange.c src/lib/iprange.h @@ -983,6 +984,7 @@ src/lib/spopen-test.c src/lib/spopen.c src/lib/spopen.h +src/lib/stack-test.c src/lib/stacktrace.c src/lib/stacktrace.h src/lib/stat-test.c
View file
gtk-gnutella-1.2.0.tar.xz/README -> gtk-gnutella-1.2.2.tar.xz/README
Changed
@@ -71,8 +71,8 @@ Open Discussion Forums, try: http://www.gnutellaforums.com/ -There is an IRC channel for gtk-gnutella on http://www.freenode.net: - irc.freenode.net #gtk-gnutella +There is an IRC channel for gtk-gnutella on https://libera.chat: + irc.libera.chat #gtk-gnutella Mailing lists
View file
gtk-gnutella-1.2.0.tar.xz/U/specific/Framepointer.U -> gtk-gnutella-1.2.2.tar.xz/U/specific/Framepointer.U
Changed
@@ -2,25 +2,38 @@ ?RCS: ?RCS: @COPYRIGHT@ ?RCS: -?MAKE:Framepointer: gccversion +cc +ccflags +ldflags +optimize cat sed +?MAKE:Framepointer: gccversion +cc +ccflags +ldflags +optimize cat sed rm \ + d_backtrace ?MAKE: -pick add $@ %< +?T:needframe ?F:!try !try.c ?LINT: change ccflags : see whether we can omit the frame pointer ?X: When gcc is used, see whether we can use -momit-leaf-frame-pointer ?X: This is useful for tail routines containing assertions if they use ?X: "fast assertions", given that the code is not calling any routine. +needframe= case "$gccversion" in '') ;; *) echo " " + needframe=y + case "$d_backtrace" in + "$define") needframe=n;; + esac $cat >try.c <<'EOC' int main() { return 0; } EOC - if $cc $ccflags -momit-leaf-frame-pointer $ldflags -o try try.c >/dev/null 2>&1 + ;; +esac +case "$needframe" in +n) + if + $cc $ccflags -momit-leaf-frame-pointer $ldflags \ + -o try try.c >/dev/null 2>&1 then case "$ccflags $optimize" in *-momit-leaf-frame-pointer*) ;; @@ -39,5 +52,27 @@ esac fi ;; +y) + if + $cc $ccflags -fno-omit-frame-pointer $ldflags \ + -o try try.c >/dev/null 2>&1 + then + case "$ccflags" in + *-fno-omit-frame-pointer*) ;; + *) + ccflags="-fno-omit-frame-pointer $ccflags" + echo "Added -fno-omit-frame-pointer to the cc flags." >&4 + ;; + esac + else + case "$ccflags" in + *-fno-omit-frame-pointer*) + echo "Stripping -fno-omit-frame-pointer from cc flags." >&4 + ccflags=`echo $ccflags | $sed 's/ *-fno-omit-frame-pointer//'` + ;; + esac + fi + ;; esac +$rm -f try try.c
View file
gtk-gnutella-1.2.0.tar.xz/debian/changelog -> gtk-gnutella-1.2.2.tar.xz/debian/changelog
Changed
@@ -1,3 +1,15 @@ +gtk-gnutella (1.2.2-1) unstable; urgency=high + + * New upstream release with major bug fixes. + + -- Raphael Manfredi <Raphael_Manfredi@pobox.com> Fri, 25 Feb 2022 07:32:37 +0000 + +gtk-gnutella (1.2.1-1) unstable; urgency=high + + * New upstream release with important bug fixes. + + -- Raphael Manfredi <Raphael_Manfredi@pobox.com> Mon, 12 Jul 2021 19:56:35 +0000 + gtk-gnutella (1.2.0-1) unstable; urgency=high * New upstream release with important bug fixes.
View file
gtk-gnutella-1.2.0.tar.xz/extra_files/Jmakefile -> gtk-gnutella-1.2.2.tar.xz/extra_files/Jmakefile
Changed
@@ -64,7 +64,7 @@ ;# Update the bogons and GeoIp databases ;# -update: update_bogons update_geoip4 update_geoip6 +update: update_bogons geo-ip.txt geo-ipv6.txt update_bogons: ;# Target disabled, site seems to be down definitively? -- RAM, 2009-01-16 @@ -77,23 +77,35 @@ GEODB6 = IP2LOCATION-LITE-DB1.IPV6.CSV TMP = tmp -update_geoip4: - rm -f $(GEODB4).ZIP - rm -rf $(TMP) - wget $(URL4) - mkdir $(TMP) - (cd $(TMP); unzip ../$(GEODB4).ZIP) - (cd $(TMP); \ - ../$(TOP)/scripts/geo-to-db.pl -ic $(GEODB4) >../geo-ip.txt) - -update_geoip6: - rm -f $(GEODB6).ZIP - rm -rf $(TMP) - wget $(URL6) - mkdir $(TMP) - (cd $(TMP); unzip ../$(GEODB6).ZIP) - (cd $(TMP); \ - ../$(TOP)/scripts/geo6-to-db.pl -i $(GEODB6) >../geo-ipv6.txt) +.FORCE: + +$(GEODB4).ZIP: .FORCE + @if test -f $(TOP)/.package; then \ + wget -N $(URL4); \ + else touch $@; fi + +$(GEODB6).ZIP: .FORCE + @if test -f $(TOP)/.package; then \ + wget -N $(URL6); \ + else touch $@; fi + +geo-ip.txt: $(GEODB4).ZIP + @if test -f $(TOP)/.package; then \ + rm -rf $(TMP); \ + mkdir $(TMP); \ + (cd $(TMP); unzip ../$(GEODB4).ZIP); \ + (cd $(TMP); \ + ../$(TOP)/scripts/geo-to-db.pl -ic $(GEODB4) >../geo-ip.txt); \ + else touch $@; fi + +geo-ipv6.txt: $(GEODB6).ZIP + @if test -f $(TOP)/.package; then \ + rm -rf $(TMP); \ + mkdir $(TMP); \ + (cd $(TMP); unzip ../$(GEODB6).ZIP); \ + (cd $(TMP); \ + ../$(TOP)/scripts/geo6-to-db.pl -i $(GEODB6) >../geo-ipv6.txt); \ + else touch $@; fi local_clean:: rm -rf $(TMP)
View file
gtk-gnutella-1.2.0.tar.xz/extra_files/Makefile.SH -> gtk-gnutella-1.2.2.tar.xz/extra_files/Makefile.SH
Changed
@@ -1,4 +1,4 @@ -: Makefile.SH generated from Jmake.tmpl and Jmakefile jmake 3.5-255 +: Makefile.SH generated from Jmake.tmpl and Jmakefile jmake 3.5-258 : $X-Id$ case $CONFIG in @@ -165,7 +165,7 @@ # Update the bogons and GeoIp databases # -update: update_bogons update_geoip4 update_geoip6 +update: update_bogons geo-ip.txt geo-ipv6.txt update_bogons: # Target disabled, site seems to be down definitively? -- RAM, 2009-01-16 @@ -178,23 +178,35 @@ GEODB6 = IP2LOCATION-LITE-DB1.IPV6.CSV TMP = tmp -update_geoip4: - rm -f $(GEODB4).ZIP - rm -rf $(TMP) - wget $(URL4) - mkdir $(TMP) - (cd $(TMP); unzip ../$(GEODB4).ZIP) - (cd $(TMP); \ - ../$(TOP)/scripts/geo-to-db.pl -ic $(GEODB4) >../geo-ip.txt) +.FORCE: -update_geoip6: - rm -f $(GEODB6).ZIP - rm -rf $(TMP) - wget $(URL6) - mkdir $(TMP) - (cd $(TMP); unzip ../$(GEODB6).ZIP) - (cd $(TMP); \ - ../$(TOP)/scripts/geo6-to-db.pl -i $(GEODB6) >../geo-ipv6.txt) +$(GEODB4).ZIP: .FORCE + @if test -f $(TOP)/.package; then \ + wget -N $(URL4); \ + else touch $@; fi + +$(GEODB6).ZIP: .FORCE + @if test -f $(TOP)/.package; then \ + wget -N $(URL6); \ + else touch $@; fi + +geo-ip.txt: $(GEODB4).ZIP + @if test -f $(TOP)/.package; then \ + rm -rf $(TMP); \ + mkdir $(TMP); \ + (cd $(TMP); unzip ../$(GEODB4).ZIP); \ + (cd $(TMP); \ + ../$(TOP)/scripts/geo-to-db.pl -ic $(GEODB4) >../geo-ip.txt); \ + else touch $@; fi + +geo-ipv6.txt: $(GEODB6).ZIP + @if test -f $(TOP)/.package; then \ + rm -rf $(TMP); \ + mkdir $(TMP); \ + (cd $(TMP); unzip ../$(GEODB6).ZIP); \ + (cd $(TMP); \ + ../$(TOP)/scripts/geo6-to-db.pl -i $(GEODB6) >../geo-ipv6.txt); \ + else touch $@; fi local_clean:: rm -rf $(TMP)
View file
gtk-gnutella-1.2.0.tar.xz/extra_files/geo-ip.txt -> gtk-gnutella-1.2.2.tar.xz/extra_files/geo-ip.txt
Changed
@@ -1,7 +1,7 @@ # IP2Location LITE - http://lite.ip2location.com/ # Redistributed under the Creative Commons Attribution-ShareAlike 4.0 # (see the GEO_LICENCE file at the top of the source tree) -# Conversion for GTKG generated on Fri Jul 3 08:33:30 2020 GMT +# Conversion for GTKG generated on Fri Feb 25 07:29:32 2022 GMT 1.0.0.0/24 us 1.0.1.0/24 cn 1.0.2.0/23 cn @@ -45,7 +45,7 @@ 1.9.0.0/16 my 1.10.0.0/21 cn 1.10.8.0/23 cn -1.10.10.0/24 au +1.10.10.0/24 in 1.10.11.0/24 cn 1.10.12.0/22 cn 1.10.16.0/20 cn @@ -73,8 +73,7 @@ 1.32.206.0/23 sg 1.32.208.0/21 tw 1.32.216.0/23 kr -1.32.218.0/24 hk -1.32.219.0/24 kr +1.32.218.0/23 hk 1.32.220.0/24 kr 1.32.221.0/24 hk 1.32.222.0/23 kr @@ -121,8 +120,29 @@ 1.174.224.0/19 tw 1.175.0.0/16 tw 1.176.0.0/15 kr -1.178.0.0/16 au -1.179.0.0/17 au +1.178.0.0/19 au +1.178.32.0/20 br +1.178.48.0/20 ar +1.178.64.0/19 au +1.178.96.0/20 au +1.178.112.0/20 ps +1.178.128.0/20 ps +1.178.144.0/20 au +1.178.160.0/19 au +1.178.192.0/20 au +1.178.208.0/21 hk +1.178.216.0/21 sg +1.178.224.0/19 es +1.179.0.0/19 au +1.179.32.0/21 au +1.179.40.0/21 ps +1.179.48.0/20 au +1.179.64.0/21 au +1.179.72.0/21 ps +1.179.80.0/21 au +1.179.88.0/21 ps +1.179.96.0/20 au +1.179.112.0/20 fr 1.179.128.0/17 th 1.180.0.0/14 cn 1.184.0.0/15 cn @@ -136,18 +156,21 @@ 1.208.0.0/12 kr 1.224.0.0/11 kr 2.0.0.0/12 fr -2.16.0.0/24 be -2.16.1.0/24 nl -2.16.2.0/23 fr +2.16.0.0/24 fr +2.16.1.0/24 pl +2.16.2.0/24 cz +2.16.3.0/24 fr 2.16.4.0/23 gb -2.16.6.0/24 nl -2.16.7.0/24 de +2.16.6.0/23 de 2.16.8.0/24 es 2.16.9.0/24 de -2.16.10.0/24 de -2.16.11.0/24 be -2.16.12.0/22 nl -2.16.16.0/23 nl +2.16.10.0/24 at +2.16.11.0/24 fr +2.16.12.0/23 ch +2.16.14.0/24 gb +2.16.15.0/24 br +2.16.16.0/24 nl +2.16.17.0/24 it 2.16.18.0/24 nl 2.16.19.0/24 gr 2.16.20.0/23 gb @@ -155,17 +178,19 @@ 2.16.23.0/24 de 2.16.24.0/24 cz 2.16.25.0/24 pl -2.16.26.0/23 gb -2.16.28.0/23 be +2.16.26.0/24 gb +2.16.27.0/24 nl +2.16.28.0/24 us +2.16.29.0/24 de 2.16.30.0/23 de 2.16.32.0/23 de -2.16.34.0/24 be +2.16.34.0/24 fr 2.16.35.0/24 gb 2.16.36.0/24 au 2.16.37.0/24 gb 2.16.38.0/23 es -2.16.40.0/24 us -2.16.41.0/24 be +2.16.40.0/24 sg +2.16.41.0/24 de 2.16.42.0/23 nl 2.16.44.0/24 cz 2.16.45.0/24 gb @@ -185,11 +210,11 @@ 2.16.63.0/24 dk 2.16.64.0/24 de 2.16.65.0/24 pt -2.16.66.0/23 de +2.16.66.0/23 se 2.16.68.0/23 se 2.16.70.0/23 it -2.16.72.0/23 es -2.16.74.0/23 us +2.16.72.0/23 pe +2.16.74.0/23 gb 2.16.76.0/24 gb 2.16.77.0/24 gh 2.16.78.0/23 es @@ -198,11 +223,10 @@ 2.16.84.0/23 nl 2.16.86.0/23 it 2.16.88.0/24 tr -2.16.89.0/24 be -2.16.90.0/24 gb -2.16.91.0/24 de +2.16.89.0/24 fr +2.16.90.0/23 de 2.16.92.0/24 ch -2.16.93.0/24 be +2.16.93.0/24 fr 2.16.94.0/23 nl 2.16.96.0/23 pl 2.16.98.0/23 cz @@ -212,77 +236,78 @@ 2.16.104.0/22 de 2.16.108.0/24 es 2.16.109.0/24 gb -2.16.110.0/23 us -2.16.112.0/23 nl +2.16.110.0/23 de +2.16.112.0/23 fr 2.16.114.0/23 gb -2.16.116.0/24 de +2.16.116.0/24 se 2.16.117.0/24 fr 2.16.118.0/23 fr -2.16.120.0/24 fr -2.16.121.0/24 be +2.16.120.0/23 fr 2.16.122.0/23 de -2.16.124.0/23 be +2.16.124.0/23 fr 2.16.126.0/24 gb -2.16.127.0/24 nl +2.16.127.0/24 pl 2.16.128.0/24 de 2.16.129.0/24 gb -2.16.130.0/24 us +2.16.130.0/24 se 2.16.131.0/24 gb 2.16.132.0/23 nl -2.16.134.0/24 gb +2.16.134.0/24 cm 2.16.135.0/24 it 2.16.136.0/23 gb 2.16.138.0/23 ie 2.16.140.0/23 za 2.16.142.0/23 gb -2.16.144.0/23 be +2.16.144.0/23 fi 2.16.146.0/23 it -2.16.148.0/22 gb -2.16.152.0/24 de -2.16.153.0/24 pl -2.16.154.0/24 gb +2.16.148.0/23 gb +2.16.150.0/23 tr +2.16.152.0/24 gb +2.16.153.0/24 nl +2.16.154.0/24 ru 2.16.155.0/24 se 2.16.156.0/24 fr 2.16.157.0/24 de 2.16.158.0/24 ae 2.16.159.0/24 ru -2.16.160.0/23 gb +2.16.160.0/23 ru
View file
gtk-gnutella-1.2.0.tar.xz/extra_files/geo-ipv6.txt -> gtk-gnutella-1.2.2.tar.xz/extra_files/geo-ipv6.txt
Changed
@@ -1,7 +1,7 @@ # IP2Location LITE - http://lite.ip2location.com/ # Redistributed under the Creative Commons Attribution-ShareAlike 4.0 # (see the GEO_LICENCE file at the top of the source tree) -# Conversion for GTKG generated on Fri Jul 3 08:33:41 2020 GMT +# Conversion for GTKG generated on Fri Feb 25 07:29:44 2022 GMT ::ffff:100:0/120 us ::ffff:100:100/120 cn ::ffff:100:200/119 cn @@ -45,7 +45,7 @@ ::ffff:109:0/112 my ::ffff:10a:0/117 cn ::ffff:10a:800/119 cn -::ffff:10a:a00/120 au +::ffff:10a:a00/120 in ::ffff:10a:b00/120 cn ::ffff:10a:c00/118 cn ::ffff:10a:1000/116 cn @@ -73,8 +73,7 @@ ::ffff:120:ce00/119 sg ::ffff:120:d000/117 tw ::ffff:120:d800/119 kr -::ffff:120:da00/120 hk -::ffff:120:db00/120 kr +::ffff:120:da00/119 hk ::ffff:120:dc00/120 kr ::ffff:120:dd00/120 hk ::ffff:120:de00/119 kr @@ -121,8 +120,29 @@ ::ffff:1ae:e000/115 tw ::ffff:1af:0/112 tw ::ffff:1b0:0/111 kr -::ffff:1b2:0/112 au -::ffff:1b3:0/113 au +::ffff:1b2:0/115 au +::ffff:1b2:2000/116 br +::ffff:1b2:3000/116 ar +::ffff:1b2:4000/115 au +::ffff:1b2:6000/116 au +::ffff:1b2:7000/116 ps +::ffff:1b2:8000/116 ps +::ffff:1b2:9000/116 au +::ffff:1b2:a000/115 au +::ffff:1b2:c000/116 au +::ffff:1b2:d000/117 hk +::ffff:1b2:d800/117 sg +::ffff:1b2:e000/115 es +::ffff:1b3:0/115 au +::ffff:1b3:2000/117 au +::ffff:1b3:2800/117 ps +::ffff:1b3:3000/116 au +::ffff:1b3:4000/117 au +::ffff:1b3:4800/117 ps +::ffff:1b3:5000/117 au +::ffff:1b3:5800/117 ps +::ffff:1b3:6000/116 au +::ffff:1b3:7000/116 fr ::ffff:1b3:8000/113 th ::ffff:1b4:0/110 cn ::ffff:1b8:0/111 cn @@ -136,18 +156,21 @@ ::ffff:1d0:0/108 kr ::ffff:1e0:0/107 kr ::ffff:200:0/108 fr -::ffff:210:0/120 be -::ffff:210:100/120 nl -::ffff:210:200/119 fr +::ffff:210:0/120 fr +::ffff:210:100/120 pl +::ffff:210:200/120 cz +::ffff:210:300/120 fr ::ffff:210:400/119 gb -::ffff:210:600/120 nl -::ffff:210:700/120 de +::ffff:210:600/119 de ::ffff:210:800/120 es ::ffff:210:900/120 de -::ffff:210:a00/120 de -::ffff:210:b00/120 be -::ffff:210:c00/118 nl -::ffff:210:1000/119 nl +::ffff:210:a00/120 at +::ffff:210:b00/120 fr +::ffff:210:c00/119 ch +::ffff:210:e00/120 gb +::ffff:210:f00/120 br +::ffff:210:1000/120 nl +::ffff:210:1100/120 it ::ffff:210:1200/120 nl ::ffff:210:1300/120 gr ::ffff:210:1400/119 gb @@ -155,17 +178,19 @@ ::ffff:210:1700/120 de ::ffff:210:1800/120 cz ::ffff:210:1900/120 pl -::ffff:210:1a00/119 gb -::ffff:210:1c00/119 be +::ffff:210:1a00/120 gb +::ffff:210:1b00/120 nl +::ffff:210:1c00/120 us +::ffff:210:1d00/120 de ::ffff:210:1e00/119 de ::ffff:210:2000/119 de -::ffff:210:2200/120 be +::ffff:210:2200/120 fr ::ffff:210:2300/120 gb ::ffff:210:2400/120 au ::ffff:210:2500/120 gb ::ffff:210:2600/119 es -::ffff:210:2800/120 us -::ffff:210:2900/120 be +::ffff:210:2800/120 sg +::ffff:210:2900/120 de ::ffff:210:2a00/119 nl ::ffff:210:2c00/120 cz ::ffff:210:2d00/120 gb @@ -185,11 +210,11 @@ ::ffff:210:3f00/120 dk ::ffff:210:4000/120 de ::ffff:210:4100/120 pt -::ffff:210:4200/119 de +::ffff:210:4200/119 se ::ffff:210:4400/119 se ::ffff:210:4600/119 it -::ffff:210:4800/119 es -::ffff:210:4a00/119 us +::ffff:210:4800/119 pe +::ffff:210:4a00/119 gb ::ffff:210:4c00/120 gb ::ffff:210:4d00/120 gh ::ffff:210:4e00/119 es @@ -198,11 +223,10 @@ ::ffff:210:5400/119 nl ::ffff:210:5600/119 it ::ffff:210:5800/120 tr -::ffff:210:5900/120 be -::ffff:210:5a00/120 gb -::ffff:210:5b00/120 de +::ffff:210:5900/120 fr +::ffff:210:5a00/119 de ::ffff:210:5c00/120 ch -::ffff:210:5d00/120 be +::ffff:210:5d00/120 fr ::ffff:210:5e00/119 nl ::ffff:210:6000/119 pl ::ffff:210:6200/119 cz @@ -212,77 +236,78 @@ ::ffff:210:6800/118 de ::ffff:210:6c00/120 es ::ffff:210:6d00/120 gb -::ffff:210:6e00/119 us -::ffff:210:7000/119 nl +::ffff:210:6e00/119 de +::ffff:210:7000/119 fr ::ffff:210:7200/119 gb -::ffff:210:7400/120 de +::ffff:210:7400/120 se ::ffff:210:7500/120 fr ::ffff:210:7600/119 fr -::ffff:210:7800/120 fr -::ffff:210:7900/120 be +::ffff:210:7800/119 fr ::ffff:210:7a00/119 de -::ffff:210:7c00/119 be +::ffff:210:7c00/119 fr ::ffff:210:7e00/120 gb -::ffff:210:7f00/120 nl +::ffff:210:7f00/120 pl ::ffff:210:8000/120 de ::ffff:210:8100/120 gb -::ffff:210:8200/120 us +::ffff:210:8200/120 se ::ffff:210:8300/120 gb ::ffff:210:8400/119 nl -::ffff:210:8600/120 gb +::ffff:210:8600/120 cm ::ffff:210:8700/120 it ::ffff:210:8800/119 gb ::ffff:210:8a00/119 ie ::ffff:210:8c00/119 za ::ffff:210:8e00/119 gb -::ffff:210:9000/119 be +::ffff:210:9000/119 fi ::ffff:210:9200/119 it -::ffff:210:9400/118 gb -::ffff:210:9800/120 de -::ffff:210:9900/120 pl -::ffff:210:9a00/120 gb +::ffff:210:9400/119 gb +::ffff:210:9600/119 tr +::ffff:210:9800/120 gb +::ffff:210:9900/120 nl +::ffff:210:9a00/120 ru ::ffff:210:9b00/120 se ::ffff:210:9c00/120 fr ::ffff:210:9d00/120 de ::ffff:210:9e00/120 ae ::ffff:210:9f00/120 ru -::ffff:210:a000/119 gb +::ffff:210:a000/119 ru
View file
gtk-gnutella-1.2.0.tar.xz/po/POTFILES.in -> gtk-gnutella-1.2.2.tar.xz/po/POTFILES.in
Changed
@@ -1,5 +1,5 @@ # List of source files containing translatable strings. -# Regenerated on Thu Jul 9 10:54:55 CEST 2020 +# Regenerated on Fri Feb 25 08:30:11 CET 2022 src/core/ban.c src/core/downloads.c @@ -52,8 +52,6 @@ src/ui/gtk/filter.c src/ui/gtk/filter_core.c src/ui/gtk/gnet_stats_common.c -src/ui/gtk/gtk-missing.c -src/ui/gtk/gtk-shared/callbacks.c src/ui/gtk/gtk1/callbacks.c src/ui/gtk/gtk1/interface-glade.t src/ui/gtk/gtk1/nodes.c @@ -72,9 +70,11 @@ src/ui/gtk/gtk2/search_cb.c src/ui/gtk/gtk2/search_stats.c src/ui/gtk/gtk2/support-glade.c -src/ui/gtk/gtk2/upload_stats.c src/ui/gtk/gtk2/uploads.c +src/ui/gtk/gtk2/upload_stats.c src/ui/gtk/gtkcolumnchooser.c +src/ui/gtk/gtk-missing.c +src/ui/gtk/gtk-shared/callbacks.c src/ui/gtk/hcache_common.c src/ui/gtk/icon.c src/ui/gtk/main.c
View file
gtk-gnutella-1.2.0.tar.xz/po/de.po -> gtk-gnutella-1.2.2.tar.xz/po/de.po
Changed
@@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: gtk-gnutella\n" "Report-Msgid-Bugs-To: gtk-gnutella-devel@lists.sf.net\n" -"POT-Creation-Date: 2020-07-09 10:54+0200\n" +"POT-Creation-Date: 2021-07-12 21:45+0200\n" "PO-Revision-Date: 2016-02-15 08:28+0000\n" "Last-Translator: Jeroen Asselman <jeroen@asselman.com>\n" "Language-Team: German (http://www.transifex.com/gtk-gnutella/gtk-gnutella/" @@ -747,6 +747,10 @@ msgid "Another gtk-gnutella is running as PID %lu" msgstr "" +#, c-format +msgid "If PID %lu is not a gtk-gnutella process, run:" +msgstr "" + msgid "Cannot proceed without valid configuration directory" msgstr "Kann ohne gültiges Konfigurationsverzeichnis nicht fortfahren" @@ -4913,6 +4917,56 @@ msgid "Debug level for the ADNS (asynchronous DNS) thread." msgstr "Debug-Level für die Oberfläche" +#, fuzzy +msgid "Total outgoing HTTP traffic in bytes for this session." +msgstr "Bandbreitenbegrenzung für ausgehenden HTTP-Verkehr in Bytes/s" + +msgid "Total outgoing Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total outgoing DHT traffic in bytes for this session." +msgstr "Bandbreitenbegrenzung für ausgehenden HTTP-Verkehr in Bytes/s" + +msgid "" +"Total outgoing traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total outgoing traffic in bytes on the private addresses for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming HTTP traffic in bytes for this session." +msgstr "Bandbreitenbegrenzung für eingehenden HTTP-Verkehr in Bytes/s" + +msgid "Total incoming Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming DHT traffic in bytes for this session." +msgstr "Bandbreitenbegrenzung für eingehenden HTTP-Verkehr in Bytes/s" + +msgid "" +"Total incoming traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total incoming traffic in bytes on the private addresses for this session." +msgstr "" + msgid "disable" msgstr "deaktiviert" @@ -7734,8 +7788,8 @@ msgid "Measured HTTP latency:" msgstr "Gemessene HTTP-Latenz:" -msgid "Meet us on #gtk-gnutella at irc.freenode.net." -msgstr "Triff uns in #gtk-gnutella auf irc.freenode.net." +msgid "Meet us on #gtk-gnutella at irc.libera.chat." +msgstr "Triff uns in #gtk-gnutella auf irc.libera.chat." msgid "Min/Max:" msgstr "" @@ -8926,6 +8980,10 @@ msgstr "Filter _löschen" #, fuzzy +msgid "Meet us on #gtk-gnutella at libera.chat." +msgstr "Triff uns in #gtk-gnutella auf irc.libera.chat." + +#, fuzzy msgid "" "This product includes IP2Location LITE data, available from\n" "https://lite.ip2location.com/"
View file
gtk-gnutella-1.2.0.tar.xz/po/el.po -> gtk-gnutella-1.2.2.tar.xz/po/el.po
Changed
@@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: gtk-gnutella\n" "Report-Msgid-Bugs-To: gtk-gnutella-devel@lists.sf.net\n" -"POT-Creation-Date: 2020-07-09 10:54+0200\n" +"POT-Creation-Date: 2021-07-12 21:45+0200\n" "PO-Revision-Date: 2016-02-15 08:28+0000\n" "Last-Translator: Jeroen Asselman <jeroen@asselman.com>\n" "Language-Team: Greek (http://www.transifex.com/gtk-gnutella/gtk-gnutella/" @@ -748,6 +748,10 @@ msgid "Another gtk-gnutella is running as PID %lu" msgstr "" +#, c-format +msgid "If PID %lu is not a gtk-gnutella process, run:" +msgstr "" + msgid "Cannot proceed without valid configuration directory" msgstr "Δεν είναι δυνατή η συνέχεια χωρίς έναν έγκυρο κατάλογο ρυθμίσεων" @@ -4897,6 +4901,56 @@ msgid "Debug level for the ADNS (asynchronous DNS) thread." msgstr "Επίπεδο αποσφαλμάτωσης κυκλοφορίας επιπέδου UDP." +#, fuzzy +msgid "Total outgoing HTTP traffic in bytes for this session." +msgstr "Όριο εύρους εξερχόμενης κυκλοφορίας HTTP σε bytes/sec." + +msgid "Total outgoing Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total outgoing DHT traffic in bytes for this session." +msgstr "Όριο εύρους εξερχόμενης κυκλοφορίας HTTP σε bytes/sec." + +msgid "" +"Total outgoing traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total outgoing traffic in bytes on the private addresses for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming HTTP traffic in bytes for this session." +msgstr "Όριο εύρους εισερχόμενης κυκλοφορίας HTTP σε bytes/sec." + +msgid "Total incoming Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming DHT traffic in bytes for this session." +msgstr "Όριο εύρους εισερχόμενης κυκλοφορίας HTTP σε bytes/sec." + +msgid "" +"Total incoming traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total incoming traffic in bytes on the private addresses for this session." +msgstr "" + msgid "disable" msgstr "απενεργοποίηση" @@ -7727,8 +7781,8 @@ msgid "Measured HTTP latency:" msgstr "Μέτρηση καθυστέρησης HTTP:" -msgid "Meet us on #gtk-gnutella at irc.freenode.net." -msgstr "Βρείτε μας στο #gtk-gnutella στο irc.freenode.net." +msgid "Meet us on #gtk-gnutella at irc.libera.chat." +msgstr "Βρείτε μας στο #gtk-gnutella στο irc.libera.chat." msgid "Min/Max:" msgstr "Ελαχ/μεγ:" @@ -8925,6 +8979,10 @@ msgstr "_Αφαίρεση φίλτρου" #, fuzzy +msgid "Meet us on #gtk-gnutella at libera.chat." +msgstr "Βρείτε μας στο #gtk-gnutella στο irc.libera.chat." + +#, fuzzy msgid "" "This product includes IP2Location LITE data, available from\n" "https://lite.ip2location.com/"
View file
gtk-gnutella-1.2.0.tar.xz/po/es.po -> gtk-gnutella-1.2.2.tar.xz/po/es.po
Changed
@@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: gtk-gnutella\n" "Report-Msgid-Bugs-To: gtk-gnutella-devel@lists.sf.net\n" -"POT-Creation-Date: 2020-07-09 10:54+0200\n" +"POT-Creation-Date: 2021-07-12 21:45+0200\n" "PO-Revision-Date: 2016-02-15 08:28+0000\n" "Last-Translator: Jeroen Asselman <jeroen@asselman.com>\n" "Language-Team: Spanish (http://www.transifex.com/gtk-gnutella/gtk-gnutella/" @@ -749,6 +749,10 @@ msgid "Another gtk-gnutella is running as PID %lu" msgstr "" +#, c-format +msgid "If PID %lu is not a gtk-gnutella process, run:" +msgstr "" + msgid "Cannot proceed without valid configuration directory" msgstr "No se puede continuar sin una configuración de directorio válida" @@ -5150,6 +5154,56 @@ msgid "Debug level for the ADNS (asynchronous DNS) thread." msgstr "Nivel de depuración para búsquedas en cola de usuarios DHT." +#, fuzzy +msgid "Total outgoing HTTP traffic in bytes for this session." +msgstr "Ancho de banda límite para tráfico HTTP saliente, en bytes/seg." + +msgid "Total outgoing Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total outgoing DHT traffic in bytes for this session." +msgstr "Ancho de banda límite para tráfico HTTP saliente, en bytes/seg." + +msgid "" +"Total outgoing traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total outgoing traffic in bytes on the private addresses for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming HTTP traffic in bytes for this session." +msgstr "Ancho de banda límite para tráfico HTTP entrante, en bytes/seg." + +msgid "Total incoming Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming DHT traffic in bytes for this session." +msgstr "Ancho de banda límite para tráfico HTTP entrante, en bytes/seg." + +msgid "" +"Total incoming traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total incoming traffic in bytes on the private addresses for this session." +msgstr "" + msgid "disable" msgstr "desactivar" @@ -7990,8 +8044,8 @@ msgid "Measured HTTP latency:" msgstr "Latencia HTTP medida:" -msgid "Meet us on #gtk-gnutella at irc.freenode.net." -msgstr "Conózcanos en #gtk-gnutella en irc.freenode.net." +msgid "Meet us on #gtk-gnutella at irc.libera.chat." +msgstr "Conózcanos en #gtk-gnutella en irc.libera.chat." msgid "Min/Max:" msgstr "Mín/Máx:" @@ -9204,6 +9258,10 @@ msgstr "_Borrar filtro" #, fuzzy +msgid "Meet us on #gtk-gnutella at libera.chat." +msgstr "Conózcanos en #gtk-gnutella en irc.libera.chat." + +#, fuzzy msgid "" "This product includes IP2Location LITE data, available from\n" "https://lite.ip2location.com/"
View file
gtk-gnutella-1.2.0.tar.xz/po/fr.po -> gtk-gnutella-1.2.2.tar.xz/po/fr.po
Changed
@@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: gtk-gnutella\n" "Report-Msgid-Bugs-To: gtk-gnutella-devel@lists.sf.net\n" -"POT-Creation-Date: 2020-07-09 10:54+0200\n" +"POT-Creation-Date: 2021-07-12 21:45+0200\n" "PO-Revision-Date: 2018-06-02 16:25+0300\n" "Last-Translator: mauron\n" "Language-Team: French (http://www.transifex.com/gtk-gnutella/gtk-gnutella/" @@ -755,6 +755,10 @@ msgstr "" "Un autre gtk-gnutella est en cours de fonctionnement en tant que PID %lu" +#, c-format +msgid "If PID %lu is not a gtk-gnutella process, run:" +msgstr "" + msgid "Cannot proceed without valid configuration directory" msgstr "Ne peut continuer sans un répertoire de configuration valide" @@ -5325,6 +5329,56 @@ msgid "Debug level for the ADNS (asynchronous DNS) thread." msgstr "Niveau de débogage pour le code de synchronisation du temps." +#, fuzzy +msgid "Total outgoing HTTP traffic in bytes for this session." +msgstr "Limite de bande passante pour le trafic HTTP sortant en octets/sec." + +msgid "Total outgoing Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total outgoing DHT traffic in bytes for this session." +msgstr "Limite de bande passante pour le trafic HTTP sortant en octets/sec." + +msgid "" +"Total outgoing traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total outgoing traffic in bytes on the private addresses for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming HTTP traffic in bytes for this session." +msgstr "Limite de bande passante pour le trafic HTTP entrant en octets/sec." + +msgid "Total incoming Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming DHT traffic in bytes for this session." +msgstr "Limite de bande passante pour le trafic HTTP entrant en octets/sec." + +msgid "" +"Total incoming traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total incoming traffic in bytes on the private addresses for this session." +msgstr "" + msgid "disable" msgstr "désactiver" @@ -8198,8 +8252,8 @@ msgid "Measured HTTP latency:" msgstr "Latence HTTP mesurée :" -msgid "Meet us on #gtk-gnutella at irc.freenode.net." -msgstr "Rencontrez nous sur #gtk-gnutella sur irc.freenode.net." +msgid "Meet us on #gtk-gnutella at irc.libera.chat." +msgstr "Rencontrez nous sur #gtk-gnutella sur irc.libera.chat." msgid "Min/Max:" msgstr "Min/Max :" @@ -9426,6 +9480,10 @@ msgstr "_Supprimer le filtre" #, fuzzy +msgid "Meet us on #gtk-gnutella at libera.chat." +msgstr "Rencontrez nous sur #gtk-gnutella sur irc.libera.chat." + +#, fuzzy msgid "" "This product includes IP2Location LITE data, available from\n" "https://lite.ip2location.com/"
View file
gtk-gnutella-1.2.0.tar.xz/po/gtk-gnutella.pot -> gtk-gnutella-1.2.2.tar.xz/po/gtk-gnutella.pot
Changed
@@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: gtk-gnutella 1.1.15\n" "Report-Msgid-Bugs-To: gtk-gnutella-devel@lists.sf.net\n" -"POT-Creation-Date: 2020-07-09 10:54+0200\n" +"POT-Creation-Date: 2021-07-12 21:45+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -747,6 +747,10 @@ msgid "Another gtk-gnutella is running as PID %lu" msgstr "" +#, c-format +msgid "If PID %lu is not a gtk-gnutella process, run:" +msgstr "" + msgid "Cannot proceed without valid configuration directory" msgstr "" @@ -4594,6 +4598,52 @@ msgid "Debug level for the ADNS (asynchronous DNS) thread." msgstr "" +msgid "Total outgoing HTTP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella UDP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing DHT traffic in bytes for this session." +msgstr "" + +msgid "" +"Total outgoing traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total outgoing traffic in bytes on the private addresses for this session." +msgstr "" + +msgid "Total incoming HTTP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella UDP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming DHT traffic in bytes for this session." +msgstr "" + +msgid "" +"Total incoming traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total incoming traffic in bytes on the private addresses for this session." +msgstr "" + msgid "disable" msgstr "" @@ -7358,7 +7408,7 @@ msgid "Measured HTTP latency:" msgstr "" -msgid "Meet us on #gtk-gnutella at irc.freenode.net." +msgid "Meet us on #gtk-gnutella at irc.libera.chat." msgstr "" msgid "Min/Max:" @@ -8513,6 +8563,9 @@ msgid "_Remove filter" msgstr "" +msgid "Meet us on #gtk-gnutella at libera.chat." +msgstr "" + msgid "" "This product includes IP2Location LITE data, available from\n" "https://lite.ip2location.com/"
View file
gtk-gnutella-1.2.0.tar.xz/po/hu.po -> gtk-gnutella-1.2.2.tar.xz/po/hu.po
Changed
@@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: gtk-gnutella\n" "Report-Msgid-Bugs-To: gtk-gnutella-devel@lists.sf.net\n" -"POT-Creation-Date: 2020-07-09 10:54+0200\n" +"POT-Creation-Date: 2021-07-12 21:45+0200\n" "PO-Revision-Date: 2016-02-15 08:28+0000\n" "Last-Translator: Jeroen Asselman <jeroen@asselman.com>\n" "Language-Team: Hungarian (http://www.transifex.com/gtk-gnutella/gtk-gnutella/" @@ -747,6 +747,10 @@ msgid "Another gtk-gnutella is running as PID %lu" msgstr "" +#, c-format +msgid "If PID %lu is not a gtk-gnutella process, run:" +msgstr "" + msgid "Cannot proceed without valid configuration directory" msgstr "Nem lehet továbblépni érvényes beállításmappa nélkül" @@ -4673,6 +4677,52 @@ msgid "Debug level for the ADNS (asynchronous DNS) thread." msgstr "" +msgid "Total outgoing HTTP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella UDP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing DHT traffic in bytes for this session." +msgstr "" + +msgid "" +"Total outgoing traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total outgoing traffic in bytes on the private addresses for this session." +msgstr "" + +msgid "Total incoming HTTP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella UDP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming DHT traffic in bytes for this session." +msgstr "" + +msgid "" +"Total incoming traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total incoming traffic in bytes on the private addresses for this session." +msgstr "" + msgid "disable" msgstr "" @@ -7459,8 +7509,8 @@ msgid "Measured HTTP latency:" msgstr "Mért HTTP késés:" -msgid "Meet us on #gtk-gnutella at irc.freenode.net." -msgstr "Találkozzznk a „#gtk-gnutella” csatornán az „irc.freenode.net”-en!" +msgid "Meet us on #gtk-gnutella at irc.libera.chat." +msgstr "Találkozzznk a „#gtk-gnutella” csatornán az „irc.libera.chat”-en!" msgid "Min/Max:" msgstr "" @@ -8625,6 +8675,10 @@ msgid "_Remove filter" msgstr "" +#, fuzzy +msgid "Meet us on #gtk-gnutella at libera.chat." +msgstr "Találkozzznk a „#gtk-gnutella” csatornán az „irc.libera.chat”-en!" + msgid "" "This product includes IP2Location LITE data, available from\n" "https://lite.ip2location.com/"
View file
gtk-gnutella-1.2.0.tar.xz/po/it.po -> gtk-gnutella-1.2.2.tar.xz/po/it.po
Changed
@@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: gtk-gnutella\n" "Report-Msgid-Bugs-To: gtk-gnutella-devel@lists.sf.net\n" -"POT-Creation-Date: 2020-07-09 10:54+0200\n" +"POT-Creation-Date: 2021-07-12 21:45+0200\n" "PO-Revision-Date: 2016-10-01 07:48+0000\n" "Last-Translator: Lucio Marinelli\n" "Language-Team: Italian (http://www.transifex.com/gtk-gnutella/gtk-gnutella/" @@ -752,6 +752,10 @@ msgid "Another gtk-gnutella is running as PID %lu" msgstr "Un altro gtk-gnutella è in esecuzione come PID %lu" +#, c-format +msgid "If PID %lu is not a gtk-gnutella process, run:" +msgstr "" + msgid "Cannot proceed without valid configuration directory" msgstr "Non posso procedere senza una cartella di configurazione valida" @@ -5345,6 +5349,56 @@ msgid "Debug level for the ADNS (asynchronous DNS) thread." msgstr "Livello di debug per il codice di sincronizzazione del tempo." +#, fuzzy +msgid "Total outgoing HTTP traffic in bytes for this session." +msgstr "Limite di banda per il traffico HTTP in uscita in byte/sec." + +msgid "Total outgoing Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total outgoing DHT traffic in bytes for this session." +msgstr "Limite di banda per il traffico HTTP in uscita in byte/sec." + +msgid "" +"Total outgoing traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total outgoing traffic in bytes on the private addresses for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming HTTP traffic in bytes for this session." +msgstr "Limite di banda per il traffico HTTP in ingresso in byte/sec." + +msgid "Total incoming Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming DHT traffic in bytes for this session." +msgstr "Limite di banda per il traffico HTTP in ingresso in byte/sec." + +msgid "" +"Total incoming traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total incoming traffic in bytes on the private addresses for this session." +msgstr "" + msgid "disable" msgstr "disabilita" @@ -8223,8 +8277,8 @@ msgid "Measured HTTP latency:" msgstr "Latenza HTTP misurata:" -msgid "Meet us on #gtk-gnutella at irc.freenode.net." -msgstr "Raggiungici su #gtk-gnutella at irc.freenode.net" +msgid "Meet us on #gtk-gnutella at irc.libera.chat." +msgstr "Raggiungici su #gtk-gnutella at irc.libera.chat" msgid "Min/Max:" msgstr "Min/Max:" @@ -9441,6 +9495,10 @@ msgstr "_Rimuovi il filtro" #, fuzzy +msgid "Meet us on #gtk-gnutella at libera.chat." +msgstr "Raggiungici su #gtk-gnutella at irc.libera.chat" + +#, fuzzy msgid "" "This product includes IP2Location LITE data, available from\n" "https://lite.ip2location.com/"
View file
gtk-gnutella-1.2.0.tar.xz/po/ja.po -> gtk-gnutella-1.2.2.tar.xz/po/ja.po
Changed
@@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: gtk-gnutella\n" "Report-Msgid-Bugs-To: gtk-gnutella-devel@lists.sf.net\n" -"POT-Creation-Date: 2020-07-09 10:54+0200\n" +"POT-Creation-Date: 2021-07-12 21:45+0200\n" "PO-Revision-Date: 2016-02-15 08:28+0000\n" "Last-Translator: Jeroen Asselman <jeroen@asselman.com>\n" "Language-Team: Japanese (http://www.transifex.com/gtk-gnutella/gtk-gnutella/" @@ -740,6 +740,10 @@ msgid "Another gtk-gnutella is running as PID %lu" msgstr "" +#, c-format +msgid "If PID %lu is not a gtk-gnutella process, run:" +msgstr "" + msgid "Cannot proceed without valid configuration directory" msgstr "適当な設定フォルダが無いと先に進めません" @@ -5008,6 +5012,56 @@ msgid "Debug level for the ADNS (asynchronous DNS) thread." msgstr "DHT ユーザー参照キューのデバッグレベルです。" +#, fuzzy +msgid "Total outgoing HTTP traffic in bytes for this session." +msgstr "ピア外への HTTP トラフィックの帯域幅の上限です。" + +msgid "Total outgoing Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total outgoing DHT traffic in bytes for this session." +msgstr "ピア外への HTTP トラフィックの帯域幅の上限です。" + +msgid "" +"Total outgoing traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total outgoing traffic in bytes on the private addresses for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming HTTP traffic in bytes for this session." +msgstr "ピア内への HTTP トラフィックの帯域幅の上限です。" + +msgid "Total incoming Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming DHT traffic in bytes for this session." +msgstr "ピア内への HTTP トラフィックの帯域幅の上限です。" + +msgid "" +"Total incoming traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total incoming traffic in bytes on the private addresses for this session." +msgstr "" + msgid "disable" msgstr "表示しない" @@ -7808,8 +7862,8 @@ msgid "Measured HTTP latency:" msgstr "計測HTTP待ち時間:" -msgid "Meet us on #gtk-gnutella at irc.freenode.net." -msgstr "irc.freenode.net の #gtk-gnutella でお会いしましょう。" +msgid "Meet us on #gtk-gnutella at irc.libera.chat." +msgstr "irc.libera.chat の #gtk-gnutella でお会いしましょう。" msgid "Min/Max:" msgstr "最小/最大:" @@ -9018,6 +9072,10 @@ msgstr "フィルターを削除(_R)" #, fuzzy +msgid "Meet us on #gtk-gnutella at libera.chat." +msgstr "irc.libera.chat の #gtk-gnutella でお会いしましょう。" + +#, fuzzy msgid "" "This product includes IP2Location LITE data, available from\n" "https://lite.ip2location.com/"
View file
gtk-gnutella-1.2.0.tar.xz/po/nb.po -> gtk-gnutella-1.2.2.tar.xz/po/nb.po
Changed
@@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: gtk-gnutella\n" "Report-Msgid-Bugs-To: gtk-gnutella-devel@lists.sf.net\n" -"POT-Creation-Date: 2020-07-09 10:54+0200\n" +"POT-Creation-Date: 2021-07-12 21:45+0200\n" "PO-Revision-Date: 2016-02-15 08:28+0000\n" "Last-Translator: Jeroen Asselman <jeroen@asselman.com>\n" "Language-Team: Norwegian Bokmål (http://www.transifex.com/gtk-gnutella/gtk-" @@ -748,6 +748,10 @@ msgid "Another gtk-gnutella is running as PID %lu" msgstr "" +#, c-format +msgid "If PID %lu is not a gtk-gnutella process, run:" +msgstr "" + msgid "Cannot proceed without valid configuration directory" msgstr "Kan ikke fortsette uten gyldig oppsettskatalog" @@ -5078,6 +5082,56 @@ msgid "Debug level for the ADNS (asynchronous DNS) thread." msgstr "Feilsøkingsnivå for køen for oppslagskøen av DHT-brukere." +#, fuzzy +msgid "Total outgoing HTTP traffic in bytes for this session." +msgstr "Båndbreddebegrensning for utgående HTTP-trafikk i byte per sekund." + +msgid "Total outgoing Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total outgoing DHT traffic in bytes for this session." +msgstr "Båndbreddebegrensning for utgående HTTP-trafikk i byte per sekund." + +msgid "" +"Total outgoing traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total outgoing traffic in bytes on the private addresses for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming HTTP traffic in bytes for this session." +msgstr "Båndbreddebegrensning for innkommende HTTP-trafikk i byte per sekund." + +msgid "Total incoming Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming DHT traffic in bytes for this session." +msgstr "Båndbreddebegrensning for innkommende HTTP-trafikk i byte per sekund." + +msgid "" +"Total incoming traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total incoming traffic in bytes on the private addresses for this session." +msgstr "" + msgid "disable" msgstr "slå av" @@ -7894,8 +7948,8 @@ msgid "Measured HTTP latency:" msgstr "Målt HTTP-ventetid:" -msgid "Meet us on #gtk-gnutella at irc.freenode.net." -msgstr "Møt oss i «#gtk-gnutella» på «irc.freenode.net»." +msgid "Meet us on #gtk-gnutella at irc.libera.chat." +msgstr "Møt oss i «#gtk-gnutella» på «irc.libera.chat»." msgid "Min/Max:" msgstr "Min/Maks:" @@ -9107,6 +9161,10 @@ msgstr "Fje_rn filter" #, fuzzy +msgid "Meet us on #gtk-gnutella at libera.chat." +msgstr "Møt oss i «#gtk-gnutella» på «irc.libera.chat»." + +#, fuzzy msgid "" "This product includes IP2Location LITE data, available from\n" "https://lite.ip2location.com/"
View file
gtk-gnutella-1.2.0.tar.xz/po/nl.po -> gtk-gnutella-1.2.2.tar.xz/po/nl.po
Changed
@@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: gtk-gnutella\n" "Report-Msgid-Bugs-To: gtk-gnutella-devel@lists.sf.net\n" -"POT-Creation-Date: 2020-07-09 10:54+0200\n" +"POT-Creation-Date: 2021-07-12 21:45+0200\n" "PO-Revision-Date: 2016-02-15 08:28+0000\n" "Last-Translator: Jeroen Asselman <jeroen@asselman.com>\n" "Language-Team: Dutch (http://www.transifex.com/gtk-gnutella/gtk-gnutella/" @@ -754,6 +754,10 @@ msgid "Another gtk-gnutella is running as PID %lu" msgstr "" +#, c-format +msgid "If PID %lu is not a gtk-gnutella process, run:" +msgstr "" + msgid "Cannot proceed without valid configuration directory" msgstr "Kan niet doorgaan zonder geldige configuratie directorie" @@ -5364,6 +5368,56 @@ msgid "Debug level for the ADNS (asynchronous DNS) thread." msgstr "Debug level voor de tijdsynchronisatiecode" +#, fuzzy +msgid "Total outgoing HTTP traffic in bytes for this session." +msgstr "Bandbreedte limiet voor uitgaand HTTP verkeer in bytes/sec." + +msgid "Total outgoing Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total outgoing DHT traffic in bytes for this session." +msgstr "Bandbreedte limiet voor uitgaand HTTP verkeer in bytes/sec." + +msgid "" +"Total outgoing traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total outgoing traffic in bytes on the private addresses for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming HTTP traffic in bytes for this session." +msgstr "Bandbreedte limiet voor inkomend HTTP verkeer in bytes/sec." + +msgid "Total incoming Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming DHT traffic in bytes for this session." +msgstr "Bandbreedte limiet voor inkomend HTTP verkeer in bytes/sec." + +msgid "" +"Total incoming traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total incoming traffic in bytes on the private addresses for this session." +msgstr "" + msgid "disable" msgstr "uitschakelen" @@ -8243,8 +8297,8 @@ msgid "Measured HTTP latency:" msgstr "Gemeten HTTP vertraging:" -msgid "Meet us on #gtk-gnutella at irc.freenode.net." -msgstr "Ontmoet ons op #gtk-gnutella op irc.freenode.net." +msgid "Meet us on #gtk-gnutella at irc.libera.chat." +msgstr "Ontmoet ons op #gtk-gnutella op irc.libera.chat." msgid "Min/Max:" msgstr "Min/Max:" @@ -9471,6 +9525,10 @@ msgstr "Ve_rwijder filter" #, fuzzy +msgid "Meet us on #gtk-gnutella at libera.chat." +msgstr "Ontmoet ons op #gtk-gnutella op irc.libera.chat." + +#, fuzzy msgid "" "This product includes IP2Location LITE data, available from\n" "https://lite.ip2location.com/"
View file
gtk-gnutella-1.2.0.tar.xz/po/tr.po -> gtk-gnutella-1.2.2.tar.xz/po/tr.po
Changed
@@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: gtk-gnutella\n" "Report-Msgid-Bugs-To: gtk-gnutella-devel@lists.sf.net\n" -"POT-Creation-Date: 2020-07-09 10:54+0200\n" +"POT-Creation-Date: 2021-07-12 21:45+0200\n" "PO-Revision-Date: 2018-06-02 15:32+0300\n" "Last-Translator: mauron\n" "Language-Team: Turkish (http://www.transifex.com/gtk-gnutella/gtk-gnutella/" @@ -752,6 +752,10 @@ msgid "Another gtk-gnutella is running as PID %lu" msgstr "Başka bir gtk-gnutella PID %lu olarak çalışmaktadır" +#, c-format +msgid "If PID %lu is not a gtk-gnutella process, run:" +msgstr "" + msgid "Cannot proceed without valid configuration directory" msgstr "Geçerli bir yapılandırma klasörü olmadan devam edilemez" @@ -5323,6 +5327,60 @@ msgid "Debug level for the ADNS (asynchronous DNS) thread." msgstr "Zaman senkronizasyon kodu için hata ayıklama seviyesi." +#, fuzzy +msgid "Total outgoing HTTP traffic in bytes for this session." +msgstr "" +"Dışarıya giden HTTP trafiği için bant genişliği sınırı, bayt/saniye olarak." + +msgid "Total outgoing Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total outgoing DHT traffic in bytes for this session." +msgstr "" +"Dışarıya giden HTTP trafiği için bant genişliği sınırı, bayt/saniye olarak." + +msgid "" +"Total outgoing traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total outgoing traffic in bytes on the private addresses for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming HTTP traffic in bytes for this session." +msgstr "" +"İçeriye gelen HTTP trafiği için bant genişliği sınırı, bayt/saniye olarak." + +msgid "Total incoming Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming DHT traffic in bytes for this session." +msgstr "" +"İçeriye gelen HTTP trafiği için bant genişliği sınırı, bayt/saniye olarak." + +msgid "" +"Total incoming traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total incoming traffic in bytes on the private addresses for this session." +msgstr "" + msgid "disable" msgstr "devre dışı" @@ -8183,8 +8241,8 @@ msgid "Measured HTTP latency:" msgstr "Ölçülen HTTP gecikmesi:" -msgid "Meet us on #gtk-gnutella at irc.freenode.net." -msgstr "Bizimle irc.freenode.net #gtk-gnutella'da görüşün." +msgid "Meet us on #gtk-gnutella at irc.libera.chat." +msgstr "Bizimle irc.libera.chat #gtk-gnutella'da görüşün." msgid "Min/Max:" msgstr "Asgari/Azami:" @@ -9399,6 +9457,10 @@ msgstr "Filtreyi _Kaldır" #, fuzzy +msgid "Meet us on #gtk-gnutella at libera.chat." +msgstr "Bizimle irc.libera.chat #gtk-gnutella'da görüşün." + +#, fuzzy msgid "" "This product includes IP2Location LITE data, available from\n" "https://lite.ip2location.com/"
View file
gtk-gnutella-1.2.0.tar.xz/po/uk.po -> gtk-gnutella-1.2.2.tar.xz/po/uk.po
Changed
@@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: gtk-gnutella\n" "Report-Msgid-Bugs-To: gtk-gnutella-devel@lists.sf.net\n" -"POT-Creation-Date: 2020-07-09 10:54+0200\n" +"POT-Creation-Date: 2021-07-12 21:45+0200\n" "PO-Revision-Date: 2016-02-15 08:28+0000\n" "Last-Translator: Jeroen Asselman <jeroen@asselman.com>\n" "Language-Team: Ukrainian (http://www.transifex.com/gtk-gnutella/gtk-gnutella/" @@ -758,6 +758,10 @@ msgid "Another gtk-gnutella is running as PID %lu" msgstr "" +#, c-format +msgid "If PID %lu is not a gtk-gnutella process, run:" +msgstr "" + msgid "Cannot proceed without valid configuration directory" msgstr "" @@ -4606,6 +4610,52 @@ msgid "Debug level for the ADNS (asynchronous DNS) thread." msgstr "" +msgid "Total outgoing HTTP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella UDP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing DHT traffic in bytes for this session." +msgstr "" + +msgid "" +"Total outgoing traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total outgoing traffic in bytes on the private addresses for this session." +msgstr "" + +msgid "Total incoming HTTP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella UDP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming DHT traffic in bytes for this session." +msgstr "" + +msgid "" +"Total incoming traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total incoming traffic in bytes on the private addresses for this session." +msgstr "" + msgid "disable" msgstr "вимкнути" @@ -7378,7 +7428,7 @@ msgid "Measured HTTP latency:" msgstr "" -msgid "Meet us on #gtk-gnutella at irc.freenode.net." +msgid "Meet us on #gtk-gnutella at irc.libera.chat." msgstr "" msgid "Min/Max:" @@ -8537,6 +8587,9 @@ msgid "_Remove filter" msgstr "" +msgid "Meet us on #gtk-gnutella at libera.chat." +msgstr "" + msgid "" "This product includes IP2Location LITE data, available from\n" "https://lite.ip2location.com/"
View file
gtk-gnutella-1.2.0.tar.xz/po/zh_CN.po -> gtk-gnutella-1.2.2.tar.xz/po/zh_CN.po
Changed
@@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: gtk-gnutella\n" "Report-Msgid-Bugs-To: gtk-gnutella-devel@lists.sf.net\n" -"POT-Creation-Date: 2020-07-09 10:54+0200\n" +"POT-Creation-Date: 2021-07-12 21:45+0200\n" "PO-Revision-Date: 2016-02-15 08:28+0000\n" "Last-Translator: Jeroen Asselman <jeroen@asselman.com>\n" "Language-Team: Chinese (China) (http://www.transifex.com/gtk-gnutella/gtk-" @@ -742,6 +742,10 @@ msgid "Another gtk-gnutella is running as PID %lu" msgstr "" +#, c-format +msgid "If PID %lu is not a gtk-gnutella process, run:" +msgstr "" + msgid "Cannot proceed without valid configuration directory" msgstr "没有合适的配置目录则无法继续" @@ -4629,6 +4633,56 @@ msgid "Debug level for the ADNS (asynchronous DNS) thread." msgstr "UDP交通布局的debug级别。" +#, fuzzy +msgid "Total outgoing HTTP traffic in bytes for this session." +msgstr "HTTP出去流量的带宽限制,以字节/秒为单位。" + +msgid "Total outgoing Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total outgoing Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total outgoing DHT traffic in bytes for this session." +msgstr "HTTP出去流量的带宽限制,以字节/秒为单位。" + +msgid "" +"Total outgoing traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total outgoing traffic in bytes on the private addresses for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming HTTP traffic in bytes for this session." +msgstr "HTTP进入流量的带宽限制,以字节/秒为单位。" + +msgid "Total incoming Gnutella TCP UP traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella TCP leaf traffic in bytes for this session." +msgstr "" + +msgid "Total incoming Gnutella UDP traffic in bytes for this session." +msgstr "" + +#, fuzzy +msgid "Total incoming DHT traffic in bytes for this session." +msgstr "HTTP进入流量的带宽限制,以字节/秒为单位。" + +msgid "" +"Total incoming traffic in bytes on the loopback address for this session." +msgstr "" + +msgid "" +"Total incoming traffic in bytes on the private addresses for this session." +msgstr "" + msgid "disable" msgstr "禁用" @@ -7389,8 +7443,8 @@ msgid "Measured HTTP latency:" msgstr "" -msgid "Meet us on #gtk-gnutella at irc.freenode.net." -msgstr "通过 irc.freenode.net 上的 #gtk-gnutella 聊天室直接交流。" +msgid "Meet us on #gtk-gnutella at irc.libera.chat." +msgstr "通过 irc.libera.chat 上的 #gtk-gnutella 聊天室直接交流。" msgid "Min/Max:" msgstr "最小/最大:" @@ -8548,6 +8602,10 @@ msgstr "删除过滤器(_R)" #, fuzzy +msgid "Meet us on #gtk-gnutella at libera.chat." +msgstr "通过 irc.libera.chat 上的 #gtk-gnutella 聊天室直接交流。" + +#, fuzzy msgid "" "This product includes IP2Location LITE data, available from\n" "https://lite.ip2location.com/"
View file
gtk-gnutella-1.2.0.tar.xz/src/common.h -> gtk-gnutella-1.2.2.tar.xz/src/common.h
Changed
@@ -544,7 +544,7 @@ /** * SIGN() returns the sign of an integer value. */ -#define SIGN(x) (G_UNLIKELY((x) == 0) ? 0 : (x) > 0 ? 1 : (-1)) +#define SIGN(x) CMP((x), 0) /** * Byte-wise swap two items of specified size.
View file
gtk-gnutella-1.2.0.tar.xz/src/core/ban.c -> gtk-gnutella-1.2.2.tar.xz/src/core/ban.c
Changed
@@ -346,6 +346,7 @@ ban_addr_info_check(ipf); g_assert(ipf->banned); + g_assert(NULL == ipf->cq_ev); b = ipf->owner; ban_check(b); @@ -384,6 +385,7 @@ ban_addr_info_check(ipf); g_assert(ipf->banned); ban_check(ipf->owner); + g_assert(NULL == ipf->cq_ev); decay_coeff = ipf->owner->decay_coeff;
View file
gtk-gnutella-1.2.0.tar.xz/src/core/bsched.c -> gtk-gnutella-1.2.2.tar.xz/src/core/bsched.c
Changed
@@ -39,6 +39,7 @@ #include "uploads.h" #include "if/core/wrap.h" /* For wrapped_io_t */ +#include "if/gnet_property.h" #include "if/gnet_property_priv.h" #include "lib/compat_sendfile.h" @@ -121,6 +122,7 @@ plist_t *sources; /**< List of bio_source_t */ pslist_t *stealers; /**< List of bsched_t stealing bw */ char *name; /**< Name, for tracing purposes */ + property_t byte_count; /**< Property used to count transferred bytes */ int count; /**< Amount of sources */ uint type; /**< Scheduling type */ uint flags; /**< Processing flags */ @@ -189,14 +191,15 @@ /** * Create a new bandwidth scheduler. * - * @param `name' no brief description. + * @param `name' brief description. + * @param `account' property used to account for traffic * @param `type' refers to the scheduling model. Only BS_T_STREAM for now. * @param `mode' refers to the nature of the sources: either reading or writing. * @param `bandwidth' is the expected bandwidth in bytes per second. * @param `period' is the scheduling period in ms. */ static bsched_t * -bsched_make(const char *name, uint type, uint32 mode, +bsched_make(const char *name, property_t account, uint type, uint32 mode, int64 bandwidth, uint period) { bsched_t *bs; @@ -213,6 +216,7 @@ WALLOC0(bs); bs->magic = BSCHED_MAGIC; + bs->byte_count = account; bs->name = h_strdup(name); bs->flags = mode; bs->type = type; @@ -385,6 +389,9 @@ static void G_COLD bsched_dht_cross_stealing(void) { + if (!GNET_PROPERTY(enable_dht)) + return; + bsched_add_stealer(BSCHED_BWS_GOUT_UDP, BSCHED_BWS_DHT_OUT); bsched_add_stealer(BSCHED_BWS_DHT_OUT, BSCHED_BWS_GOUT_UDP); } @@ -392,7 +399,7 @@ /** * Allow cross-stealing of unused bandwidth between HTTP/gnet. */ -void G_COLD +static void G_COLD bsched_config_steal_http_gnet(void) { pslist_t *iter; @@ -442,7 +449,7 @@ /** * Allow cross-stealing of unused bandwidth between TCP and UDP gnet only. */ -void G_COLD +static void G_COLD bsched_config_steal_gnet(void) { pslist_t *iter; @@ -459,6 +466,32 @@ bsched_dht_cross_stealing(); } +/** + * Configure bandwidth stealing. + */ +void G_COLD +bsched_config_stealing(void) +{ + if (GNET_PROPERTY(bw_allow_stealing)) + bsched_config_steal_http_gnet(); + else + bsched_config_steal_gnet(); +} + +/** + * Add `arycnt' items from `ary' at the head of the `sl' list. + */ +static pslist_t * +bssched_load_bws(pslist_t *sl, int *ary, size_t arycnt) +{ + size_t i; + + for (i = 0; i < arycnt; i++) + sl = pslist_prepend(sl, uint_to_pointer(aryi)); + + return sl; +} + /* * This is called BEFORE settings_init(), bandwidth values are the default * values, not the configured ones. @@ -466,106 +499,78 @@ void G_COLD bsched_early_init(void) { - bws_setBSCHED_BWS_OUT = bsched_make("out", - BS_T_STREAM, BS_F_WRITE, GNET_PROPERTY(bw_http_out), 1000); - - bws_setBSCHED_BWS_GOUT = bsched_make("G TCP out", - BS_T_STREAM, BS_F_WRITE, GNET_PROPERTY(bw_gnet_out) / 2, 1000); - - bws_setBSCHED_BWS_GOUT_UDP = bsched_make("G UDP out", - BS_T_STREAM, BS_F_WRITE, GNET_PROPERTY(bw_gnet_out) / 2, 1000); - - bws_setBSCHED_BWS_GLOUT = bsched_make("GL out", - BS_T_STREAM, BS_F_WRITE, GNET_PROPERTY(bw_gnet_lout), 1000); - - bws_setBSCHED_BWS_IN = bsched_make("in", - BS_T_STREAM, BS_F_READ, GNET_PROPERTY(bw_http_in), 1000); - - bws_setBSCHED_BWS_GIN = bsched_make("G TCP in", - BS_T_STREAM, BS_F_READ, GNET_PROPERTY(bw_gnet_in) / 2, 1000); - - bws_setBSCHED_BWS_GIN_UDP = bsched_make("G UDP in", - BS_T_STREAM, BS_F_READ, 0, 1000); - - bws_setBSCHED_BWS_GLIN = bsched_make("GL in", - BS_T_STREAM, BS_F_READ, GNET_PROPERTY(bw_gnet_lin), 1000); - - bws_setBSCHED_BWS_LOOPBACK_OUT = bsched_make("loopback out", - BS_T_STREAM, BS_F_WRITE, 0, 1000); - - bws_setBSCHED_BWS_LOOPBACK_IN = bsched_make("loopback in", - BS_T_STREAM, BS_F_READ, 0, 1000); - - bws_setBSCHED_BWS_PRIVATE_OUT = bsched_make("private out", - BS_T_STREAM, BS_F_WRITE, 0, 1000); - - bws_setBSCHED_BWS_PRIVATE_IN = bsched_make("private in", - BS_T_STREAM, BS_F_READ, 0, 1000); - - bws_setBSCHED_BWS_DHT_OUT = bsched_make("DHT out", - BS_T_STREAM, BS_F_WRITE, GNET_PROPERTY(bw_dht_out), 1000); - - bws_setBSCHED_BWS_DHT_IN = bsched_make("DHT in", - BS_T_STREAM, BS_F_READ, 0, 1000); - - bws_list = pslist_prepend(bws_list, - uint_to_pointer(BSCHED_BWS_LOOPBACK_IN)); - bws_list = pslist_prepend(bws_list, - uint_to_pointer(BSCHED_BWS_PRIVATE_IN)); - bws_list = pslist_prepend(bws_list, - uint_to_pointer(BSCHED_BWS_GLIN)); - bws_list = pslist_prepend(bws_list, - uint_to_pointer(BSCHED_BWS_GIN)); - bws_list = pslist_prepend(bws_list, - uint_to_pointer(BSCHED_BWS_GIN_UDP)); - bws_list = pslist_prepend(bws_list, - uint_to_pointer(BSCHED_BWS_IN)); - bws_list = pslist_prepend(bws_list, - uint_to_pointer(BSCHED_BWS_DHT_IN)); - bws_list = pslist_prepend(bws_list, - uint_to_pointer(BSCHED_BWS_LOOPBACK_OUT)); - bws_list = pslist_prepend(bws_list, - uint_to_pointer(BSCHED_BWS_PRIVATE_OUT)); - bws_list = pslist_prepend(bws_list, - uint_to_pointer(BSCHED_BWS_GLOUT)); - bws_list = pslist_prepend(bws_list, - uint_to_pointer(BSCHED_BWS_GOUT)); - bws_list = pslist_prepend(bws_list, - uint_to_pointer(BSCHED_BWS_GOUT_UDP)); - bws_list = pslist_prepend(bws_list, - uint_to_pointer(BSCHED_BWS_OUT)); - bws_list = pslist_prepend(bws_list, - uint_to_pointer(BSCHED_BWS_DHT_OUT)); - - bws_in_list = pslist_prepend(bws_in_list, - uint_to_pointer(BSCHED_BWS_LOOPBACK_IN)); - bws_in_list = pslist_prepend(bws_in_list, - uint_to_pointer(BSCHED_BWS_PRIVATE_IN)); - bws_in_list = pslist_prepend(bws_in_list, - uint_to_pointer(BSCHED_BWS_GLIN)); - bws_in_list = pslist_prepend(bws_in_list, - uint_to_pointer(BSCHED_BWS_GIN)); - bws_in_list = pslist_prepend(bws_in_list, - uint_to_pointer(BSCHED_BWS_GIN_UDP)); - bws_in_list = pslist_prepend(bws_in_list, - uint_to_pointer(BSCHED_BWS_IN)); - bws_in_list = pslist_prepend(bws_in_list, - uint_to_pointer(BSCHED_BWS_DHT_IN)); - - bws_out_list = pslist_prepend(bws_out_list, - uint_to_pointer(BSCHED_BWS_LOOPBACK_OUT)); - bws_out_list = pslist_prepend(bws_out_list, - uint_to_pointer(BSCHED_BWS_PRIVATE_OUT)); - bws_out_list = pslist_prepend(bws_out_list, - uint_to_pointer(BSCHED_BWS_GLOUT)); - bws_out_list = pslist_prepend(bws_out_list,
View file
gtk-gnutella-1.2.0.tar.xz/src/core/bsched.h -> gtk-gnutella-1.2.2.tar.xz/src/core/bsched.h
Changed
@@ -114,8 +114,7 @@ int64 bsched_urgent(bsched_bws_t bws); void bsched_set_urgent(bsched_bws_t bws, int64 amount); -void bsched_config_steal_http_gnet(void); -void bsched_config_steal_gnet(void); +void bsched_config_stealing(void); bsched_bws_t bsched_out_select_by_addr(const host_addr_t); bsched_bws_t bsched_in_select_by_addr(const host_addr_t);
View file
gtk-gnutella-1.2.0.tar.xz/src/core/clock.c -> gtk-gnutella-1.2.2.tar.xz/src/core/clock.c
Changed
@@ -39,11 +39,10 @@ #include "if/gnet_property.h" #include "if/gnet_property_priv.h" -#include "lib/cq.h" +#include "lib/aging.h" #include "lib/entropy.h" #include "lib/glib-missing.h" #include "lib/halloc.h" -#include "lib/hevset.h" #include "lib/misc.h" #include "lib/stats.h" #include "lib/tm.h" @@ -51,19 +50,17 @@ #include "lib/override.h" /* Must be the last header included */ -#define REUSE_DELAY 10800 /**< 3 hours */ -#define ENOUGH_DATA 30 /**< Update skew when we have enough data */ -#define MIN_DATA 15 /**< Minimum amount of points for update */ -#define MAX_SDEV 60.0 /**< Maximum dispersion we tolerate */ +#define REUSE_DELAY 1800 /**< 30 minutes */ +#define ENOUGH_DATA 15 /**< Update skew when we have enough data */ +#define MIN_DATA 10 /**< Minimum amount of points for update */ #define CLEAN_STEPS 3 /**< Amount of steps to remove off-track data */ struct used_val { host_addr_t addr; /**< The IP address */ - cevent_t *cq_ev; /**< Scheduled cleanup event */ int precision; /**< The precision used for the last update */ }; -static hevset_t *used; /**< Records the IP address used */ +static aging_table_t *used; /**< Records the IP address used */ /** * This container holds the data points (clock offset between the real UTC @@ -90,31 +87,19 @@ /** * Dispose of the value from the `used' table. + * + * This is an aging_table freeing callback. */ static void -val_free(struct used_val *v) -{ - g_assert(v); - g_assert(is_host_addr(v->addr)); - - cq_cancel(&v->cq_ev); - WFREE(v); -} - -/** - * Called from callout queue when it's time to destroy the record. - */ -static void -val_destroy(cqueue_t *cq, void *obj) +val_free(void *key, void *value) { - struct used_val *v = obj; + struct used_val *v = value; - g_assert(v); + g_assert(v != NULL); g_assert(is_host_addr(v->addr)); + g_assert(key == &v->addr); - hevset_remove(used, &v->addr); - cq_zero(cq, &v->cq_ev); - val_free(v); + WFREE(v); } /** @@ -130,40 +115,20 @@ WALLOC(v); v->addr = addr; v->precision = precision; - v->cq_ev = cq_main_insert(REUSE_DELAY * 1000, val_destroy, v); return v; } /** - * Accepted an update due to a lower precision entry, reschedule the - * expiration timeout. - */ -static void -val_reused(struct used_val *v, int precision) -{ - v->precision = precision; - cq_resched(v->cq_ev, REUSE_DELAY * 1000); -} - -/** * Called at startup time to initialize local structures. */ void clock_init(void) { - used = hevset_create_any(offsetof(struct used_val, addr), - host_addr_hash_func, host_addr_hash_func2, host_addr_eq_func); - datapoints = statx_make(); -} + used = aging_make(REUSE_DELAY, + host_addr_hash_func, host_addr_eq_func, val_free); -static void -used_free_kv(void *val, void *unused_x) -{ - struct used_val *v = val; - - (void) unused_x; - val_free(v); + datapoints = statx_make(); } /** @@ -172,8 +137,7 @@ void clock_close(void) { - hevset_foreach(used, used_free_kv, NULL); - hevset_free_null(&used); + aging_destroy(&used); statx_free(datapoints); } @@ -211,6 +175,7 @@ for (k = 0; k < CLEAN_STEPS; k++) { double *value = statx_data(datapoints); + int old_n = statx_n(datapoints); g_assert(value != NULL); /* Since n > 1, there are data points */ @@ -221,12 +186,12 @@ statx_clear(datapoints); /* - * Remove aberration points: keep only the sigma range around the - * average. + * Remove aberration points: keep only a 2*sigma range around the + * mean (about 95% of the values for a Normal distribution). */ - min = avg - sdev; - max = avg + sdev; + min = avg - 2.0 * sdev; + max = avg + 2.0 * sdev; for (i = 0; i < n; i++) { double v = valuei; @@ -253,19 +218,16 @@ g_debug("CLOCK after #%d: kept n=%d avg=%g sdev=%g", k, n, avg, sdev); - if (sdev <= MAX_SDEV || n < MIN_DATA) + if (n < MIN_DATA || old_n == n) break; } /* - * If standard deviation is too large still, we cannot update our - * clock, collect more points. - * * If we don't have a minimum amount of data, don't attempt the * update yet, continue collecting. */ - if (sdev > MAX_SDEV || n < MIN_DATA) { + if (n < MIN_DATA) { if (GNET_PROPERTY(clock_debug) > 1) g_debug("CLOCK will continue collecting data"); return; @@ -273,7 +235,7 @@ statx_clear(datapoints); - new_skew = GNET_PROPERTY(clock_skew) + (int32) avg; + new_skew = (int32) avg; if (GNET_PROPERTY(clock_debug)) g_debug("CLOCK with n=%d avg=%g sdev=%g => SKEW old=%d new=%d", @@ -308,29 +270,34 @@ * end is running NTP. */ - if ((v = hevset_lookup(used, &addr))) { + if (NULL != (v = aging_lookup(used, &addr))) { if (precision && precision >= v->precision) return; - val_reused(v, precision); + (void) aging_lookup_revitalise(used, &addr); + v->precision = precision; } else { v = val_create(addr, precision); - hevset_insert(used, v);
View file
gtk-gnutella-1.2.0.tar.xz/src/core/downloads.c -> gtk-gnutella-1.2.2.tar.xz/src/core/downloads.c
Changed
@@ -14547,6 +14547,14 @@ } hex_guidi = '\0'; + /* + * Note that for Gnutella, we parse until the '/' and then we simply + * ignore whatever remains on the line: any filename given there is + * purely irrelevant nowadays since the GIV callback is viewed as a way + * to connect back from the "firewalled" server to the client requesting + * the file. + */ + return (g2 ? '\0' : '/') == *endptr; }
View file
gtk-gnutella-1.2.0.tar.xz/src/core/dq.c -> gtk-gnutella-1.2.2.tar.xz/src/core/dq.c
Changed
@@ -641,13 +641,13 @@ dquery_check(dq); PSLIST_FOREACH(node_all_ultranodes(), sl) { - gnutella_node_t *n; + gnutella_node_t *n = sl->data; + + node_check(n); if (i >= ncount) break; - n = sl->data; - /* * Dont bother sending anything to transient nodes, we're going * to shut them down soon. @@ -758,17 +758,17 @@ */ PSLIST_FOREACH(node_all_ultranodes(), sl) { + gnutella_node_t *n = sl->data; struct next_up *nup, *old_nup; - gnutella_node_t *n; const void *knid; void *ttlv; bool found; + node_check(n); + if (i >= ncount) break; - n = sl->data; - /* * Dont bother sending anything to transient nodes, we're going * to shut them down soon. @@ -1073,6 +1073,8 @@ dq_terminate(dq); } +static void dq_install_results_expired(dquery_t *dq, int delay); + /** * Callout queue callback invoked when the result timer has expired. */ @@ -1219,7 +1221,84 @@ g_debug("DQ%s status reply timeout set to %d s", nid_to_string(&dq->qid), timeout / 1000); - dq->results_ev = cq_main_insert(timeout, dq_results_expired, dq); + dq_install_results_expired(dq, timeout); +} + +/** + * Install a new expiration callback for results. + */ +static void +dq_install_results_expired(dquery_t *dq, int delay) +{ + dquery_check(dq); + g_assert(NULL == dq->results_ev); /* Since we are about to supersede it */ + + /* + * If the query has been marked as lingering, then we do not care + * any more about this callback since we are just waiting for results + * to come from already-sent queries, before destroying this dq object. + */ + + if G_UNLIKELY(DQ_F_LINGER & dq->flags) + return; + + dq->results_ev = cq_main_insert(delay, dq_results_expired, dq); +} + +/** + * Install a new expiration callback for the query. + */ +static void +dq_install_query_expired(dquery_t *dq, int delay) +{ + dquery_check(dq); + + if (dq->expire_ev != NULL) + cq_resched(dq->expire_ev, delay); + else + dq->expire_ev = cq_main_insert(delay, dq_expired, dq); +} + +/** + * Flag query as lingering. + */ +static void +dq_flag_lingering(dquery_t *dq) +{ + dq->flags &= ~DQ_F_WAITING; + dq->flags |= DQ_F_LINGER; + dq->stop = tm_time(); +} + +/** + * Asynchronously free query. + */ +static void +dq_async_free(dquery_t *dq) +{ + dquery_check(dq); + + /* + * Flagging the query as lingering ensures dq_expired() will + * immediately free the query. + */ + + if (0 == (DQ_F_LINGER & dq->flags)) { + cq_cancel(&dq->results_ev); + dq_flag_lingering(dq); + } + + /* + * This lets us free the query "later", not within this calling + * stack frame. It allows code to still refer to the `dq' object + * for a while, within the same calling stack. + * + * That is because gtk-gnutella runs the callout queue in its main + * thread, ensuring the trigger cannot happen until we return to + * the main I/O loop. + */ + + dq_install_query_expired(dq, 1); } /** @@ -1230,6 +1309,7 @@ { int delay; + dquery_check(dq); g_assert(!(dq->flags & DQ_F_LINGER)); g_assert(dq->results_ev == NULL); @@ -1243,20 +1323,14 @@ delay = (dq->flags & DQ_F_USR_CANCELLED) ? 1 : DQ_LINGER_TIMEOUT; - if (dq->expire_ev != NULL) - cq_resched(dq->expire_ev, delay); - else - dq->expire_ev = cq_main_insert(delay, dq_expired, dq); - - dq->flags &= ~DQ_F_WAITING; - dq->flags |= DQ_F_LINGER; - dq->stop = tm_time(); + dq_flag_lingering(dq); + dq_install_query_expired(dq, delay); if (GNET_PROPERTY(dq_debug) > 19) - g_debug("DQ%s (%d secs) node #%s lingering: " + g_debug("DQ%s (%d secs) node #%s lingering (%d ms): " "ttl=%d, queried=%d, horizon=%d, results=%d", nid_to_string(&dq->qid), (int) (tm_time() - dq->start), - nid_to_string2(dq->node_id), + nid_to_string2(dq->node_id), delay, dq->ttl, dq->up_sent, dq->horizon, dq->results); } @@ -1482,8 +1556,8 @@ if (GNET_PROPERTY(dq_debug) > 19) g_debug("DQ%s waiting for %u ms (pending=%u)", nid_to_string(&dq->qid), dq->result_timeout, dq->pending); - dq->results_ev = cq_main_insert( - dq->result_timeout, dq_results_expired, dq); + + dq_install_results_expired(dq, dq->result_timeout); return; } @@ -1603,7 +1677,7 @@ nid_to_string(&dq->qid), (int) (tm_time() - dq->start), timeout, dq->pending); - dq->results_ev = cq_main_insert(timeout, dq_results_expired, dq); + dq_install_results_expired(dq, timeout); return; terminate: @@ -1681,9 +1755,8 @@ * assse how popular the query is. */ - dq->results_ev = cq_main_insert( - MIN(found, DQ_PROBE_UP) * (DQ_PROBE_TIMEOUT + dq->result_timeout), - dq_results_expired, dq); + dq_install_results_expired(dq, + MIN(found, DQ_PROBE_UP) * (DQ_PROBE_TIMEOUT + dq->result_timeout)); cleanup: WFREE_ARRAY(nv, ncount); @@ -2233,7 +2306,14 @@
View file
gtk-gnutella-1.2.0.tar.xz/src/core/fileinfo.c -> gtk-gnutella-1.2.2.tar.xz/src/core/fileinfo.c
Changed
@@ -5286,6 +5286,7 @@ while (NULL != (r = fi_rangeset_lookup_over(offered, fa, &r_dflt, r))) { struct dl_file_chunk *dfc; struct dl_file_chunk crange; + filesize_t start, end; crange.from = r->start; crange.to = r->end + 1; @@ -5309,6 +5310,48 @@ } /* + * start, end is the intersection of the rarest chunk we are + * currently considering (`fa') and the candidate `dfc'. + * + * Since the upper range `to' is not part of the interval, we + * have no overlap between the two when start >= end. + * + * It is necessary to check for overlapping here, because we + * could have this setup: + * + * rarest chunk (fa) : ----- + * server range (r): ----- + * missing chunk (dfc): ------ + * + * We know `r' and `fa' intersect, as `r' and `dfc' do, + * but we need to ensure `fa' and `dfc' do as well! In the + * graphic above, they do not! + * + * Forgetting to check that condition led to assertion failures + * later because we want `rarest' and `candidate' to overlap! + * --RAM, 2020-12-12 + */ + + start = MAX(fa->from, dfc->from); + end = MIN(fa->to, dfc->to); + + if (start >= end) { + if ( + GNET_PROPERTY(fileinfo_debug) > 2 || + GNET_PROPERTY(download_debug) > 1 + ) { + g_debug("%s(): but download empty chunk %s, %s is not " + "intersecting with rarest %s, %s", + G_STRFUNC, + filesize_to_string(dfc->from), + filesize_to_string2(dfc->to), + filesize_to_string3(fa->from), + fileoffset_t_to_string(fa->to)); + } + continue; + } + + /* * If this is not the first rarest candidate we see, then randomly * select it, maybe. * @@ -5360,7 +5403,7 @@ */ start = MAX(rarest->from, candidate->from); - end = MIN(rarest->to, candidate->to); + end = MIN(rarest->to, candidate->to); if ( GNET_PROPERTY(fileinfo_debug) > 2 || @@ -5373,7 +5416,15 @@ PLURAL(rarest->sources)); } - g_assert(start < end); /* Because the two MUST overlap */ + /* Because the two MUST overlap */ + g_assert_log(start < end, + "%s(): intersection of rarest %'zu, %'zu and " + "candidate %'zu, %'zu " + "gave start = %'zu, end = %'zu", + G_STRFUNC, + (size_t) rarest->from, (size_t) rarest->to, + (size_t) candidate->from, (size_t) candidate->to, + (size_t) start, (size_t) end); /* * Intersect with offered chunk if we have a list. @@ -5519,7 +5570,7 @@ dl_file_chunk_check(fc); if (fc->from >= GNET_PROPERTY(pfsp_first_chunk)) - break; /* Already past the first "pfsp_first_chunk" bytes */ + break; /* Already past the first "pfsp_first_chunk" bytes */ if (DL_CHUNK_EMPTY == fc->status) return fc; @@ -5623,8 +5674,9 @@ * Try to align the starting offset to a natural boundary. * * The aim of the alignment is to avoid having too many small empty - * chunks in the list (chunks of a few bytes), which would necessarily - * happen after a while if we kept the random offsets as-is. + * chunks in the list (chunks of a few bytes), which would + * necessarily happen after a while if we kept the random offsets + * as-is. * * If we cannot align (alignment falls before the beginning of * the chunk) then start at the beginning of the chunk to avoid
View file
gtk-gnutella-1.2.0.tar.xz/src/core/ggep_type.c -> gtk-gnutella-1.2.2.tar.xz/src/core/ggep_type.c
Changed
@@ -1033,9 +1033,16 @@ uint ggept_filesize_encode(uint64 filesize, char *data, size_t len) { - g_assert(len >= 8); + int vlen; - return vlint_encode(filesize, data); + g_assert(len >= sizeof(uint64)); + + vlen = vlint_encode(filesize, data); + + /* Ensure no overflow in buffer! */ + g_assert(vlen >= 0 && UNSIGNED(vlen) <= len); + + return vlen; } /**
View file
gtk-gnutella-1.2.0.tar.xz/src/core/gmsg.c -> gtk-gnutella-1.2.2.tar.xz/src/core/gmsg.c
Changed
@@ -708,6 +708,8 @@ for (/* empty */; sl; sl = pslist_next(sl)) { gnutella_node_t *dn = sl->data; + node_check(dn); + /* * When switching UP -> leaf, it may happen that we try to send * a search to a leaf node without any search queue. Hence @@ -753,6 +755,7 @@ for (/* empty */; sl; sl = pslist_next(sl)) { gnutella_node_t *dn = sl->data; + node_check(dn); if (dn == n) continue; if (!NODE_IS_ESTABLISHED(dn) || NODE_IS_LEAF(dn))
View file
gtk-gnutella-1.2.0.tar.xz/src/core/hsep.c -> gtk-gnutella-1.2.2.tar.xz/src/core/hsep.c
Changed
@@ -219,6 +219,8 @@ PSLIST_FOREACH(node_all_gnet_nodes(), sl) { gnutella_node_t *n = sl->data; + node_check(n); + /* also consider unestablished connections here */ if (!(n->attrs & NODE_A_CAN_HSEP)) @@ -392,6 +394,8 @@ PSLIST_FOREACH(node_all_gnet_nodes(), sl) { gnutella_node_t *n = sl->data; + node_check(n); + /* also consider unestablished connections here */ if (!(n->attrs & NODE_A_CAN_HSEP)) @@ -480,6 +484,8 @@ gnutella_node_t *n = sl->data; int diff; + node_check(n); + /* only consider established connections here */ if (!NODE_IS_ESTABLISHED(n)) continue; @@ -986,6 +992,8 @@ gnutella_node_t *n = sl->data; gnet_node_status_t status; + node_check(n); + if ((!NODE_IS_ESTABLISHED(n)) || n->attrs & NODE_A_CAN_HSEP) continue;
View file
gtk-gnutella-1.2.0.tar.xz/src/core/nodes.c -> gtk-gnutella-1.2.2.tar.xz/src/core/nodes.c
Changed
@@ -496,8 +496,7 @@ static void node_tsync_udp(cqueue_t *cq, void *obj) { - gnutella_node_t *n = obj; - gnutella_node_t *udp = NULL, *tn; + gnutella_node_t *n = obj, *tn; node_check(n); g_assert(!NODE_USES_UDP(n)); @@ -510,13 +509,8 @@ * marked the node with NODE_F_TSYNC_TCP to use TCP instead of UDP. */ - if ( - !(n->flags & NODE_F_TSYNC_TCP) && - is_host_addr(n->gnet_addr) - ) - udp = node_udp_get_addr_port(n->gnet_addr, n->gnet_port); + tn = (0 == (n->flags & NODE_F_TSYNC_TCP)) ? node_udp_get(n) : n; - tn = udp ? udp : n; if (!host_is_valid(tn->addr, tn->port)) return; @@ -1007,6 +1001,8 @@ PSLIST_FOREACH(sl_nodes, sl) { gnutella_node_t *n = sl->data; + node_check(n); + if (NODE_IS_ULTRA(n) && (n->attrs & NODE_A_CAN_VENDOR)) { candidates = pslist_prepend(candidates, n); count++; @@ -1910,7 +1906,9 @@ PSLIST_FOREACH(sl_nodes, sl) { gnutella_node_t *n = sl->data; - if (n->socket) { + node_check(n); + + if (n->socket != NULL) { socket_check(n->socket); socket_recv_buf(n->socket, rx_size, TRUE); } @@ -2656,6 +2654,8 @@ PSLIST_FOREACH(sl_nodes, sl) { gnutella_node_t *node = sl->data; + node_check(node); + if (node->status != GTA_NODE_CONNECTED || node->vendor == NULL) continue; @@ -3318,6 +3318,8 @@ PSLIST_FOREACH(sl_nodes, sl) { const gnutella_node_t *n = sl->data; + node_check(n); + if ( n->status != GTA_NODE_REMOVING && n->status != GTA_NODE_SHUTDOWN && @@ -3522,6 +3524,8 @@ PSLIST_FOREACH(sl_nodes, sl) { gnutella_node_t *cn = sl->data; + node_check(cn); + if (!NODE_IS_ESTABLISHED(cn)) continue; @@ -3826,6 +3830,8 @@ PSLIST_FOREACH(sl_nodes, sl) { gnutella_node_t *n = sl->data; + node_check(n); + if (socket_listen_port() && sent < 10 && n->attrs & NODE_A_CAN_VENDOR) { vmsg_send_tcp_connect_back(n, socket_listen_port()); sent++; @@ -3864,6 +3870,8 @@ PSLIST_FOREACH(sl_nodes, sl) { gnutella_node_t *n = sl->data; + node_check(n); + if (0 == (n->attrs & NODE_A_CAN_VENDOR)) continue; @@ -5485,6 +5493,8 @@ PSLIST_FOREACH(sl_nodes, sl) { gnutella_node_t *n = sl->data; + node_check(n); + if (n->status == GTA_NODE_REMOVING) continue; @@ -8487,6 +8497,25 @@ } /** + * Get "fake" node for UDP transmission to a given node, if possible. + */ +gnutella_node_t * +node_udp_get(const gnutella_node_t *n) +{ + if (NODE_IS_UDP(n)) + return deconstify_pointer(n); + + if (0 != n->gnet_port && is_host_addr(n->gnet_addr)) { + gnutella_node_t *un = + node_udp_get_addr_port(n->gnet_addr, n->gnet_port); + if (un != NULL) + return un; + } + + return deconstify_pointer(n); /* Sorry, no UDP possible */ +} + +/** * Get "fake" node for semi-reliable UDP transmission. */ gnutella_node_t * @@ -9124,8 +9153,11 @@ * @attention * NB: callers of this routine must not use the node structure upon return, * since we may invalidate that node during the processing. + * + * @return TRUE if OK, FALSE if we BYE-ed the node (in which case the node + * pointer became invalid if we removed the node already). */ -static void +static bool node_parse(gnutella_node_t *n) { bool drop = FALSE; @@ -9136,7 +9168,7 @@ int results = 0; /* # of results in query hits */ search_request_info_t *sri = NULL; - g_return_if_fail(n != NULL); + node_check(n); g_assert(NODE_IS_CONNECTED(n)); dest.type = ROUTE_NONE; @@ -9184,7 +9216,7 @@ if (NODE_IS_LEAF(n) && gnutella_header_get_hops(&n->header) > 0) { node_bye_if_writable(n, 414, "Leaf node relayed %s", gmsg_name(gnutella_header_get_function(&n->header))); - return; + return FALSE; } /* First some simple checks */ @@ -9367,7 +9399,7 @@ if (G_UNLIKELY(in_shutdown)) { if (GTA_MSG_BYE == gnutella_header_get_function(&n->header)) { node_got_bye(n); - return; + return TRUE; } goto reset_header; } @@ -9399,7 +9431,7 @@ switch (gnutella_header_get_function(&n->header)) { case GTA_MSG_BYE: /* Good bye! */ node_got_bye(n); - return; + return TRUE; case GTA_MSG_INIT: /* Ping */ pcache_ping_received(n); goto reset_header; @@ -9421,7 +9453,7 @@ if (n->qrt_receive != NULL) { bool done; if (!qrt_receive_next(n->qrt_receive, &done)) - return; /* Node BYE-ed */ + return FALSE; /* Node BYE-ed */ if (done) { qrt_receive_free(n->qrt_receive); n->qrt_receive = NULL; @@ -9697,6 +9729,8 @@ search_request_info_free_null(&sri); if (dest.type == ROUTE_MULTI) pslist_free(dest.ur.u_nodes); + + return TRUE; } static void @@ -9912,7 +9946,8 @@ } } - node_parse(n); + if (!node_parse(n)) + return;
View file
gtk-gnutella-1.2.0.tar.xz/src/core/nodes.h -> gtk-gnutella-1.2.2.tar.xz/src/core/nodes.h
Changed
@@ -715,6 +715,7 @@ void node_udp_disable(void); void node_udp_process(gnutella_node_t *n, const struct gnutella_socket *s, const void *data, size_t len); +gnutella_node_t *node_udp_get(const gnutella_node_t *n); gnutella_node_t *node_udp_get_addr_port(const host_addr_t addr, uint16 port); gnutella_node_t *node_udp_sr_get_addr_port(const host_addr_t addr, uint16 port); gnutella_node_t *node_dht_get_addr_port(const host_addr_t addr, uint16 port);
View file
gtk-gnutella-1.2.0.tar.xz/src/core/ntp.c -> gtk-gnutella-1.2.2.tar.xz/src/core/ntp.c
Changed
@@ -234,9 +234,11 @@ static const struct { const char *addr; } hosts = { + /* + * Skip this for now. We check replies only against 127.0.0.1 and ::1 + * anyway and there is also the minor DNS issue below. + */ #if 0 - /* Skip this for now. We check replies only against 127.0.0.1 and ::1 - * anyway and there is also the minor DNS issue below. */ { "localhost" }, #endif { "::1" }, @@ -245,8 +247,13 @@ bool sent = FALSE; uint i; - /* TODO: The name_to_host_addr() could take a while which would + /* + * TODO: The name_to_host_addr() could take a while which would * delay startup. Thus, use ADNS for this. + * + * Note that when we are only using IP addresses, there is no DNS + * resolution going on at all here: name_to_single_host_addr() will + * parse that IP address and return it. */ for (i = 0; i < N_ITEMS(hosts); i++) {
View file
gtk-gnutella-1.2.0.tar.xz/src/core/pcache.c -> gtk-gnutella-1.2.2.tar.xz/src/core/pcache.c
Changed
@@ -956,6 +956,8 @@ gnutella_node_t *cn = sl->data; struct pong_info info; + node_check(cn); + if (!NODE_IS_WRITABLE(cn)) continue; @@ -1589,6 +1591,8 @@ PSLIST_FOREACH(node_all_ultranodes(), sl) { gnutella_node_t *n = sl->data; + node_check(n); + if (!NODE_IS_WRITABLE(n) || NODE_IS_LEAF(n)) continue; @@ -1846,7 +1850,7 @@ send_demultiplexed_pongs(gnutella_node_t *n) { enum ping_flag flags; - uint h, ttl; + uint h, ttl, ping_ttl; /* * Look whether the "ping" they sent bore the "SCP" extension, meaning @@ -1865,7 +1869,9 @@ * array and compute `n->pong_missing'. */ - setup_pong_demultiplexing(n, gnutella_header_get_ttl(&n->header)); + ping_ttl = gnutella_header_get_ttl(&n->header); /* TTL of received PING */ + + setup_pong_demultiplexing(n, ping_ttl); if (n->pong_missing == 0) return; @@ -1881,12 +1887,9 @@ ttl = gnutella_header_get_hops(&n->header) + 1U; ttl = MIN(ttl, GNET_PROPERTY(max_ttl)); - for (h = 0; n->pong_missing; h++) { + for (h = 0; n->pong_missing && h < ping_ttl; h++) { struct cache_line *cl; - if (h >= gnutella_header_get_ttl(&n->header)) - break; - cl = &pong_cacheCACHE_HOP_IDX(h); if (cl->pongs) { send_cached_pongs(n, cl, ttl, TRUE); @@ -1900,12 +1903,9 @@ * did not already send. */ - for (h = 0; n->pong_missing; h++) { + for (h = 0; n->pong_missing && h < ping_ttl; h++) { struct cache_line *cl; - if (h >= gnutella_header_get_ttl(&n->header)) - break; - cl = &pong_cacheCACHE_HOP_IDX(h); if (cl->pongs) { send_cached_pongs(n, cl, ttl, FALSE); @@ -1924,11 +1924,16 @@ gnutella_node_t *n, struct cached_pong *cp, host_type_t ptype, uint8 hops, uint8 ttl) { + pslist_t *to_pong = NULL; const pslist_t *sl; + g_assert(hops < 255); + PSLIST_FOREACH(node_all_gnet_nodes(), sl) { gnutella_node_t *cn = sl->data; + node_check(cn); + if (cn == n) continue; @@ -1954,9 +1959,24 @@ if (NODE_IS_LEAF(cn) && ptype != HOST_ULTRA) continue; + to_pong = pslist_prepend(to_pong, cn); + } + + PSLIST_FOREACH(to_pong, sl) { + gnutella_node_t *cn = sl->data; + + node_check(cn); + cn->pong_missing--; cn->pong_neededhops--; + if (GNET_PROPERTY(pcache_debug) > 7) { + g_debug( + "%s(): sending cached pong %s (hops=%d, TTL=%d) to %s missing=%d", + G_STRFUNC, host_addr_port_to_string(cp->info.addr, cp->info.port), + hops, ttl, node_addr(cn), cn->pong_missing); + } + /* * When sending a cached pong, don't forget that its cached hop count * is the one we got when we received it, i.e. hops=0 means a pong @@ -1964,18 +1984,11 @@ * it, so we must increase the hop count. */ - g_assert(hops < 255); - send_pong(cn, FALSE, PING_F_NONE, hops + 1, ttl, &cn->ping_guid, &cp->info, cp->meta); - - if (GNET_PROPERTY(pcache_debug) > 7) { - g_debug( - "%s(): sent cached pong %s (hops=%d, TTL=%d) to %s missing=%d", - G_STRFUNC, host_addr_port_to_string(cp->info.addr, cp->info.port), - hops, ttl, node_addr(cn), cn->pong_missing); - } } + + pslist_free_null(&to_pong); } /** @@ -1986,14 +1999,16 @@ pong_random_leaf(struct cached_pong *cp, uint8 hops, uint8 ttl) { const pslist_t *sl; - unsigned leaves; + unsigned leaves = 0; gnutella_node_t *leaf = NULL; g_assert(settings_is_ultra()); - for (sl = node_all_gnet_nodes(), leaves = 0; sl; sl = pslist_next(sl)) { + PSLIST_FOREACH(node_all_gnet_nodes(), sl) { gnutella_node_t *cn = sl->data; + node_check(cn); + if (cn->pong_missing) /* A job for pong_all_neighbours_but_one() */ continue;
View file
gtk-gnutella-1.2.0.tar.xz/src/core/pdht.c -> gtk-gnutella-1.2.2.tar.xz/src/core/pdht.c
Changed
@@ -616,7 +616,6 @@ int len; len = ggept_filesize_encode(shared_file_size(sf), ARYLEN(buf)); - g_assert(len > 0 && UNSIGNED(len) <= sizeof buf); ok = ok && ggep_stream_pack(&gs, GGEP_NAME(length), buf, len, 0); } @@ -628,7 +627,6 @@ int len; len = ggept_filesize_encode(fi->done, ARYLEN(buf)); - g_assert(len > 0 && UNSIGNED(len) <= sizeof buf); ok = ok && ggep_stream_pack(&gs, GGEP_NAME(avail), buf, len, 0); } }
View file
gtk-gnutella-1.2.0.tar.xz/src/core/qhit.c -> gtk-gnutella-1.2.2.tar.xz/src/core/qhit.c
Changed
@@ -869,10 +869,8 @@ int len; len = ggept_filesize_encode(shared_file_size(sf), ARYLEN(buf)); - - g_assert(len > 0 && UNSIGNED(len) <= sizeof buf); - ok = ggep_stream_pack(&gs, GGEP_NAME(LF), buf, len, GGEP_W_COBS); + if (!ok) qhit_log_ggep_write_failure("LF"); }
View file
gtk-gnutella-1.2.0.tar.xz/src/core/qrp.c -> gtk-gnutella-1.2.2.tar.xz/src/core/qrp.c
Changed
@@ -1328,9 +1328,13 @@ PSLIST_FOREACH(node_all_gnet_nodes(), sl) { gnutella_node_t *dn = sl->data; - struct routing_table *rt = dn->recv_query_table; + struct routing_table *rt; - if (rt == NULL || !NODE_IS_LEAF(dn)) + node_check(dn); + + rt = dn->recv_query_table; + + if (NULL == rt || !NODE_IS_LEAF(dn)) continue; /* @@ -5466,9 +5470,11 @@ PSLIST_FOREACH(node_all_gnet_nodes(), sl) { gnutella_node_t *dn = sl->data; - struct routing_table *rt = dn->recv_query_table; + struct routing_table *rt; bool is_leaf; + node_check(dn); + /* * Avoid G_UNLIKELY() hints in the loop. Either they are wrong hints * or they increase the code size and result in I-cache misses, but @@ -5491,6 +5497,7 @@ */ is_leaf = NODE_IS_LEAF(dn); + rt = dn->recv_query_table; if (is_leaf) { /* Leaf node */ @@ -5505,7 +5512,7 @@ continue; /* Leaf won't understand it, skip! */ } } - if (rt == NULL) /* No QRT yet */ + if (NULL == rt) /* No QRT yet */ continue; /* Don't send anything */ if (NODE_HAS_BAD_GUID(dn)) { if (!NODE_USES_DUP_GUID(dn)) @@ -5526,7 +5533,7 @@ continue; /* Skip node, would not be efficient */ } } - if (rt == NULL) /* UP has not sent us its table */ + if (NULL == rt) /* UP has not sent us its table */ goto can_send; /* Forward everything then */ }
View file
gtk-gnutella-1.2.0.tar.xz/src/core/routing.c -> gtk-gnutella-1.2.2.tar.xz/src/core/routing.c
Changed
@@ -109,13 +109,13 @@ * their liftime. */ struct message { - struct guid muid; /**< Message UID */ - struct message **slot; /**< Place where we're referenced from */ - pslist_t *routes; /**< route_data from where the message came */ + struct guid muid; /**< Message UID */ + struct message **slot; /**< Place where we're referenced from */ + pslist_t *routes; /**< route_data from where the message came */ pslist_t *ttls; /**< For broadcasted messages: TTL by route */ - uint8 function; /**< Type of the message */ - uint8 ttl; /**< Max TTL we saw for this message */ - uint8 chunk_idx; /**< Index of chunk holding the slot */ + uint8 function; /**< Type of the message */ + uint8 ttl; /**< Max TTL we saw for this message */ + uint8 chunk_idx; /**< Index of chunk holding the slot */ }; /** @@ -939,6 +939,8 @@ * reuse the old structure, which will be rehashed after being updated. */ + g_assert(entryp == entry->slot); /* Invariant we ensure */ + clean_entry(entry); /* @@ -948,8 +950,11 @@ { struct message *nentry = WMOVE(entry); - if (nentry != entry) + if (nentry != entry) { entry = *entryp = nentry; + /* PARANOID: move is not supposed to alter data but... */ + g_assert(entryp == entry->slot); + } } done:
View file
gtk-gnutella-1.2.0.tar.xz/src/core/search.c -> gtk-gnutella-1.2.2.tar.xz/src/core/search.c
Changed
@@ -672,6 +672,8 @@ PSLIST_FOREACH(node_all_gnet_nodes(), sl) { gnutella_node_t *n = sl->data; + node_check(n); + if (NODE_IS_WRITABLE(n)) search_mark_sent_to_node(sch, n); }
View file
gtk-gnutella-1.2.0.tar.xz/src/core/settings.c -> gtk-gnutella-1.2.2.tar.xz/src/core/settings.c
Changed
@@ -417,6 +417,23 @@ } /** + * Log shell command that can be used to remove the lockfile if needed. + */ +static void +settings_log_rm_lockfile(const char *lockfile) +{ + char *file; + + g_assert(lockfile != NULL); + g_assert(config_dir != NULL); + + file = make_pathname(config_dir, lockfile); + g_message("rm %s", file); + + HFREE_NULL(file); +} + +/** * Tries to ensure that the current process is the only running instance * gtk-gnutella for the current value of GTK_GNUTELLA_DIR. * @@ -623,6 +640,9 @@ _("Another gtk-gnutella supervisor is running as PID %lu") : _("Another gtk-gnutella is running as PID %lu"), (ulong) lpid); + g_message(_("If PID %lu is not a gtk-gnutella process, run:"), + (ulong) lpid); + settings_log_rm_lockfile(lock); exit(EXIT_FAILURE); } } @@ -663,7 +683,7 @@ long cpus = getcpucount(); uint max_fd; time_t session_start = 0; - + bool clear_bytecount = !resume; settings_init_running = TRUE; #if defined(HAS_GETRLIMIT) && defined(RLIMIT_AS) @@ -734,6 +754,7 @@ if (!GNET_PROPERTY(clean_shutdown)) { uint32 pid = GNET_PROPERTY(pid); g_warning("restarting after abnormal termination (pid was %u)", pid); + clear_bytecount = FALSE; if (resume) g_info("implicitly resuming the previous session anyway"); crash_exited(pid); @@ -757,6 +778,7 @@ if (auto_restart) { g_info("restarting session as requested"); session_start = GNET_PROPERTY(session_start_stamp); + clear_bytecount = FALSE; } } @@ -764,6 +786,31 @@ gnet_prop_set_boolean_val(PROP_USER_AUTO_RESTART, FALSE); gnet_prop_set_guint32_val(PROP_PID, (uint32) getpid()); + if (clear_bytecount) { + uint i; + property_t bytecount = { + PROP_BC_HTTP_OUT, + PROP_BC_GNET_TCP_UP_OUT, + PROP_BC_GNET_TCP_LEAF_OUT, + PROP_BC_GNET_UDP_OUT, + PROP_BC_DHT_OUT, + PROP_BC_LOOPBACK_OUT, + PROP_BC_PRIVATE_OUT, + PROP_BC_HTTP_IN, + PROP_BC_GNET_TCP_UP_IN, + PROP_BC_GNET_TCP_LEAF_IN, + PROP_BC_GNET_UDP_IN, + PROP_BC_DHT_IN, + PROP_BC_LOOPBACK_IN, + PROP_BC_PRIVATE_IN, + }; + for (i = 0; i < N_ITEMS(bytecount); i++) { + gnet_prop_set_guint64_val(bytecounti, 0); + } + } else { + g_info("preserving session traffic counters"); + } + /* * On explicit auto-restart, or restart after a crash, we have propagated * the persisted session start timestamp into ``session_start''. @@ -1841,6 +1888,8 @@ dht_close(FALSE); } + bsched_config_stealing(); + return FALSE; } @@ -1853,7 +1902,7 @@ node_update_g2(enabled); /* - * As soon as either GUESS of G2 querying is enabled, we have to start + * As soon as either GUESS or G2 querying is enabled, we have to start * the GUESS layer. */ @@ -2629,12 +2678,10 @@ } static void -bw_allow_stealing_set(bool val) +bw_allow_stealing_set(bool unused_val) { - if (val) - bsched_config_steal_http_gnet(); - else - bsched_config_steal_gnet(); + (void) unused_val; + bsched_config_stealing(); } static void
View file
gtk-gnutella-1.2.0.tar.xz/src/core/token.c -> gtk-gnutella-1.2.2.tar.xz/src/core/token.c
Changed
@@ -63,285 +63,6 @@ * There can be up to 2^5 = 32 keys per version. */ -static const char *keys_101_0 = { - "0e52 1f9e 9175 3956 c50c ea12 2c04 8571", - "6935 29db 10f5 2457 9f50 7db6 5835 6706", - "c584 2380 e246 5ab5 5869 5cad 717d 1b66", - "2f6f 8f86 35a5 3b45 a082 c980 bbd3 b11b", - "e19f 2759 ce8a 20db 5d63 6144 8b3d 9ca3", - "8768 9271 bd23 80be ff99 036a b29c fc0b", - "b907 d822 b334 6d60 6abf aba1 d27a d813", - "88d9 096a 5caf b555 08b6 d0aa 8bca ca3d", - "f385 2ffb 2e4c 3c67 5c4c 654f 5566 bb3a", - "c5cf 6783 e701 5c8f ea15 d6d4 6bd9 aba9", - "e761 a010 c248 1d55 baeb a273 a745 e8f8", - "c427 5bd7 a45d a5e6 79b9 d454 5ad4 51ad", - "665a 811f 57d6 fbf4 0d6c e5f8 278d 1e52", - "a31b 4b67 741f f021 cf3f 9c8c d001 7128", - "5758 7c97 7b7d f10d c985 af97 477f 44b6", - "a319 d8ad 5e65 6920 e548 05c8 715c 3fe5", - "7683 61c1 1b54 581d 185e 6675 d325 fa72", - "7136 394a b039 c5ee a361 28df 157d 6d39", - "321a 6d8a 7d4f deb0 e41c 67df 2d46 616e", - "f55e a8be ae4a 8f43 20de 89bf e39f 7b90", - "76e0 bd5e f08f 5ee1 9d45 aa9f 4c25 c9fb", - "fdf7 8827 d862 284a e929 194f 8e40 292e", - "a85b e9bd 8de0 c4ee 3397 cc7b cf9b a2e0", - "48b2 22d5 993a 53f5 1c41 2211 f8ab 8aeb", - "9b16 317b 42d1 a718 f330 a0d8 7a4e 2df1", - "8fd2 ac5e 7e4a 3451 d101 43d3 d2bf c943", - "a708 ad13 754d 6735 b9f3 137f a7e4 63d1", - "21d8 66c6 dbc3 49e7 3141 e11b f869 95bf", -}; - -static const char *keys_101_1 = { - "b5c5 bd25 df65 7faa 1216 956c 2558 c058", - "3530 cf03 72fa 7ccc 7eda aaa5 7e78 1da3", - "5a7d 2588 20d9 cfc4 c9ff b40c 237a a652", - "f8cb 44b2 cd14 725b 9a95 ac71 62a2 45e6", - "a5d5 2775 6bbb 0ccc 0d80 9ecd 0e7e 100a", - "916a d1d1 1b04 2696 8ce8 dd7e 6322 f423", - "01e9 13df 3323 dace 35ca a05b 84fd 1be6", - "1ce5 854f ef94 a460 de7d cc0b 0a80 37de", - "bee6 411d 02dc 2419 554c 2076 bd62 668f", - "fcdf f558 3924 a001 d92b 5619 6ec7 9995", - "fa96 d817 60e0 7a99 7161 085d 182b 1085", - "e3cd 6301 5750 f263 c260 6ce3 6c2a 6634", - "8298 0b87 8215 6f6f d270 d811 8d75 21eb", - "2675 df59 4f9b 8680 efdd a2dc 605f 3b60", - "d45e 32d4 d5a8 248d ae95 9df9 87c2 213c", - "5562 ebb4 2c0e 8ee1 990e 16c1 e856 be61", - "10f7 cc2a 1e9a 82b0 508b 8658 a687 2b5d", - "b562 070c 4abf d10e ed89 68f2 f924 e9c7", - "581b f25a 67f1 e35d 1bf3 aec7 de88 48c1", - "8b7a e5fa 4221 528b ebb3 d25f d5ae 17d8", - "514c ec66 e6b3 9b32 3a93 d336 6711 96a0", - "bf33 db03 5267 e9b8 2736 e1d2 95d7 14aa", - "d5f2 035a ed75 6698 43f0 330a 8d5d 5771", - "9c6c 232a 8b37 3b45 d192 aa19 2f0a 5855", - "dd5c e4ec 4b5e 63c2 48eb 5a50 d622 0e82", - "ad1e ecbe eb9b 3762 d1b7 ba31 27cf e585", - "b3ce b544 82a7 711b d8e9 36c4 2152 269d", - "2547 4731 9fbd 4c83 e58a aa5b f401 c0e8", -}; - -static const char *keys_101_2 = { - "5475 43e8 a2ca 1404 f2d9 df56 2feb 70eb", - "53ab ae62 458a e08a c3fc 49e0 f94e 7aff", - "6493 d9ac 61e7 9a3a e1ab abc7 95f6 2072", - "6f79 2aac e10c ebdb 1e9f e9c3 0df9 4b2b", - "78db 1395 8bea 63a3 933f 1760 7860 d480", - "e4d2 40a9 a4a3 fc73 5dfa 3f56 15f7 254a", - "70f6 3795 1a4e 7e32 74bc bfc6 366c b889", - "fc10 b6c8 1f52 3134 531b 62e0 150b 6101", - "02ab c0b8 1bd2 6cea 3fd0 c191 ecc4 0262", - "e41b 3732 d070 ae4b ac4b c36b 176f 0a03", - "0de1 e1bb 4dd0 81a1 5365 cf5c d358 d7ba", - "c0bc b0fd 762b 773a a85b 21c8 2af0 f797", - "405d 4997 01db e436 ba6e 2222 cc28 9b6d", - "2ab5 245e aaee d65d 92f0 c65a b08c d636", - "ff11 3970 246c ee6e a00d 4ebd 54c0 ca31", - "c5a9 63a7 28da b2d2 8d3b a63e 0957 cf7a", - "d4f0 a55a 0ea6 100c 7062 cd93 a886 e802", - "49c9 76e6 f907 5b02 46de 70f9 236e 828d", - "d1f6 91e2 7f5a e8d8 2ebe 754e 2041 31cc", - "4467 80bb 0874 6e60 d3a2 d12f 37cd eb8b", - "9a5a 6ddb 440b f584 8a7d fdd0 a026 8c05", - "635d 9f51 d228 70bf bdba 995f f360 4171", - "e7a7 b9d3 a02c b0e6 a66d 9aef aeb4 187d", - "989c 1c07 ebc0 a635 4a4f 2bf5 305c cb0f", - "790d 7a2c c570 3856 8d79 6909 3479 85de", - "373b 7f3e c464 de1e a6c9 a0b0 c810 20b0", - "de00 19a9 8674 2c20 789f f688 d721 2a23", - "e351 701b 3cac f6d3 37b3 7052 2b64 f64c", -}; - -static const char *keys_101_3 = { - "be45 6d2e b759 55b8 0616 85b4 6efe 829e", - "4003 5f01 b4a2 3026 23ef 6bbf d221 955c", - "8e58 304c 6aa7 7ffb 0a5a 89f7 3384 3735", - "1176 4ef2 e01d 5256 0d98 92e4 3bdd 6d59", - "d2e3 d4db 4752 263f bfc5 ecc5 2268 ee26", - "b349 5c28 6217 57da 0c18 6372 fa89 99f7", - "7f87 fce2 7d76 5b5b 863a 2bbd 1db9 b3bf", - "b161 dca9 e137 c304 fbae 867e b816 68b3", - "d8ac b802 e14d ad55 14fa 2c91 6b01 fd40", - "a10e c052 1e95 627c 70b9 0975 38d9 82c5", - "338e 9ad5 4949 c9ca a87b 7ee1 abe9 780b", - "9179 88e8 82ed e94e 2bc9 dd04 a6ca fae7", - "856b b3a8 2f28 9b4d 7e96 4675 4d42 2096", - "8b1f eac3 1c28 023c 757d 539c 493c 7935", - "b222 4f2b 6d93 a501 0f8c 3e95 614d 84cf", - "b7de 80b5 a08d d9e5 c9fa 530a 96ee c1cb", - "7c52 4279 bcfb c2fb 65eb 7a75 13c3 0b7a", - "c6b9 14cc 0738 b907 372b 5f16 e6c6 46d6", - "a392 0388 295a 0eba 3546 2c0d 3fdf 8fb8", - "9d2a 0362 60fb 3881 ef6e 3261 094f 2cdd", - "f1ea 482e 8b57 d3b6 8d71 15fb 9e2b 4d93", - "cf84 15c5 00c8 7232 e35b 707c e21e be62", - "a79f 219f adda bf80 e00b cef9 5991 6674", - "cdf9 0894 103e 9f32 fe12 3779 671b c4ee", - "3553 c1f0 2c52 ed5d 8933 28b2 2e82 5bdf", - "16ef 4da0 76b0 10eb cb8e 4c73 dead a6c6", - "c4c9 c157 2f92 8df7 bf67 70cb e8a8 1e41", - "ec54 de4b 6290 152e 3e4f 3a7e 225b d9bf", -}; - -static const char *keys_101_4 = { - "58fc e374 b0bb 6513 e300 bbc2 d6fe c15d", - "aa0c 2ec1 4704 284e 6342 12cc 05aa 678f", - "ec54 b643 d0d7 631e b76c 0d71 4c5b 7476", - "766e 1c8f a71c 03d6 c611 6e29 b0e5 97fe", - "e4b0 0719 1e4a b4d4 5f91 fa95 91c4 a9e2", - "ad25 ef5e d04a bb02 5c9d dfeb 3d0b a088", - "7058 eea1 6f08 e792 b904 87ed 6702 968d", - "b1a7 1ba5 0eee da59 c434 36a7 904c d43f", - "c44f 63dd e8eb d380 2859 f4d0 2a5e 5500", - "e2e2 4b89 1a6b c2d2 9e1b 22eb de4e 41a4", - "0fd1 6eb7 fd7c 6b4b c021 b5b5 c913 0553", - "a41a e6ef 8da3 d109 f253 1a10 139d 39ce", - "721e da21 b10c 43a6 ecce ab57 6b73 e231", - "14a3 0b58 ca81 053a 8fe0 cce4 c8c6 7f1b", - "2be9 a5e3 a3ad 1990 058f d116 d3eb 9f5c", - "622b c7d9 247d f8a8 fb4d 963a 8797 ee18", - "b12d 9e6a eb8e 5df8 0b3c 57f6 52c6 5b43", - "6233 2f0a 8e46 c3a9 526b 6b56 92e3 3c12", - "8db5 5af8 9527 ea2b 1f22 8a70 bcc8 621a", - "e55a 223d 23f7 ed62 c381 3f7c b151 9d28", - "92b5 626f d69f c011 ade4 ac57 d8ea 2e37", - "7881 c4b7 cf45 8484 e735 f6f0 71a8 1ffe", - "7788 755d aeb5 f875 be16 6587 1dd0 3e01", - "fe56 c9c3 b194 da09 bbf8 25be 5f2b e2da", - "c2f3 f1ff 580b efa4 1e0c 30dd 7478 fc20", - "73b1 97b0 dc00 f43d 8327 9c56 0369 51a8", - "60a0 3f09 e110 1812 3dde 75e8 6402 f5f0", - "c0c9 b75a df8f 784b 2ff3 7a25 f175 03f5", -}; - -static const char *keys_101_5 = { - "2b70 9d92 a693 86c1 a5b3 a55b c55e 48a9", - "e118 e30a f9ef 1a31 5e22 c8cb 9cc4 d3f8", - "75af 1193 e9b3 64d7 6150 2531 6f07 e23a", - "2920 8768 b211 a247 2f78 7456 dd24 9849", - "25fc a295 fcb2 3147 13d4 4210 ee2b 45f5", - "e76d 1a8a 929c 4382 8aee 4e56 fe65 d9dc", - "d4a8 405c 9f07 09f8 ae6b e8e4 783e 0328", - "6b3a fdbd 50ec f9f4 1ee1 7e49 df0b 49e0", - "d11a a613 be62 2a55 ed82 5a28 d4e9 0763", - "45f8 cb52 ddad 22e7 f9b7 0124 d0e8 bbe3", - "0ed3 8f13 62e1 b68c 83ea 9824 d919 8776", - "f331 1edb c576 dd92 b12d 7b6f 2064 6b36", - "5db1 a911 77b0 9c20 3350 5001 8856 0b9c", - "08d6 b62b 8c35 a7d4 dfba a18e faee efee", - "d7f4 4df4 dfdb 7ef3 2dff bc45 614c 527e", - "66dd 661d eef6 3c4d cc36 464e 9c13 a847", - "c2b6 2207 773a 6d01 8d84 ad4c 5ae0 07c4", - "4b58 8da5 3fa5 128f 5d73 b019 cb0b 46ca", - "6aab 3555 605b 5b93 e093 3db9 bc1e 631a", - "9b10 ec1d ac5b 5e39 6e97 33e3 3a02 1c04", - "95b5 b829 3533 4897 c2b3 24a3 0c31 3354", - "7310 5672 717c 10f1 6dd1 90e5 c533 4b80", - "b0a7 5c33 01dc 042e fd9e 4f00 ca27 4426", - "b450 430b 9e63 a101 e05f dfb6 7e45 10cf", - "ab14 6c74 2781 1e6f b558 0970 c7ed 50dc", - "fe89 9f1d 8a2e 10d6 1cc1 1094 8177 c3fc", - "b1c3 3046 2613 c585 a1fa 8701 6573 a37a", - "ca0e 8b49 2c8b 961a 9244 bcff 122d be09", -}; - -static const char *keys_101_6 = { - "cf46 9775 89cb 1e4c 0759 782a 9e10 e247", - "284d 5536 1f38 6c13 2126 edea 88b5 bda2", - "557e 0a96 fcc8 9a9a 13d8 318c 9e70 1146", - "8ff9 f0b7 54c2 8778 518d b63a 5439 1871", - "7403 cf6d c8a2 3450 9907 a6da bcca e8b5", - "678e 0731 3b49 ae9d 391b b08b 44c7 2017", - "a6bd 0a6a 6810 ab1d dc8b 8c16 a569 7382", - "c6d9 e370 2c69 3d37 4c23 fe8c 75b2 7be8", - "4037 846c 1285 9b6c 3bdd e181 03ba eee6",
View file
gtk-gnutella-1.2.0.tar.xz/src/core/token.h -> gtk-gnutella-1.2.2.tar.xz/src/core/token.h
Changed
@@ -70,7 +70,7 @@ char *tok_version(void); char *tok_short_version(void); tok_error_t tok_version_valid( - const char *version, const char *tokenb64, int len, host_addr_t addr); + const char *version, const char *tokenb64, int len); bool tok_is_ancient(time_t now); #endif /* _core_token_h_ */
View file
gtk-gnutella-1.2.0.tar.xz/src/core/tsync.c -> gtk-gnutella-1.2.2.tar.xz/src/core/tsync.c
Changed
@@ -131,6 +131,7 @@ struct tsync *ts; g_return_if_fail(n->port != 0); + if (!NODE_IS_WRITABLE(n)) return; @@ -166,17 +167,9 @@ { struct tsync *ts; - if (GNET_PROPERTY(tsync_debug) > 1) { - tm_t elapsed = *final; - tm_sub(&elapsed, orig); - g_debug("TSYNC request %d.%d sent at %d.%d (delay = %g secs)", - (int) orig->tv_sec, (int) orig->tv_usec, - (int) final->tv_sec, (int) final->tv_usec, - tm2f(&elapsed)); - } - ts = hevset_lookup(tsync_by_time, orig); - if (ts == NULL) { + + if (NULL == ts) { if (GNET_PROPERTY(tsync_debug) > 1) { g_debug("TSYNC request %d.%d not found, expired already?", (int) orig->tv_sec, (int) orig->tv_usec); @@ -184,6 +177,15 @@ return; } + if (GNET_PROPERTY(tsync_debug) > 1) { + tm_t elapsed = *final; + tm_sub(&elapsed, orig); + g_debug("TSYNC request %d.%d sent at %d.%d (delay = %g secs) via %s", + (int) orig->tv_sec, (int) orig->tv_usec, + (int) final->tv_sec, (int) final->tv_usec, + tm2f(&elapsed), ts->udp ? "UDP" : "TCP"); + } + g_assert(ts); g_assert(ts->magic == TSYNC_MAGIC);
View file
gtk-gnutella-1.2.0.tar.xz/src/core/uploads.c -> gtk-gnutella-1.2.2.tar.xz/src/core/uploads.c
Changed
@@ -4881,6 +4881,30 @@ } /** + * Compute maximum output bandwidth, as configured in settings or for a given + * upload (upload-specific bw capping). + */ +static uint64 +upload_max_out_bw(const struct upload *u) +{ + uint64 cap = MAX_INT_VAL(uint64); + + upload_check(u); + + /* We aim for the maximum possible speed for our estimates */ + + if (GNET_PROPERTY(bws_out_enabled)) + cap = GNET_PROPERTY(bw_http_out); /* Only true if upload is alone */ + + /* If we decided to cap bandwidth, then enforce it for this upload */ + + if (u->bw_cap != 0) + cap = MIN(cap, u->bw_cap); + + return cap; +} + +/** * Handle request for a shared file. * * @return TRUE if we're going to actually serve the request. @@ -5283,25 +5307,34 @@ requested = range_end - range_skip + 1; max_chunk_size = 0; /* Signals: no adjustment necessary */ - if (u->is_followup) { - if (u->bw_cap != 0) { - ulong maxsize = TX_DURATION * u->bw_cap; - - if (requested > maxsize) { - max_chunk_size = next_pow2_64(maxsize); - if (max_chunk_size > maxsize) /* Not a power of 2 */ - max_chunk_size >>= 1; /* Drop to previous power */ - if (max_chunk_size < TX_MIN_CHUNK) - max_chunk_size = TX_MIN_CHUNK; /* Our minimum */ - } + /* Common logic: adjust to send chunk within, at most, TX_DURATION seconds */ + + { + ulong output_bw = upload_max_out_bw(u); + ulong maxsize = uint64_saturate_mult(TX_DURATION, output_bw); + + if (requested > maxsize) { + max_chunk_size = next_pow2_64(maxsize); + if (max_chunk_size > maxsize) /* Not a power of 2 */ + max_chunk_size >>= 1; /* Drop to previous power */ + if (max_chunk_size != 0) /* Enforce minimum */ + max_chunk_size = MAX(max_chunk_size, TX_MIN_CHUNK); + } + } + + /* If no adjustment was deemed necessary, be careful on first request */ + + if (0 == max_chunk_size && !u->is_followup) { + if ( + aging_lookup(stalling_uploads, &u->addr) || + aging_lookup(early_stalling_uploads, &u->addr) + ) { + /* First request on stalling host */ + max_chunk_size = TX_FIRST_STALL; + } else { + /* First request for other hosts */ + max_chunk_size = TX_FIRST_CHUNK; } - } else if ( - aging_lookup(stalling_uploads, &u->addr) || - aging_lookup(early_stalling_uploads, &u->addr) - ) { - max_chunk_size = TX_FIRST_STALL; /* First request on stalling host */ - } else { - max_chunk_size = TX_FIRST_CHUNK; /* First request for other hosts */ } /* @@ -5312,11 +5345,14 @@ if (max_chunk_size != 0 && max_chunk_size < requested) { if (GNET_PROPERTY(upload_debug) > 1) { g_debug( - "UL b/w cap is %s/s for host %s (%s), %srequest #%u capped to %s", + "UL b/w cap is %s/s for host %s (%s), %s/s max overall: " + "%srequest #%u capped to %s", short_size(u->bw_cap, FALSE), host_addr_to_string(u->addr), upload_vendor_str(u), + GNET_PROPERTY(bws_out_enabled) ? + short_size2(GNET_PROPERTY(bw_http_out), FALSE) : "unlimited", u->is_followup ? "" : "initial ", - u->reqnum, short_size2(max_chunk_size, FALSE)); + u->reqnum, short_size3(max_chunk_size, FALSE)); } u->end = range_end = range_skip + max_chunk_size - 1;
View file
gtk-gnutella-1.2.0.tar.xz/src/core/version.c -> gtk-gnutella-1.2.2.tar.xz/src/core/version.c
Changed
@@ -675,7 +675,7 @@ return FALSE; /* Can't be correct */ } - error = tok_version_valid(str, token, vstrlen(token), addr); + error = tok_version_valid(str, token, vstrlen(token)); /* * Unfortunately, if our token has expired, we can no longer
View file
gtk-gnutella-1.2.0.tar.xz/src/core/version.h -> gtk-gnutella-1.2.2.tar.xz/src/core/version.h
Changed
@@ -67,8 +67,8 @@ * Banning periods for our versions. */ -#define VERSION_ANCIENT_WARN (86400*365) /**< 1 year */ -#define VERSION_ANCIENT_BAN (86400*365) /**< 1 year */ +#define VERSION_ANCIENT_WARN (86400*366*2) /**< 2 years + epsilon */ +#define VERSION_ANCIENT_BAN (86400*366*2) /**< 2 years + epsilon */ #define VERSION_ANCIENT_REMIND (86400*30) /**< 30 days */ #define VERSION_ANCIENT_GRACE (86400*20) /**< 20 days */
View file
gtk-gnutella-1.2.0.tar.xz/src/core/vmsg.c -> gtk-gnutella-1.2.2.tar.xz/src/core/vmsg.c
Changed
@@ -1563,6 +1563,15 @@ } /** + * Same as vmsg_time_sync_reply_stamp() but for UDP messages. + */ +static bool +vmsg_time_sync_reply_stamp_udp(const pmsg_t *mb) +{ + return vmsg_time_sync_reply_stamp(mb, NULL); +} + +/** * Send a "Time Sync Reply" message to the node, including the time at * which we send back the message in the second half of the MUID. * The time in `got' is the time at which we received their request. @@ -1607,7 +1616,21 @@ /* First half of MUID */ memcpy(muid, gnutella_header_get_muid(&n->header), 8); - pmsg_set_send_callback(mb, vmsg_time_sync_reply_stamp); + /* + * When replying over UDP, we set a transmit hook so that our timestamp + * is written as late as possible in the UDP TX scheduler, invoked when + * the message is about to be actually sent. + * + * Otherwise, with TCP, we are less precise in that we write the + * timestamp when the message is popped from the message queue and + * given to the kernel, but we do not know how much buffering is going + * on already for that TCP connection! + */ + + if (NODE_IS_UDP(n)) + pmsg_set_transmit_hook(mb, vmsg_time_sync_reply_stamp_udp); + else + pmsg_set_send_callback(mb, vmsg_time_sync_reply_stamp); vmsg_send_reply(n, mb); }
View file
gtk-gnutella-1.2.0.tar.xz/src/dht/keys.c -> gtk-gnutella-1.2.2.tar.xz/src/dht/keys.c
Changed
@@ -93,6 +93,7 @@ #include "lib/dbmw.h" #include "lib/dbstore.h" #include "lib/glib-missing.h" +#include "lib/halloc.h" #include "lib/hikset.h" #include "lib/hset.h" #include "lib/patricia.h" @@ -337,13 +338,17 @@ /** * Get keydata from database. + * + * @param id the KUID of the key + * @param clone if TRUE, return a halloc()'ed shallow clone of the data */ static struct keydata * -get_keydata(const kuid_t *id) +get_keydata(const kuid_t *id, bool clone) { struct keydata *kd; + size_t length; - kd = dbmw_read(db_keydata, id, NULL); + kd = dbmw_read(db_keydata, id, &length); if (kd == NULL) { if (dbmw_has_ioerr(db_keydata)) { @@ -358,6 +363,11 @@ return NULL; } + g_assert(length != 0); /* Since we deserialized keydata correctly */ + + if (clone) + kd = hcopy(kd, length); + return kd; } @@ -458,7 +468,7 @@ const char *reason = NULL; char buf80; - kd = get_keydata(ki->kuid); + kd = get_keydata(ki->kuid, FALSE); if (NULL == kd) { reason = "cannot retrieve associated keydata"; goto discard_key; @@ -625,7 +635,7 @@ if (store) ki->store_requests++; - kd = get_keydata(id); + kd = get_keydata(id, FALSE); if (kd == NULL) return 0; @@ -664,7 +674,7 @@ g_assert(ki); - kd = get_keydata(id); + kd = get_keydata(id, FALSE); if (NULL == kd) return; @@ -734,7 +744,7 @@ g_assert(ki != NULL); ki->next_expire = MIN(ki->next_expire, expire); - kd = get_keydata(id); + kd = get_keydata(id, FALSE); if (kd != NULL) { int low = 0, high = ki->values - 1; @@ -845,7 +855,7 @@ int low = 0; int high = ki->values - 1; - kd = get_keydata(id); + kd = get_keydata(id, FALSE); if (NULL == kd) return; @@ -951,7 +961,16 @@ if (ki == NULL) return 0; - kd = get_keydata(id); + /* + * During values_get(), we may recurse back to keys_remove_value() + * via * delete_valuedata_at_key(), in case we detect that the + * database is corrupted. + * + * Therefore, we must clone the returned data structure to be sure + * we will keep iterating over memory we control. + */ + + kd = get_keydata(id, TRUE); if (kd == NULL) /* DB failure */ return 0; @@ -971,6 +990,8 @@ vcnt--; } + hfree(kd); + return vvec - valvec; /* Amount of entries filled */ } @@ -1022,7 +1043,17 @@ *loadptr = ki->get_req_load; ki->get_requests++; - kd = get_keydata(id); + /* + * During values_get(), we may recurse back to keys_remove_value() + * via * delete_valuedata_at_key(), in case we detect that the + * database is corrupted. + * + * Therefore, we must clone the returned data structure to be sure + * we will keep iterating over memory we control. + */ + + + kd = get_keydata(id, TRUE); if (kd == NULL) /* DB failure */ return 0; @@ -1108,6 +1139,7 @@ } done: + hfree(kd); /* Free cloned data */ if (cached) *cached = (ki->flags & DHT_KEY_F_CACHED) ? TRUE : FALSE;
View file
gtk-gnutella-1.2.0.tar.xz/src/dht/values.c -> gtk-gnutella-1.2.2.tar.xz/src/dht/values.c
Changed
@@ -961,6 +961,28 @@ } /** + * Physically remove the entry, updating the statistics. + * + * @param dbkey the 64-bit DB key + * @param vd the valuedata object + */ +static void +delete_valuedata_at_key(uint64 dbkey, const struct valuedata *vd) +{ + g_assert(values_managed > 0); + + values_managed--; + acct_net_update(values_per_class_c, vd->addr, NET_CLASS_C_MASK, -1); + acct_net_update(values_per_ip, vd->addr, NET_IPv4_MASK, -1); + gnet_stats_dec_general(GNR_DHT_VALUES_HELD); + + keys_remove_value(&vd->id, &vd->cid, dbkey); + + dbmw_delete(db_rawdata, &dbkey); + dbmw_delete(db_valuedata, &dbkey); +} + +/** * Delete valuedata from the database. * * @param dbkey the 64-bit DB key @@ -971,24 +993,14 @@ { const struct valuedata *vd; - g_assert(values_managed > 0); - vd = get_valuedata(dbkey); if (NULL == vd) return; /* I/O error or corrupted data */ - values_managed--; - acct_net_update(values_per_class_c, vd->addr, NET_CLASS_C_MASK, -1); - acct_net_update(values_per_ip, vd->addr, NET_IPv4_MASK, -1); - gnet_stats_dec_general(GNR_DHT_VALUES_HELD); - if (has_expired) kuid_pair_has_expired(&vd->id, &vd->cid); - keys_remove_value(&vd->id, &vd->cid, dbkey); - - dbmw_delete(db_rawdata, &dbkey); - dbmw_delete(db_valuedata, &dbkey); + delete_valuedata_at_key(dbkey, vd); } /** @@ -1713,8 +1725,27 @@ return STORE_SC_DB_IO; /* I/O error or corrupted DB */ } - g_assert(data); - g_assert(length == vd->length); /* Or our bookkeeping is faulty */ + if (length != vd->length) { + /* + * Our bookkeeping is faulty, or the data has been corrupted. + */ + + s_critical( + "DBMW \"%s\" inconsistent length %u for %s in DB (expected %zu) " + "for key %s, published %s ago by %s -- " + "%s() aborted and data cleared", + dbmw_name(db_rawdata), vd->length, + dht_value_type_to_string(vd->type), length, + kuid_to_hex_string(&vd->id), + compact_time(delta_time(tm_time(), vd->publish)), + host_addr_port_to_string(vd->addr, vd->port), + G_STRFUNC + ); + + delete_valuedata_at_key(dbkey, vd); + return STORE_SC_DB_IO; /* I/O error or corrupted DB */ + } + g_assert(v->length == vd->length); /* Ensured by preceding code */ if (0 != memcmp(data, v->data, v->length)) { @@ -1927,8 +1958,26 @@ return NULL; /* I/O error or corrupted DB */ } - g_assert(data); - g_assert(length == vd->length); /* Or our bookkeeping is faulty */ + if (length != vd->length) { + /* + * Our bookkeeping is faulty, or the data has been corrupted. + */ + + s_critical( + "DBMW \"%s\" inconsistent length %u for %s in DB (expected %zu) " + "for key %s, published %s ago by %s -- " + "%s() aborted and data cleared", + dbmw_name(db_rawdata), vd->length, + dht_value_type_to_string(vd->type), length, + kuid_to_hex_string(&vd->id), + compact_time(delta_time(tm_time(), vd->publish)), + host_addr_port_to_string(vd->addr, vd->port), + G_STRFUNC + ); + + delete_valuedata_at_key(dbkey, vd); + return NULL; + } vdata = wcopy(data, length); }
View file
gtk-gnutella-1.2.0.tar.xz/src/gtk-gnutella.h -> gtk-gnutella-1.2.2.tar.xz/src/gtk-gnutella.h
Changed
@@ -40,10 +40,10 @@ #define GTA_PRODUCT_NAME "gtk-gnutella" /**< Normally "gtk-gnutella" */ #define GTA_VERSION 1 /**< major version */ #define GTA_SUBVERSION 2 /**< minor version */ -#define GTA_PATCHLEVEL 0 /**< patch level or teeny version */ +#define GTA_PATCHLEVEL 2 /**< patch level or teeny version */ #define GTA_REVISION "stable" /**< unstable, beta, stable */ #define GTA_REVCHAR "" /**< (u)nstable, (b)eta, "" -> stable */ -#define GTA_RELEASE "2020-07-09" /**< ISO 8601 format YYYY-MM-DD */ +#define GTA_RELEASE "2022-02-25" /**< ISO 8601 format YYYY-MM-DD */ #define GTA_WEBSITE "http://gtk-gnutella.sourceforge.net/" #define GTA_VENDOR_CODE "GTKG" #define GTA_PRODUCT_NICK "gtkg"
View file
gtk-gnutella-1.2.0.tar.xz/src/gtk-gnutella.man -> gtk-gnutella-1.2.2.tar.xz/src/gtk-gnutella.man
Changed
@@ -124,6 +124,13 @@ .I gtk\-gnutella events to D-BUS. .TP +.B "\-\-no\-expire" +Disable GUI popups when +.I gtk\-gnutella +has expired. This is not the default behaviour because we wish to keep +the network healthy by having recent versions running, but at the same +time we understand not everyone can or wants to upgrade in a timely manner. +.TP .B "\-\-no\-restart" Prevents .I gtk\-gnutella
View file
gtk-gnutella-1.2.0.tar.xz/src/if/gnet_property.c -> gtk-gnutella-1.2.2.tar.xz/src/if/gnet_property.c
Changed
@@ -60,11395 +60,11731 @@ G_IGNORE(-Wpragmas); /* For gcc, not clang */ G_IGNORE(-Wunused-const-variable); /* Appears in clang version 3.4.1 */ -gboolean gnet_property_variable_reading_hostfile = FALSE; +gboolean gnet_property_variable_reading_hostfile = FALSE; static const gboolean gnet_property_variable_reading_hostfile_default = FALSE; -gboolean gnet_property_variable_reading_ultrafile = FALSE; +gboolean gnet_property_variable_reading_ultrafile = FALSE; static const gboolean gnet_property_variable_reading_ultrafile_default = FALSE; -gboolean gnet_property_variable_ancient_version = FALSE; +gboolean gnet_property_variable_ancient_version = FALSE; static const gboolean gnet_property_variable_ancient_version_default = FALSE; -char *gnet_property_variable_new_version_str = NULL; -static const char *gnet_property_variable_new_version_str_default = NULL; -guint32 gnet_property_variable_up_connections = 42; +char *gnet_property_variable_new_version_str = NULL; +static const char *gnet_property_variable_new_version_str_default = NULL; +guint32 gnet_property_variable_up_connections = 42; static const guint32 gnet_property_variable_up_connections_default = 42; -guint32 gnet_property_variable_normal_connections = 0; +guint32 gnet_property_variable_normal_connections = 0; static const guint32 gnet_property_variable_normal_connections_default = 0; -guint32 gnet_property_variable_max_connections = 50; +guint32 gnet_property_variable_max_connections = 50; static const guint32 gnet_property_variable_max_connections_default = 50; -guint32 gnet_property_variable_node_leaf_count = 0; +guint32 gnet_property_variable_node_leaf_count = 0; static const guint32 gnet_property_variable_node_leaf_count_default = 0; -guint32 gnet_property_variable_node_normal_count = 0; +guint32 gnet_property_variable_node_normal_count = 0; static const guint32 gnet_property_variable_node_normal_count_default = 0; -guint32 gnet_property_variable_node_ultra_count = 0; +guint32 gnet_property_variable_node_ultra_count = 0; static const guint32 gnet_property_variable_node_ultra_count_default = 0; -guint32 gnet_property_variable_max_downloads = 100; +guint32 gnet_property_variable_max_downloads = 100; static const guint32 gnet_property_variable_max_downloads_default = 100; -guint32 gnet_property_variable_max_host_downloads = 1; +guint32 gnet_property_variable_max_host_downloads = 1; static const guint32 gnet_property_variable_max_host_downloads_default = 1; -guint32 gnet_property_variable_max_uploads = 4; +guint32 gnet_property_variable_max_uploads = 4; static const guint32 gnet_property_variable_max_uploads_default = 4; -guint32 gnet_property_variable_max_uploads_ip = 1; +guint32 gnet_property_variable_max_uploads_ip = 1; static const guint32 gnet_property_variable_max_uploads_ip_default = 1; -host_addr_t gnet_property_variable_local_ip; -host_addr_t gnet_property_variable_local_ip6; -time_t gnet_property_variable_current_ip_stamp = 0; -static const time_t gnet_property_variable_current_ip_stamp_default = 0; -time_t gnet_property_variable_current_ip6_stamp = 0; -static const time_t gnet_property_variable_current_ip6_stamp_default = 0; -guint32 gnet_property_variable_average_ip_uptime = 0; +host_addr_t gnet_property_variable_local_ip; +host_addr_t gnet_property_variable_local_ip6; +time_t gnet_property_variable_current_ip_stamp = 0; +static const time_t gnet_property_variable_current_ip_stamp_default = 0; +time_t gnet_property_variable_current_ip6_stamp = 0; +static const time_t gnet_property_variable_current_ip6_stamp_default = 0; +guint32 gnet_property_variable_average_ip_uptime = 0; static const guint32 gnet_property_variable_average_ip_uptime_default = 0; -guint32 gnet_property_variable_average_ip6_uptime = 0; +guint32 gnet_property_variable_average_ip6_uptime = 0; static const guint32 gnet_property_variable_average_ip6_uptime_default = 0; -time_t gnet_property_variable_start_stamp = 0; -static const time_t gnet_property_variable_start_stamp_default = 0; -guint32 gnet_property_variable_average_servent_uptime = 0; +time_t gnet_property_variable_start_stamp = 0; +static const time_t gnet_property_variable_start_stamp_default = 0; +guint32 gnet_property_variable_average_servent_uptime = 0; static const guint32 gnet_property_variable_average_servent_uptime_default = 0; -guint32 gnet_property_variable_listen_port = 1; +guint32 gnet_property_variable_listen_port = 1; static const guint32 gnet_property_variable_listen_port_default = 1; -host_addr_t gnet_property_variable_forced_local_ip; -host_addr_t gnet_property_variable_forced_local_ip6; -guint32 gnet_property_variable_connection_speed = 0; +host_addr_t gnet_property_variable_forced_local_ip; +host_addr_t gnet_property_variable_forced_local_ip6; +guint32 gnet_property_variable_connection_speed = 0; static const guint32 gnet_property_variable_connection_speed_default = 0; -gboolean gnet_property_variable_compute_connection_speed = TRUE; +gboolean gnet_property_variable_compute_connection_speed = TRUE; static const gboolean gnet_property_variable_compute_connection_speed_default = TRUE; -guint32 gnet_property_variable_search_max_items = 50; +guint32 gnet_property_variable_search_max_items = 50; static const guint32 gnet_property_variable_search_max_items_default = 50; -guint32 gnet_property_variable_ul_usage_min_percentage = 70; +guint32 gnet_property_variable_ul_usage_min_percentage = 70; static const guint32 gnet_property_variable_ul_usage_min_percentage_default = 70; -guint32 gnet_property_variable_download_connecting_timeout = 90; +guint32 gnet_property_variable_download_connecting_timeout = 90; static const guint32 gnet_property_variable_download_connecting_timeout_default = 90; -guint32 gnet_property_variable_download_push_sent_timeout = 90; +guint32 gnet_property_variable_download_push_sent_timeout = 90; static const guint32 gnet_property_variable_download_push_sent_timeout_default = 90; -guint32 gnet_property_variable_download_connected_timeout = 180; +guint32 gnet_property_variable_download_connected_timeout = 180; static const guint32 gnet_property_variable_download_connected_timeout_default = 180; -guint32 gnet_property_variable_download_retry_timeout_min = 20; +guint32 gnet_property_variable_download_retry_timeout_min = 20; static const guint32 gnet_property_variable_download_retry_timeout_min_default = 20; -guint32 gnet_property_variable_download_retry_timeout_max = 3600; +guint32 gnet_property_variable_download_retry_timeout_max = 3600; static const guint32 gnet_property_variable_download_retry_timeout_max_default = 3600; -guint32 gnet_property_variable_download_max_retries = 16; +guint32 gnet_property_variable_download_max_retries = 16; static const guint32 gnet_property_variable_download_max_retries_default = 16; -guint32 gnet_property_variable_download_retry_timeout_delay = 120; +guint32 gnet_property_variable_download_retry_timeout_delay = 120; static const guint32 gnet_property_variable_download_retry_timeout_delay_default = 120; -guint32 gnet_property_variable_download_retry_busy_delay = 60; +guint32 gnet_property_variable_download_retry_busy_delay = 60; static const guint32 gnet_property_variable_download_retry_busy_delay_default = 60; -guint32 gnet_property_variable_download_retry_refused_delay = 180; +guint32 gnet_property_variable_download_retry_refused_delay = 180; static const guint32 gnet_property_variable_download_retry_refused_delay_default = 180; -guint32 gnet_property_variable_download_retry_stopped_delay = 15; +guint32 gnet_property_variable_download_retry_stopped_delay = 15; static const guint32 gnet_property_variable_download_retry_stopped_delay_default = 15; -guint32 gnet_property_variable_download_overlap_range = 512; +guint32 gnet_property_variable_download_overlap_range = 512; static const guint32 gnet_property_variable_download_overlap_range_default = 512; -guint32 gnet_property_variable_upload_connecting_timeout = 90; +guint32 gnet_property_variable_upload_connecting_timeout = 90; static const guint32 gnet_property_variable_upload_connecting_timeout_default = 90; -guint32 gnet_property_variable_upload_connected_timeout = 180; +guint32 gnet_property_variable_upload_connected_timeout = 180; static const guint32 gnet_property_variable_upload_connected_timeout_default = 180; -guint32 gnet_property_variable_search_reissue_timeout = 3600; +guint32 gnet_property_variable_search_reissue_timeout = 3600; static const guint32 gnet_property_variable_search_reissue_timeout_default = 3600; -guint32 gnet_property_variable_ban_ratio_fds = 25; +guint32 gnet_property_variable_ban_ratio_fds = 25; static const guint32 gnet_property_variable_ban_ratio_fds_default = 25; -guint32 gnet_property_variable_ban_max_fds = 100; +guint32 gnet_property_variable_ban_max_fds = 100; static const guint32 gnet_property_variable_ban_max_fds_default = 100; -guint32 gnet_property_variable_banned_count = 0; +guint32 gnet_property_variable_banned_count = 0; static const guint32 gnet_property_variable_banned_count_default = 0; -guint32 gnet_property_variable_max_banned_fd = 100; +guint32 gnet_property_variable_max_banned_fd = 100; static const guint32 gnet_property_variable_max_banned_fd_default = 100; -guint32 gnet_property_variable_incoming_connecting_timeout = 60; +guint32 gnet_property_variable_incoming_connecting_timeout = 60; static const guint32 gnet_property_variable_incoming_connecting_timeout_default = 60; -guint32 gnet_property_variable_node_connecting_timeout = 90; +guint32 gnet_property_variable_node_connecting_timeout = 90; static const guint32 gnet_property_variable_node_connecting_timeout_default = 90; -guint32 gnet_property_variable_node_connected_timeout = 180; +guint32 gnet_property_variable_node_connected_timeout = 180; static const guint32 gnet_property_variable_node_connected_timeout_default = 180; -guint32 gnet_property_variable_node_sendqueue_size = 98304; +guint32 gnet_property_variable_node_sendqueue_size = 98304; static const guint32 gnet_property_variable_node_sendqueue_size_default = 98304; -guint32 gnet_property_variable_node_tx_flowc_timeout = 180; +guint32 gnet_property_variable_node_tx_flowc_timeout = 180; static const guint32 gnet_property_variable_node_tx_flowc_timeout_default = 180; -guint32 gnet_property_variable_node_rx_flowc_ratio = 70; +guint32 gnet_property_variable_node_rx_flowc_ratio = 70; static const guint32 gnet_property_variable_node_rx_flowc_ratio_default = 70; -guint32 gnet_property_variable_max_ttl = 4; +guint32 gnet_property_variable_max_ttl = 4; static const guint32 gnet_property_variable_max_ttl_default = 4; -guint32 gnet_property_variable_my_ttl = 4; +guint32 gnet_property_variable_my_ttl = 4; static const guint32 gnet_property_variable_my_ttl_default = 4; -guint32 gnet_property_variable_hard_ttl_limit = 15; +guint32 gnet_property_variable_hard_ttl_limit = 15; static const guint32 gnet_property_variable_hard_ttl_limit_default = 15; -guint32 gnet_property_variable_dbg = 0; +guint32 gnet_property_variable_dbg = 0; static const guint32 gnet_property_variable_dbg_default = 0; -guint32 gnet_property_variable_ban_debug = 0; +guint32 gnet_property_variable_ban_debug = 0; static const guint32 gnet_property_variable_ban_debug_default = 0; -guint32 gnet_property_variable_cpu_debug = 0; +guint32 gnet_property_variable_cpu_debug = 0; static const guint32 gnet_property_variable_cpu_debug_default = 0; -guint32 gnet_property_variable_dmesh_debug = 0; +guint32 gnet_property_variable_dmesh_debug = 0; static const guint32 gnet_property_variable_dmesh_debug_default = 0; -guint32 gnet_property_variable_gmsg_debug = 0; +guint32 gnet_property_variable_gmsg_debug = 0; static const guint32 gnet_property_variable_gmsg_debug_default = 0; -guint32 gnet_property_variable_share_debug = 0; +guint32 gnet_property_variable_share_debug = 0; static const guint32 gnet_property_variable_share_debug_default = 0; -guint32 gnet_property_variable_node_debug = 0; +guint32 gnet_property_variable_node_debug = 0; static const guint32 gnet_property_variable_node_debug_default = 0; -guint32 gnet_property_variable_socket_debug = 0; +guint32 gnet_property_variable_socket_debug = 0; static const guint32 gnet_property_variable_socket_debug_default = 0; -guint32 gnet_property_variable_bootstrap_debug = 0; +guint32 gnet_property_variable_bootstrap_debug = 0; static const guint32 gnet_property_variable_bootstrap_debug_default = 0; -guint32 gnet_property_variable_http_debug = 0;
View file
gtk-gnutella-1.2.0.tar.xz/src/if/gnet_property.h -> gtk-gnutella-1.2.2.tar.xz/src/if/gnet_property.h
Changed
@@ -36,497 +36,511 @@ #define GNET_PROPERTY_NUM (GNET_PROPERTY_END-(NO_PROP+1)) typedef enum { - PROP_READING_HOSTFILE=(NO_PROP+1), - PROP_READING_ULTRAFILE, - PROP_ANCIENT_VERSION, - PROP_NEW_VERSION_STR, - PROP_UP_CONNECTIONS, - PROP_NORMAL_CONNECTIONS, - PROP_MAX_CONNECTIONS, - PROP_NODE_LEAF_COUNT, - PROP_NODE_NORMAL_COUNT, - PROP_NODE_ULTRA_COUNT, - PROP_MAX_DOWNLOADS, - PROP_MAX_HOST_DOWNLOADS, - PROP_MAX_UPLOADS, - PROP_MAX_UPLOADS_IP, - PROP_LOCAL_IP, - PROP_LOCAL_IP6, - PROP_CURRENT_IP_STAMP, - PROP_CURRENT_IP6_STAMP, - PROP_AVERAGE_IP_UPTIME, - PROP_AVERAGE_IP6_UPTIME, - PROP_START_STAMP, - PROP_AVERAGE_SERVENT_UPTIME, - PROP_LISTEN_PORT, - PROP_FORCED_LOCAL_IP, - PROP_FORCED_LOCAL_IP6, - PROP_CONNECTION_SPEED, - PROP_COMPUTE_CONNECTION_SPEED, - PROP_QUERY_RESPONSE_MAX_ITEMS, - PROP_UL_USAGE_MIN_PERCENTAGE, - PROP_DOWNLOAD_CONNECTING_TIMEOUT, - PROP_DOWNLOAD_PUSH_SENT_TIMEOUT, - PROP_DOWNLOAD_CONNECTED_TIMEOUT, - PROP_DOWNLOAD_RETRY_TIMEOUT_MIN, - PROP_DOWNLOAD_RETRY_TIMEOUT_MAX, - PROP_DOWNLOAD_MAX_RETRIES, - PROP_DOWNLOAD_RETRY_TIMEOUT_DELAY, - PROP_DOWNLOAD_RETRY_BUSY_DELAY, - PROP_DOWNLOAD_RETRY_REFUSED_DELAY, - PROP_DOWNLOAD_RETRY_STOPPED_DELAY, - PROP_DOWNLOAD_OVERLAP_RANGE, - PROP_UPLOAD_CONNECTING_TIMEOUT, - PROP_UPLOAD_CONNECTED_TIMEOUT, - PROP_SEARCH_REISSUE_TIMEOUT, - PROP_BAN_RATIO_FDS, - PROP_BAN_MAX_FDS, - PROP_BANNED_COUNT, - PROP_MAX_BANNED_FD, - PROP_INCOMING_CONNECTING_TIMEOUT, - PROP_NODE_CONNECTING_TIMEOUT, - PROP_NODE_CONNECTED_TIMEOUT, - PROP_NODE_SENDQUEUE_SIZE, - PROP_NODE_TX_FLOWC_TIMEOUT, - PROP_NODE_RX_FLOWC_RATIO, - PROP_MAX_TTL, - PROP_MY_TTL, - PROP_HARD_TTL_LIMIT, - PROP_DBG, - PROP_BAN_DEBUG, - PROP_CPU_DEBUG, - PROP_DMESH_DEBUG, - PROP_GMSG_DEBUG, - PROP_SHARE_DEBUG, - PROP_NODE_DEBUG, - PROP_SOCKET_DEBUG, - PROP_BOOTSTRAP_DEBUG, - PROP_HTTP_DEBUG, - PROP_DOWNLOAD_DEBUG, - PROP_FILEINFO_DEBUG, - PROP_UPLOAD_DEBUG, - PROP_LIB_DEBUG, - PROP_URL_DEBUG, - PROP_DH_DEBUG, - PROP_DQ_DEBUG, - PROP_VMSG_DEBUG, - PROP_QUERY_DEBUG, - PROP_SEARCH_DEBUG, - PROP_UDP_DEBUG, - PROP_QRP_DEBUG, - PROP_ROUTING_DEBUG, - PROP_GGEP_DEBUG, - PROP_PCACHE_DEBUG, - PROP_HSEP_DEBUG, - PROP_TLS_DEBUG, - PROP_PARQ_DEBUG, - PROP_PARQ_OPTIMISTIC, - PROP_PARQ_SIZE_ALWAYS_CONTINUE, - PROP_PARQ_TIME_ALWAYS_CONTINUE, - PROP_PARQ_BAN_BAD_MAXCOUNTWAIT, - PROP_NET_BUFFER_SHORTAGE, - PROP_STOP_HOST_GET, - PROP_BW_HTTP_IN_ENABLED, - PROP_BW_HTTP_OUT_ENABLED, - PROP_BW_GNET_IN_ENABLED, - PROP_BW_GNET_LEAF_IN_ENABLED, - PROP_BW_GNET_OUT_ENABLED, - PROP_BW_GNET_LEAF_OUT_ENABLED, - PROP_BW_UL_USAGE_ENABLED, - PROP_BW_ALLOW_STEALING, - PROP_AUTOCLEAR_COMPLETED_DOWNLOADS, - PROP_AUTOCLEAR_FAILED_DOWNLOADS, - PROP_AUTOCLEAR_UNAVAILABLE_DOWNLOADS, - PROP_AUTOCLEAR_FINISHED_DOWNLOADS, - PROP_SEARCH_REMOVE_DOWNLOADED, - PROP_FORCE_LOCAL_IP, - PROP_FORCE_LOCAL_IP6, - PROP_BIND_TO_FORCED_LOCAL_IP, - PROP_BIND_TO_FORCED_LOCAL_IP6, - PROP_USE_NETMASKS, - PROP_ALLOW_PRIVATE_NETWORK_CONNECTION, - PROP_USE_IP_TOS, - PROP_DOWNLOAD_DELETE_ABORTED, - PROP_PROXY_AUTH, - PROP_SOCKS_USER, - PROP_SOCKS_PASS, - PROP_PROXY_ADDR, - PROP_PROXY_HOSTNAME, - PROP_PROXY_PORT, - PROP_PROXY_PROTOCOL, - PROP_NETWORK_PROTOCOL, - PROP_USE_IPV6_TRT, - PROP_IPV6_TRT_PREFIX, - PROP_HOSTS_IN_CATCHER, - PROP_HOSTS_IN_ULTRA_CATCHER, - PROP_HOSTS_IN_BAD_CATCHER, - PROP_MAX_HOSTS_CACHED, - PROP_MAX_ULTRA_HOSTS_CACHED, - PROP_MAX_BAD_HOSTS_CACHED, - PROP_MAX_HIGH_TTL_MSG, - PROP_MAX_HIGH_TTL_RADIUS, - PROP_BW_HTTP_IN, - PROP_BW_HTTP_OUT, - PROP_BW_GNET_IN, - PROP_BW_GNET_OUT, - PROP_BW_GNET_LIN, - PROP_BW_GNET_LOUT, - PROP_SEARCH_QUERIES_FORWARD_SIZE, - PROP_SEARCH_QUERIES_KICK_SIZE, - PROP_SEARCH_ANSWERS_FORWARD_SIZE, - PROP_SEARCH_ANSWERS_KICK_SIZE, - PROP_SEARCH_MUID_TRACK_AMOUNT, - PROP_OTHER_MESSAGES_KICK_SIZE, - PROP_HOPS_RANDOM_FACTOR, - PROP_SEND_PUSHES, - PROP_MIN_DUP_MSG, - PROP_MIN_DUP_RATIO, - PROP_SCAN_EXTENSIONS, - PROP_SCAN_IGNORE_SYMLINK_DIRS, - PROP_SCAN_IGNORE_SYMLINK_REGFILES, - PROP_SAVE_FILE_PATH, - PROP_MOVE_FILE_PATH, - PROP_BAD_FILE_PATH, - PROP_SHARED_DIRS_PATHS, - PROP_LOCAL_NETMASKS_STRING, - PROP_TOTAL_DOWNLOADS, - PROP_UL_RUNNING, - PROP_UL_QUICK_RUNNING, - PROP_UL_REGISTERED, - PROP_TOTAL_UPLOADS, - PROP_SERVENT_GUID, - PROP_KUID, - PROP_USE_SWARMING, - PROP_USE_AGGRESSIVE_SWARMING, - PROP_DL_MINCHUNKSIZE, - PROP_DL_MAXCHUNKSIZE, - PROP_AUTO_DOWNLOAD_IDENTICAL, - PROP_AUTO_FEED_DOWNLOAD_MESH, - PROP_STRICT_SHA1_MATCHING, - PROP_IS_FIREWALLED, - PROP_IS_INET_CONNECTED, - PROP_IS_UDP_FIREWALLED, - PROP_RECV_SOLICITED_UDP, - PROP_GNET_COMPACT_QUERY, - PROP_DOWNLOAD_OPTIMISTIC_START, - PROP_LIBRARY_REBUILDING, - PROP_SHA1_REBUILDING, - PROP_SHA1_VERIFYING, - PROP_FILE_MOVING, - PROP_PREFER_COMPRESSED_GNET, - PROP_ONLINE_MODE, - PROP_DOWNLOAD_REQUIRE_URN, - PROP_DOWNLOAD_REQUIRE_SERVER_NAME, - PROP_MAX_ULTRAPEERS, - PROP_QUICK_CONNECT_POOL_SIZE, - PROP_MAX_LEAVES, - PROP_SEARCH_HANDLE_IGNORED_FILES, - PROP_CONFIGURED_PEERMODE, - PROP_CURRENT_PEERMODE, - PROP_SYS_NOFILE, - PROP_SYS_PHYSMEM, - PROP_DL_QUEUE_COUNT, - PROP_DL_RUNNING_COUNT, - PROP_DL_ACTIVE_COUNT, - PROP_DL_AQUEUED_COUNT, - PROP_DL_PQUEUED_COUNT, - PROP_FI_ALL_COUNT, - PROP_FI_WITH_SOURCE_COUNT,
View file
gtk-gnutella-1.2.0.tar.xz/src/if/gnet_property_priv.h -> gtk-gnutella-1.2.2.tar.xz/src/if/gnet_property_priv.h
Changed
@@ -34,7 +34,7 @@ #ifdef CORE_SOURCES -#define GNET_PROPERTY(name) (gnet_property_variable_ ## name) +#define GNET_PROPERTY(name) (gnet_property_variable_ ## name) #define GNET_PROPERTY_PTR(name) (&gnet_property_variable_ ## name) /* @@ -54,90 +54,90 @@ extern const gboolean gnet_property_variable_reading_ultrafile; extern const gboolean gnet_property_variable_ancient_version; extern const char *gnet_property_variable_new_version_str; -extern const guint32 gnet_property_variable_up_connections; -extern const guint32 gnet_property_variable_normal_connections; -extern const guint32 gnet_property_variable_max_connections; -extern const guint32 gnet_property_variable_node_leaf_count; -extern const guint32 gnet_property_variable_node_normal_count; -extern const guint32 gnet_property_variable_node_ultra_count; -extern const guint32 gnet_property_variable_max_downloads; -extern const guint32 gnet_property_variable_max_host_downloads; -extern const guint32 gnet_property_variable_max_uploads; -extern const guint32 gnet_property_variable_max_uploads_ip; -extern const host_addr_t gnet_property_variable_local_ip; -extern const host_addr_t gnet_property_variable_local_ip6; +extern const guint32 gnet_property_variable_up_connections; +extern const guint32 gnet_property_variable_normal_connections; +extern const guint32 gnet_property_variable_max_connections; +extern const guint32 gnet_property_variable_node_leaf_count; +extern const guint32 gnet_property_variable_node_normal_count; +extern const guint32 gnet_property_variable_node_ultra_count; +extern const guint32 gnet_property_variable_max_downloads; +extern const guint32 gnet_property_variable_max_host_downloads; +extern const guint32 gnet_property_variable_max_uploads; +extern const guint32 gnet_property_variable_max_uploads_ip; +extern const host_addr_t gnet_property_variable_local_ip; +extern const host_addr_t gnet_property_variable_local_ip6; extern const time_t gnet_property_variable_current_ip_stamp; extern const time_t gnet_property_variable_current_ip6_stamp; -extern const guint32 gnet_property_variable_average_ip_uptime; -extern const guint32 gnet_property_variable_average_ip6_uptime; +extern const guint32 gnet_property_variable_average_ip_uptime; +extern const guint32 gnet_property_variable_average_ip6_uptime; extern const time_t gnet_property_variable_start_stamp; -extern const guint32 gnet_property_variable_average_servent_uptime; -extern const guint32 gnet_property_variable_listen_port; -extern const host_addr_t gnet_property_variable_forced_local_ip; -extern const host_addr_t gnet_property_variable_forced_local_ip6; -extern const guint32 gnet_property_variable_connection_speed; +extern const guint32 gnet_property_variable_average_servent_uptime; +extern const guint32 gnet_property_variable_listen_port; +extern const host_addr_t gnet_property_variable_forced_local_ip; +extern const host_addr_t gnet_property_variable_forced_local_ip6; +extern const guint32 gnet_property_variable_connection_speed; extern const gboolean gnet_property_variable_compute_connection_speed; -extern const guint32 gnet_property_variable_search_max_items; -extern const guint32 gnet_property_variable_ul_usage_min_percentage; -extern const guint32 gnet_property_variable_download_connecting_timeout; -extern const guint32 gnet_property_variable_download_push_sent_timeout; -extern const guint32 gnet_property_variable_download_connected_timeout; -extern const guint32 gnet_property_variable_download_retry_timeout_min; -extern const guint32 gnet_property_variable_download_retry_timeout_max; -extern const guint32 gnet_property_variable_download_max_retries; -extern const guint32 gnet_property_variable_download_retry_timeout_delay; -extern const guint32 gnet_property_variable_download_retry_busy_delay; -extern const guint32 gnet_property_variable_download_retry_refused_delay; -extern const guint32 gnet_property_variable_download_retry_stopped_delay; -extern const guint32 gnet_property_variable_download_overlap_range; -extern const guint32 gnet_property_variable_upload_connecting_timeout; -extern const guint32 gnet_property_variable_upload_connected_timeout; -extern const guint32 gnet_property_variable_search_reissue_timeout; -extern const guint32 gnet_property_variable_ban_ratio_fds; -extern const guint32 gnet_property_variable_ban_max_fds; -extern const guint32 gnet_property_variable_banned_count; -extern const guint32 gnet_property_variable_max_banned_fd; -extern const guint32 gnet_property_variable_incoming_connecting_timeout; -extern const guint32 gnet_property_variable_node_connecting_timeout; -extern const guint32 gnet_property_variable_node_connected_timeout; -extern const guint32 gnet_property_variable_node_sendqueue_size; -extern const guint32 gnet_property_variable_node_tx_flowc_timeout; -extern const guint32 gnet_property_variable_node_rx_flowc_ratio; -extern const guint32 gnet_property_variable_max_ttl; -extern const guint32 gnet_property_variable_my_ttl; -extern const guint32 gnet_property_variable_hard_ttl_limit; -extern const guint32 gnet_property_variable_dbg; -extern const guint32 gnet_property_variable_ban_debug; -extern const guint32 gnet_property_variable_cpu_debug; -extern const guint32 gnet_property_variable_dmesh_debug; -extern const guint32 gnet_property_variable_gmsg_debug; -extern const guint32 gnet_property_variable_share_debug; -extern const guint32 gnet_property_variable_node_debug; -extern const guint32 gnet_property_variable_socket_debug; -extern const guint32 gnet_property_variable_bootstrap_debug; -extern const guint32 gnet_property_variable_http_debug; -extern const guint32 gnet_property_variable_download_debug; -extern const guint32 gnet_property_variable_fileinfo_debug; -extern const guint32 gnet_property_variable_upload_debug; -extern const guint32 gnet_property_variable_lib_debug; -extern const guint32 gnet_property_variable_url_debug; -extern const guint32 gnet_property_variable_dh_debug; -extern const guint32 gnet_property_variable_dq_debug; -extern const guint32 gnet_property_variable_vmsg_debug; -extern const guint32 gnet_property_variable_query_debug; -extern const guint32 gnet_property_variable_search_debug; -extern const guint32 gnet_property_variable_udp_debug; -extern const guint32 gnet_property_variable_qrp_debug; -extern const guint32 gnet_property_variable_routing_debug; -extern const guint32 gnet_property_variable_ggep_debug; -extern const guint32 gnet_property_variable_pcache_debug; -extern const guint32 gnet_property_variable_hsep_debug; -extern const guint32 gnet_property_variable_tls_debug; -extern const guint32 gnet_property_variable_parq_debug; +extern const guint32 gnet_property_variable_search_max_items; +extern const guint32 gnet_property_variable_ul_usage_min_percentage; +extern const guint32 gnet_property_variable_download_connecting_timeout; +extern const guint32 gnet_property_variable_download_push_sent_timeout; +extern const guint32 gnet_property_variable_download_connected_timeout; +extern const guint32 gnet_property_variable_download_retry_timeout_min; +extern const guint32 gnet_property_variable_download_retry_timeout_max; +extern const guint32 gnet_property_variable_download_max_retries; +extern const guint32 gnet_property_variable_download_retry_timeout_delay; +extern const guint32 gnet_property_variable_download_retry_busy_delay; +extern const guint32 gnet_property_variable_download_retry_refused_delay; +extern const guint32 gnet_property_variable_download_retry_stopped_delay; +extern const guint32 gnet_property_variable_download_overlap_range; +extern const guint32 gnet_property_variable_upload_connecting_timeout; +extern const guint32 gnet_property_variable_upload_connected_timeout; +extern const guint32 gnet_property_variable_search_reissue_timeout; +extern const guint32 gnet_property_variable_ban_ratio_fds; +extern const guint32 gnet_property_variable_ban_max_fds; +extern const guint32 gnet_property_variable_banned_count; +extern const guint32 gnet_property_variable_max_banned_fd; +extern const guint32 gnet_property_variable_incoming_connecting_timeout; +extern const guint32 gnet_property_variable_node_connecting_timeout; +extern const guint32 gnet_property_variable_node_connected_timeout; +extern const guint32 gnet_property_variable_node_sendqueue_size; +extern const guint32 gnet_property_variable_node_tx_flowc_timeout; +extern const guint32 gnet_property_variable_node_rx_flowc_ratio; +extern const guint32 gnet_property_variable_max_ttl; +extern const guint32 gnet_property_variable_my_ttl; +extern const guint32 gnet_property_variable_hard_ttl_limit; +extern const guint32 gnet_property_variable_dbg; +extern const guint32 gnet_property_variable_ban_debug; +extern const guint32 gnet_property_variable_cpu_debug; +extern const guint32 gnet_property_variable_dmesh_debug; +extern const guint32 gnet_property_variable_gmsg_debug; +extern const guint32 gnet_property_variable_share_debug; +extern const guint32 gnet_property_variable_node_debug; +extern const guint32 gnet_property_variable_socket_debug; +extern const guint32 gnet_property_variable_bootstrap_debug; +extern const guint32 gnet_property_variable_http_debug; +extern const guint32 gnet_property_variable_download_debug; +extern const guint32 gnet_property_variable_fileinfo_debug; +extern const guint32 gnet_property_variable_upload_debug; +extern const guint32 gnet_property_variable_lib_debug; +extern const guint32 gnet_property_variable_url_debug; +extern const guint32 gnet_property_variable_dh_debug; +extern const guint32 gnet_property_variable_dq_debug; +extern const guint32 gnet_property_variable_vmsg_debug; +extern const guint32 gnet_property_variable_query_debug; +extern const guint32 gnet_property_variable_search_debug; +extern const guint32 gnet_property_variable_udp_debug; +extern const guint32 gnet_property_variable_qrp_debug; +extern const guint32 gnet_property_variable_routing_debug; +extern const guint32 gnet_property_variable_ggep_debug; +extern const guint32 gnet_property_variable_pcache_debug; +extern const guint32 gnet_property_variable_hsep_debug; +extern const guint32 gnet_property_variable_tls_debug; +extern const guint32 gnet_property_variable_parq_debug; extern const gboolean gnet_property_variable_parq_optimistic; -extern const guint32 gnet_property_variable_parq_size_always_continue; -extern const guint32 gnet_property_variable_parq_time_always_continue; -extern const guint32 gnet_property_variable_parq_ban_bad_maxcountwait; +extern const guint32 gnet_property_variable_parq_size_always_continue; +extern const guint32 gnet_property_variable_parq_time_always_continue; +extern const guint32 gnet_property_variable_parq_ban_bad_maxcountwait; extern const gboolean gnet_property_variable_net_buffer_shortage; extern const gboolean gnet_property_variable_stop_host_get; extern const gboolean gnet_property_variable_bws_in_enabled; @@ -164,37 +164,37 @@ extern const gboolean gnet_property_variable_proxy_auth; extern const char *gnet_property_variable_socks_user; extern const char *gnet_property_variable_socks_pass; -extern const host_addr_t gnet_property_variable_proxy_addr; +extern const host_addr_t gnet_property_variable_proxy_addr; extern const char *gnet_property_variable_proxy_hostname; -extern const guint32 gnet_property_variable_proxy_port; -extern const guint32 gnet_property_variable_proxy_protocol; -extern const guint32 gnet_property_variable_network_protocol; +extern const guint32 gnet_property_variable_proxy_port; +extern const guint32 gnet_property_variable_proxy_protocol; +extern const guint32 gnet_property_variable_network_protocol; extern const gboolean gnet_property_variable_use_ipv6_trt; -extern const host_addr_t gnet_property_variable_ipv6_trt_prefix; -extern const guint32 gnet_property_variable_hosts_in_catcher; -extern const guint32 gnet_property_variable_hosts_in_ultra_catcher; -extern const guint32 gnet_property_variable_hosts_in_bad_catcher; -extern const guint32 gnet_property_variable_max_hosts_cached; -extern const guint32 gnet_property_variable_max_ultra_hosts_cached; -extern const guint32 gnet_property_variable_max_bad_hosts_cached;
View file
gtk-gnutella-1.2.0.tar.xz/src/if/gnet_props.ag -> gtk-gnutella-1.2.2.tar.xz/src/if/gnet_props.ag
Changed
@@ -5731,4 +5731,134 @@ }; }; +prop = { + name = "bc_http_out"; + desc = "Total outgoing HTTP traffic in bytes for this session."; + type = guint64; + data = { + default = 0; + }; +}; + +prop = { + name = "bc_gnet_tcp_up_out"; + desc = "Total outgoing Gnutella TCP UP traffic in bytes for this session."; + type = guint64; + data = { + default = 0; + }; +}; + +prop = { + name = "bc_gnet_tcp_leaf_out"; + desc = "Total outgoing Gnutella TCP leaf traffic in bytes for this session."; + type = guint64; + data = { + default = 0; + }; +}; + +prop = { + name = "bc_gnet_udp_out"; + desc = "Total outgoing Gnutella UDP traffic in bytes for this session."; + type = guint64; + data = { + default = 0; + }; +}; + +prop = { + name = "bc_dht_out"; + desc = "Total outgoing DHT traffic in bytes for this session."; + type = guint64; + data = { + default = 0; + }; +}; + +prop = { + name = "bc_loopback_out"; + desc = "Total outgoing traffic in bytes on the loopback address " + "for this session."; + type = guint64; + data = { + default = 0; + }; +}; + +prop = { + name = "bc_private_out"; + desc = "Total outgoing traffic in bytes on the private addresses " + "for this session."; + type = guint64; + data = { + default = 0; + }; +}; + +prop = { + name = "bc_http_in"; + desc = "Total incoming HTTP traffic in bytes for this session."; + type = guint64; + data = { + default = 0; + }; +}; + +prop = { + name = "bc_gnet_tcp_up_in"; + desc = "Total incoming Gnutella TCP UP traffic in bytes for this session."; + type = guint64; + data = { + default = 0; + }; +}; + +prop = { + name = "bc_gnet_tcp_leaf_in"; + desc = "Total incoming Gnutella TCP leaf traffic in bytes for this session."; + type = guint64; + data = { + default = 0; + }; +}; + +prop = { + name = "bc_gnet_udp_in"; + desc = "Total incoming Gnutella UDP traffic in bytes for this session."; + type = guint64; + data = { + default = 0; + }; +}; + +prop = { + name = "bc_dht_in"; + desc = "Total incoming DHT traffic in bytes for this session."; + type = guint64; + data = { + default = 0; + }; +}; + +prop = { + name = "bc_loopback_in"; + desc = "Total incoming traffic in bytes on the loopback address " + "for this session."; + type = guint64; + data = { + default = 0; + }; +}; + +prop = { + name = "bc_private_in"; + desc = "Total incoming traffic in bytes on the private addresses " + "for this session."; + type = guint64; + data = { + default = 0; + }; +}; + /* vi: set ts=4: */
View file
gtk-gnutella-1.2.0.tar.xz/src/if/gui_property.c -> gtk-gnutella-1.2.2.tar.xz/src/if/gui_property.c
Changed
@@ -58,2871 +58,2871 @@ G_IGNORE(-Wpragmas); /* For gcc, not clang */ G_IGNORE(-Wunused-const-variable); /* Appears in clang version 3.4.1 */ -gboolean gui_property_variable_monitor_enabled = FALSE; +gboolean gui_property_variable_monitor_enabled = FALSE; static const gboolean gui_property_variable_monitor_enabled_default = FALSE; -guint32 gui_property_variable_monitor_max_items = 25; +guint32 gui_property_variable_monitor_max_items = 25; static const guint32 gui_property_variable_monitor_max_items_default = 25; -gboolean gui_property_variable_search_hide_downloaded = FALSE; +gboolean gui_property_variable_search_hide_downloaded = FALSE; static const gboolean gui_property_variable_search_hide_downloaded_default = FALSE; -guint32 gui_property_variable_nodes_col_widthsNODES_VISIBLE_COLUMNS = { 130, 50, 120, 20, 30, 30, 80 }; +guint32 gui_property_variable_nodes_col_widthsNODES_VISIBLE_COLUMNS = { 130, 50, 120, 20, 30, 30, 80 }; static const guint32 gui_property_variable_nodes_col_widths_defaultNODES_VISIBLE_COLUMNS = { 130, 50, 120, 20, 30, 30, 80 }; -gboolean gui_property_variable_nodes_col_visibleNODES_VISIBLE_COLUMNS = { 1,1,1,1,1,1,1,1}; +gboolean gui_property_variable_nodes_col_visibleNODES_VISIBLE_COLUMNS = { 1,1,1,1,1,1,1,1}; static const gboolean gui_property_variable_nodes_col_visible_defaultNODES_VISIBLE_COLUMNS = { 1,1,1,1,1,1,1,1}; -guint32 gui_property_variable_file_info_col_widthsFILEINFO_VISIBLE_COLUMNS = { 240, 80, 80, 80, 80, 80, 80, 80, 80, 80 }; +guint32 gui_property_variable_file_info_col_widthsFILEINFO_VISIBLE_COLUMNS = { 240, 80, 80, 80, 80, 80, 80, 80, 80, 80 }; static const guint32 gui_property_variable_file_info_col_widths_defaultFILEINFO_VISIBLE_COLUMNS = { 240, 80, 80, 80, 80, 80, 80, 80, 80, 80 }; -gboolean gui_property_variable_file_info_col_visibleFILEINFO_VISIBLE_COLUMNS = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; +gboolean gui_property_variable_file_info_col_visibleFILEINFO_VISIBLE_COLUMNS = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; static const gboolean gui_property_variable_file_info_col_visible_defaultFILEINFO_VISIBLE_COLUMNS = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; -guint32 gui_property_variable_sources_col_widthsSOURCES_VISIBLE_COLUMNS = { 100, 100, 100, 100, 100, 100 }; +guint32 gui_property_variable_sources_col_widthsSOURCES_VISIBLE_COLUMNS = { 100, 100, 100, 100, 100, 100 }; static const guint32 gui_property_variable_sources_col_widths_defaultSOURCES_VISIBLE_COLUMNS = { 100, 100, 100, 100, 100, 100 }; -guint32 gui_property_variable_search_list_col_widthsSEARCH_LIST_VISIBLE_COLUMNS = { 80, 20, 20 }; +guint32 gui_property_variable_search_list_col_widthsSEARCH_LIST_VISIBLE_COLUMNS = { 80, 20, 20 }; static const guint32 gui_property_variable_search_list_col_widths_defaultSEARCH_LIST_VISIBLE_COLUMNS = { 80, 20, 20 }; -gboolean gui_property_variable_search_results_col_visibleSEARCH_RESULTS_VISIBLE_COLUMNS = { 1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0 }; +gboolean gui_property_variable_search_results_col_visibleSEARCH_RESULTS_VISIBLE_COLUMNS = { 1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0 }; static const gboolean gui_property_variable_search_results_col_visible_defaultSEARCH_RESULTS_VISIBLE_COLUMNS = { 1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0 }; -guint32 gui_property_variable_search_results_col_widthsSEARCH_RESULTS_VISIBLE_COLUMNS = { 210, 30, 50, 80, 30, 120, 90, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40}; +guint32 gui_property_variable_search_results_col_widthsSEARCH_RESULTS_VISIBLE_COLUMNS = { 210, 30, 50, 80, 30, 120, 90, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40}; static const guint32 gui_property_variable_search_results_col_widths_defaultSEARCH_RESULTS_VISIBLE_COLUMNS = { 210, 30, 50, 80, 30, 120, 90, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40}; -guint32 gui_property_variable_search_stats_col_widths3 = { 200, 80, 80 }; +guint32 gui_property_variable_search_stats_col_widths3 = { 200, 80, 80 }; static const guint32 gui_property_variable_search_stats_col_widths_default3 = { 200, 80, 80 }; -guint32 gui_property_variable_ul_stats_col_widthsUPLOAD_STATS_GUI_VISIBLE_COLUMNS = { 200, 80, 80, 80, 80, 80, 80 }; +guint32 gui_property_variable_ul_stats_col_widthsUPLOAD_STATS_GUI_VISIBLE_COLUMNS = { 200, 80, 80, 80, 80, 80, 80 }; static const guint32 gui_property_variable_ul_stats_col_widths_defaultUPLOAD_STATS_GUI_VISIBLE_COLUMNS = { 200, 80, 80, 80, 80, 80, 80 }; -gboolean gui_property_variable_ul_stats_col_visibleUPLOAD_STATS_GUI_VISIBLE_COLUMNS = { 1, 1, 1, 1, 1, 1, 1 }; +gboolean gui_property_variable_ul_stats_col_visibleUPLOAD_STATS_GUI_VISIBLE_COLUMNS = { 1, 1, 1, 1, 1, 1, 1 }; static const gboolean gui_property_variable_ul_stats_col_visible_defaultUPLOAD_STATS_GUI_VISIBLE_COLUMNS = { 1, 1, 1, 1, 1, 1, 1 }; -guint32 gui_property_variable_uploads_col_widthsUPLOADS_GUI_VISIBLE_COLUMNS = { 200, 120, 36, 80, 80, 80, 80 }; +guint32 gui_property_variable_uploads_col_widthsUPLOADS_GUI_VISIBLE_COLUMNS = { 200, 120, 36, 80, 80, 80, 80 }; static const guint32 gui_property_variable_uploads_col_widths_defaultUPLOADS_GUI_VISIBLE_COLUMNS = { 200, 120, 36, 80, 80, 80, 80 }; -gboolean gui_property_variable_uploads_col_visibleUPLOADS_GUI_VISIBLE_COLUMNS = { 1, 1, 1, 1, 1, 1, 1 }; +gboolean gui_property_variable_uploads_col_visibleUPLOADS_GUI_VISIBLE_COLUMNS = { 1, 1, 1, 1, 1, 1, 1 }; static const gboolean gui_property_variable_uploads_col_visible_defaultUPLOADS_GUI_VISIBLE_COLUMNS = { 1, 1, 1, 1, 1, 1, 1 }; -guint32 gui_property_variable_filter_rules_col_widths4 = { 10, 240, 80, 40 }; +guint32 gui_property_variable_filter_rules_col_widths4 = { 10, 240, 80, 40 }; static const guint32 gui_property_variable_filter_rules_col_widths_default4 = { 10, 240, 80, 40 }; -guint32 gui_property_variable_filter_filters_col_widths3 = { 80, 40, 20 }; +guint32 gui_property_variable_filter_filters_col_widths3 = { 80, 40, 20 }; static const guint32 gui_property_variable_filter_filters_col_widths_default3 = { 80, 40, 20 }; -guint32 gui_property_variable_gnet_stats_msg_col_widths8 = { 120, 60, 60, 60, 60, 60, 60, 20 }; +guint32 gui_property_variable_gnet_stats_msg_col_widths8 = { 120, 60, 60, 60, 60, 60, 60, 20 }; static const guint32 gui_property_variable_gnet_stats_msg_col_widths_default8 = { 120, 60, 60, 60, 60, 60, 60, 20 }; -guint32 gui_property_variable_gnet_stats_fc_ttl_col_widths10 = { 120, 60, 60, 60, 60, 60, 60, 60, 60, 20 }; +guint32 gui_property_variable_gnet_stats_fc_ttl_col_widths10 = { 120, 60, 60, 60, 60, 60, 60, 60, 60, 20 }; static const guint32 gui_property_variable_gnet_stats_fc_ttl_col_widths_default10 = { 120, 60, 60, 60, 60, 60, 60, 60, 60, 20 }; -guint32 gui_property_variable_gnet_stats_fc_hops_col_widths10 = { 120, 60, 60, 60, 60, 60, 60, 60, 60, 20 }; +guint32 gui_property_variable_gnet_stats_fc_hops_col_widths10 = { 120, 60, 60, 60, 60, 60, 60, 60, 60, 20 }; static const guint32 gui_property_variable_gnet_stats_fc_hops_col_widths_default10 = { 120, 60, 60, 60, 60, 60, 60, 60, 60, 20 }; -guint32 gui_property_variable_gnet_stats_fc_col_widths10 = { 120, 60, 60, 60, 60, 60, 60, 60, 60, 20 }; +guint32 gui_property_variable_gnet_stats_fc_col_widths10 = { 120, 60, 60, 60, 60, 60, 60, 60, 60, 20 }; static const guint32 gui_property_variable_gnet_stats_fc_col_widths_default10 = { 120, 60, 60, 60, 60, 60, 60, 60, 60, 20 }; -guint32 gui_property_variable_gnet_stats_horizon_col_widths4 = { 30, 40, 40, 40 }; +guint32 gui_property_variable_gnet_stats_horizon_col_widths4 = { 30, 40, 40, 40 }; static const guint32 gui_property_variable_gnet_stats_horizon_col_widths_default4 = { 30, 40, 40, 40 }; -guint32 gui_property_variable_gnet_stats_drop_reasons_col_widths2 = { 240, 55 }; +guint32 gui_property_variable_gnet_stats_drop_reasons_col_widths2 = { 240, 55 }; static const guint32 gui_property_variable_gnet_stats_drop_reasons_col_widths_default2 = { 240, 55 }; -guint32 gui_property_variable_gnet_stats_recv_col_widths10 = { 120, 60, 60, 60, 60, 60, 60, 60, 60, 20 }; +guint32 gui_property_variable_gnet_stats_recv_col_widths10 = { 120, 60, 60, 60, 60, 60, 60, 60, 60, 20 }; static const guint32 gui_property_variable_gnet_stats_recv_col_widths_default10 = { 120, 60, 60, 60, 60, 60, 60, 60, 60, 20 }; -guint32 gui_property_variable_hcache_col_widths4 = { 60, 40, 40, 40 }; +guint32 gui_property_variable_hcache_col_widths4 = { 60, 40, 40, 40 }; static const guint32 gui_property_variable_hcache_col_widths_default4 = { 60, 40, 40, 40 }; -guint32 gui_property_variable_window_coords4 = { 0, 0, 0, 0 }; +guint32 gui_property_variable_window_coords4 = { 0, 0, 0, 0 }; static const guint32 gui_property_variable_window_coords_default4 = { 0, 0, 0, 0 }; -guint32 gui_property_variable_filter_dlg_coords4 = { 0, 0, 0, 0 }; +guint32 gui_property_variable_filter_dlg_coords4 = { 0, 0, 0, 0 }; static const guint32 gui_property_variable_filter_dlg_coords_default4 = { 0, 0, 0, 0 }; -guint32 gui_property_variable_prefs_dlg_coords4 = { 0, 0, 0, 0 }; +guint32 gui_property_variable_prefs_dlg_coords4 = { 0, 0, 0, 0 }; static const guint32 gui_property_variable_prefs_dlg_coords_default4 = { 0, 0, 0, 0 }; -guint32 gui_property_variable_fileinfo_divider_pos = 305; +guint32 gui_property_variable_fileinfo_divider_pos = 305; static const guint32 gui_property_variable_fileinfo_divider_pos_default = 305; -guint32 gui_property_variable_main_divider_pos = 140; +guint32 gui_property_variable_main_divider_pos = 140; static const guint32 gui_property_variable_main_divider_pos_default = 140; -guint32 gui_property_variable_gnet_stats_divider_pos = 300; +guint32 gui_property_variable_gnet_stats_divider_pos = 300; static const guint32 gui_property_variable_gnet_stats_divider_pos_default = 300; -guint32 gui_property_variable_results_divider_pos = 400; +guint32 gui_property_variable_results_divider_pos = 400; static const guint32 gui_property_variable_results_divider_pos_default = 400; -guint32 gui_property_variable_gui_debug = 0; +guint32 gui_property_variable_gui_debug = 0; static const guint32 gui_property_variable_gui_debug_default = 0; -guint32 gui_property_variable_filter_main_divider_pos = 140; +guint32 gui_property_variable_filter_main_divider_pos = 140; static const guint32 gui_property_variable_filter_main_divider_pos_default = 140; -gboolean gui_property_variable_search_results_show_tabs = FALSE; +gboolean gui_property_variable_search_results_show_tabs = FALSE; static const gboolean gui_property_variable_search_results_show_tabs_default = FALSE; -gboolean gui_property_variable_searchbar_visible = TRUE; +gboolean gui_property_variable_searchbar_visible = TRUE; static const gboolean gui_property_variable_searchbar_visible_default = TRUE; -gboolean gui_property_variable_sidebar_visible = TRUE; +gboolean gui_property_variable_sidebar_visible = TRUE; static const gboolean gui_property_variable_sidebar_visible_default = TRUE; -gboolean gui_property_variable_menubar_visible = TRUE; +gboolean gui_property_variable_menubar_visible = TRUE; static const gboolean gui_property_variable_menubar_visible_default = TRUE; -gboolean gui_property_variable_statusbar_visible = TRUE; +gboolean gui_property_variable_statusbar_visible = TRUE; static const gboolean gui_property_variable_statusbar_visible_default = TRUE; -gboolean gui_property_variable_progressbar_uploads_visible = TRUE; +gboolean gui_property_variable_progressbar_uploads_visible = TRUE; static const gboolean gui_property_variable_progressbar_uploads_visible_default = TRUE; -gboolean gui_property_variable_progressbar_downloads_visible = TRUE; +gboolean gui_property_variable_progressbar_downloads_visible = TRUE; static const gboolean gui_property_variable_progressbar_downloads_visible_default = TRUE; -gboolean gui_property_variable_progressbar_connections_visible = TRUE; +gboolean gui_property_variable_progressbar_connections_visible = TRUE; static const gboolean gui_property_variable_progressbar_connections_visible_default = TRUE; -gboolean gui_property_variable_progressbar_bws_in_visible = TRUE; +gboolean gui_property_variable_progressbar_bws_in_visible = TRUE; static const gboolean gui_property_variable_progressbar_bws_in_visible_default = TRUE; -gboolean gui_property_variable_progressbar_bws_out_visible = TRUE; +gboolean gui_property_variable_progressbar_bws_out_visible = TRUE; static const gboolean gui_property_variable_progressbar_bws_out_visible_default = TRUE; -gboolean gui_property_variable_progressbar_bws_gin_visible = TRUE; +gboolean gui_property_variable_progressbar_bws_gin_visible = TRUE; static const gboolean gui_property_variable_progressbar_bws_gin_visible_default = TRUE; -gboolean gui_property_variable_progressbar_bws_gout_visible = TRUE; +gboolean gui_property_variable_progressbar_bws_gout_visible = TRUE; static const gboolean gui_property_variable_progressbar_bws_gout_visible_default = TRUE; -gboolean gui_property_variable_progressbar_bws_glin_visible = TRUE; +gboolean gui_property_variable_progressbar_bws_glin_visible = TRUE; static const gboolean gui_property_variable_progressbar_bws_glin_visible_default = TRUE; -gboolean gui_property_variable_progressbar_bws_glout_visible = TRUE; +gboolean gui_property_variable_progressbar_bws_glout_visible = TRUE; static const gboolean gui_property_variable_progressbar_bws_glout_visible_default = TRUE; -gboolean gui_property_variable_autohide_bws_gleaf = TRUE; +gboolean gui_property_variable_autohide_bws_gleaf = TRUE; static const gboolean gui_property_variable_autohide_bws_gleaf_default = TRUE; -gboolean gui_property_variable_progressbar_bws_in_avg = FALSE; +gboolean gui_property_variable_progressbar_bws_in_avg = FALSE; static const gboolean gui_property_variable_progressbar_bws_in_avg_default = FALSE; -gboolean gui_property_variable_progressbar_bws_out_avg = FALSE; +gboolean gui_property_variable_progressbar_bws_out_avg = FALSE; static const gboolean gui_property_variable_progressbar_bws_out_avg_default = FALSE; -gboolean gui_property_variable_progressbar_bws_gin_avg = FALSE; +gboolean gui_property_variable_progressbar_bws_gin_avg = FALSE; static const gboolean gui_property_variable_progressbar_bws_gin_avg_default = FALSE; -gboolean gui_property_variable_progressbar_bws_gout_avg = FALSE; +gboolean gui_property_variable_progressbar_bws_gout_avg = FALSE; static const gboolean gui_property_variable_progressbar_bws_gout_avg_default = FALSE; -gboolean gui_property_variable_progressbar_bws_glin_avg = FALSE; +gboolean gui_property_variable_progressbar_bws_glin_avg = FALSE; static const gboolean gui_property_variable_progressbar_bws_glin_avg_default = FALSE; -gboolean gui_property_variable_progressbar_bws_glout_avg = FALSE; +gboolean gui_property_variable_progressbar_bws_glout_avg = FALSE; static const gboolean gui_property_variable_progressbar_bws_glout_avg_default = FALSE; -gboolean gui_property_variable_search_sort_casesense = FALSE; +gboolean gui_property_variable_search_sort_casesense = FALSE; static const gboolean gui_property_variable_search_sort_casesense_default = FALSE; -guint32 gui_property_variable_search_sort_default_order = 0; +guint32 gui_property_variable_search_sort_default_order = 0; static const guint32 gui_property_variable_search_sort_default_order_default = 0; -guint32 gui_property_variable_search_sort_default_column = -1; +guint32 gui_property_variable_search_sort_default_column = -1; static const guint32 gui_property_variable_search_sort_default_column_default = -1; -gboolean gui_property_variable_search_discard_spam = TRUE; +gboolean gui_property_variable_search_discard_spam = TRUE; static const gboolean gui_property_variable_search_discard_spam_default = TRUE; -gboolean gui_property_variable_search_discard_hashless = TRUE; +gboolean gui_property_variable_search_discard_hashless = TRUE; static const gboolean gui_property_variable_search_discard_hashless_default = TRUE; -gboolean gui_property_variable_search_jump_to_created = TRUE; +gboolean gui_property_variable_search_jump_to_created = TRUE; static const gboolean gui_property_variable_search_jump_to_created_default = TRUE; -guint32 gui_property_variable_search_stats_mode = 0; +guint32 gui_property_variable_search_stats_mode = 0; static const guint32 gui_property_variable_search_stats_mode_default = 0; static const prop_def_choice_t gui_property_variable_search_stats_mode_choices = { - {N_("disable"), 0}, - {N_("by words"), 1}, - {N_("by whole query"), 2}, - {N_("by router"), 3}, - {NULL, 0} + {N_("disable"), 0},
View file
gtk-gnutella-1.2.0.tar.xz/src/if/gui_property.h -> gtk-gnutella-1.2.2.tar.xz/src/if/gui_property.h
Changed
@@ -36,133 +36,133 @@ #define GUI_PROPERTY_NUM (GUI_PROPERTY_END-1000) typedef enum { - PROP_MONITOR_ENABLED=1000, - PROP_MONITOR_MAX_ITEMS, - PROP_SEARCH_HIDE_DOWNLOADED, - PROP_NODES_COL_WIDTHS, - PROP_NODES_COL_VISIBLE, - PROP_FILE_INFO_COL_WIDTHS, - PROP_FILE_INFO_COL_VISIBLE, - PROP_SOURCES_COL_WIDTHS, - PROP_SEARCH_LIST_COL_WIDTHS, - PROP_SEARCH_RESULTS_COL_VISIBLE, - PROP_SEARCH_RESULTS_COL_WIDTHS, - PROP_SEARCH_STATS_COL_WIDTHS, - PROP_UL_STATS_COL_WIDTHS, - PROP_UL_STATS_COL_VISIBLE, - PROP_UPLOADS_COL_WIDTHS, - PROP_UPLOADS_COL_VISIBLE, - PROP_FILTER_RULES_COL_WIDTHS, - PROP_FILTER_FILTERS_COL_WIDTHS, - PROP_GNET_STATS_MSG_COL_WIDTHS, - PROP_GNET_STATS_FC_TTL_COL_WIDTHS, - PROP_GNET_STATS_FC_HOPS_COL_WIDTHS, - PROP_GNET_STATS_FC_COL_WIDTHS, - PROP_GNET_STATS_HORIZON_COL_WIDTHS, - PROP_GNET_STATS_DROP_REASONS_COL_WIDTHS, - PROP_GNET_STATS_RECV_COL_WIDTHS, - PROP_HCACHE_COL_WIDTHS, - PROP_WINDOW_COORDS, - PROP_FILTER_DLG_COORDS, - PROP_PREFS_DLG_COORDS, - PROP_FILEINFO_DIVIDER_POS, - PROP_MAIN_DIVIDER_POS, - PROP_GNET_STATS_DIVIDER_POS, - PROP_RESULTS_DIVIDER_POS, - PROP_GUI_DEBUG, - PROP_FILTER_MAIN_DIVIDER_POS, - PROP_SEARCH_RESULTS_SHOW_TABS, - PROP_SEARCHBAR_VISIBLE, - PROP_SIDEBAR_VISIBLE, - PROP_MENUBAR_VISIBLE, - PROP_STATUSBAR_VISIBLE, - PROP_PROGRESSBAR_UPLOADS_VISIBLE, - PROP_PROGRESSBAR_DOWNLOADS_VISIBLE, - PROP_PROGRESSBAR_CONNECTIONS_VISIBLE, - PROP_PROGRESSBAR_BWS_IN_VISIBLE, - PROP_PROGRESSBAR_BWS_OUT_VISIBLE, - PROP_PROGRESSBAR_BWS_GIN_VISIBLE, - PROP_PROGRESSBAR_BWS_GOUT_VISIBLE, - PROP_PROGRESSBAR_BWS_GLIN_VISIBLE, - PROP_PROGRESSBAR_BWS_GLOUT_VISIBLE, - PROP_AUTOHIDE_BWS_GLEAF, - PROP_PROGRESSBAR_BWS_IN_AVG, - PROP_PROGRESSBAR_BWS_OUT_AVG, - PROP_PROGRESSBAR_BWS_GIN_AVG, - PROP_PROGRESSBAR_BWS_GOUT_AVG, - PROP_PROGRESSBAR_BWS_GLIN_AVG, - PROP_PROGRESSBAR_BWS_GLOUT_AVG, - PROP_SEARCH_SORT_CASESENSE, - PROP_SEARCH_SORT_DEFAULT_ORDER, - PROP_SEARCH_SORT_DEFAULT_COLUMN, - PROP_SEARCH_DISCARD_SPAM, - PROP_SEARCH_DISCARD_HASHLESS, - PROP_SEARCH_JUMP_TO_CREATED, - PROP_SEARCH_STATS_MODE, - PROP_SEARCH_STATS_UPDATE_INTERVAL, - PROP_SEARCH_STATS_DELCOEF, - PROP_CONFIRM_QUIT, - PROP_SHOW_TOOLTIPS, - PROP_EXPERT_MODE, - PROP_GNET_STATS_PERC, - PROP_GNET_STATS_BYTES, - PROP_GNET_STATS_HOPS, - PROP_GNET_STATS_SOURCE, - PROP_GNET_STATS_DROP_REASONS_TYPE, - PROP_GNET_STATS_WITH_HEADERS, - PROP_GNET_STATS_DROP_PERC, - PROP_GNET_STATS_GENERAL_COL_WIDTHS, - PROP_AUTOCLEAR_COMPLETED_UPLOADS, - PROP_AUTOCLEAR_FAILED_UPLOADS, - PROP_NODE_SHOW_UPTIME, - PROP_NODE_SHOW_HANDSHAKE_VERSION, - PROP_NODE_SHOW_DETAILED_INFO, - PROP_SHOW_GNET_INFO_TXC, - PROP_SHOW_GNET_INFO_RXC, - PROP_SHOW_GNET_INFO_TX_WIRE, - PROP_SHOW_GNET_INFO_RX_WIRE, - PROP_SHOW_GNET_INFO_TX_SPEED, - PROP_SHOW_GNET_INFO_RX_SPEED, - PROP_SHOW_GNET_INFO_TX_QUERIES, - PROP_SHOW_GNET_INFO_RX_QUERIES, - PROP_SHOW_GNET_INFO_TX_HITS, - PROP_SHOW_GNET_INFO_RX_HITS, - PROP_SHOW_GNET_INFO_GEN_QUERIES, - PROP_SHOW_GNET_INFO_SQ_QUERIES, - PROP_SHOW_GNET_INFO_TX_DROPPED, - PROP_SHOW_GNET_INFO_RX_DROPPED, - PROP_SHOW_GNET_INFO_QRP_STATS, - PROP_SHOW_GNET_INFO_DBW, - PROP_SHOW_GNET_INFO_RT, - PROP_SHOW_GNET_INFO_SHARED_SIZE, - PROP_SHOW_GNET_INFO_SHARED_FILES, - PROP_SEARCH_ACCUMULATION_PERIOD, - PROP_TREEMENU_NODES_EXPANDED, - PROP_GNET_STATS_PKG_COL_WIDTHS, - PROP_GNET_STATS_BYTE_COL_WIDTHS, - PROP_CONFIG_TOOLBAR_STYLE, - PROP_SEARCH_LIFETIME, - PROP_STATUS_ICON_ENABLED, - PROP_AUTOHIDE_BWS_DHT, - PROP_PROGRESSBAR_BWS_DHT_IN_VISIBLE, - PROP_PROGRESSBAR_BWS_DHT_OUT_VISIBLE, - PROP_PROGRESSBAR_BWS_DHT_IN_AVG, - PROP_PROGRESSBAR_BWS_DHT_OUT_AVG, - PROP_SEARCH_MEDIA_TYPE_AUDIO, - PROP_SEARCH_MEDIA_TYPE_VIDEO, - PROP_SEARCH_MEDIA_TYPE_DOCUMENT, - PROP_SEARCH_MEDIA_TYPE_IMAGE, - PROP_SEARCH_MEDIA_TYPE_ARCHIVE, - PROP_SEARCH_DISCARD_ALIEN_IP, - PROP_SEARCH_RESTART_WHEN_PENDING, - PROP_SEARCH_DISCARD_BANNED_GUID, - PROP_SEARCH_DISPLAY_GUESS_STATS, - PROP_GUESS_STATS_SHOW_TOTAL, - PROP_FILEINFO_NOTEBOOK_TAB, - PROP_MAIN_NOTEBOOK_TAB, - PROP_GNET_STATS_NOTEBOOK_TAB, - PROP_DOWNLOADS_INFO_NOTEBOOK_TAB, - GUI_PROPERTY_END + PROP_MONITOR_ENABLED=1000, + PROP_MONITOR_MAX_ITEMS, + PROP_SEARCH_HIDE_DOWNLOADED, + PROP_NODES_COL_WIDTHS, + PROP_NODES_COL_VISIBLE, + PROP_FILE_INFO_COL_WIDTHS, + PROP_FILE_INFO_COL_VISIBLE, + PROP_SOURCES_COL_WIDTHS, + PROP_SEARCH_LIST_COL_WIDTHS, + PROP_SEARCH_RESULTS_COL_VISIBLE, + PROP_SEARCH_RESULTS_COL_WIDTHS, + PROP_SEARCH_STATS_COL_WIDTHS, + PROP_UL_STATS_COL_WIDTHS, + PROP_UL_STATS_COL_VISIBLE, + PROP_UPLOADS_COL_WIDTHS, + PROP_UPLOADS_COL_VISIBLE, + PROP_FILTER_RULES_COL_WIDTHS, + PROP_FILTER_FILTERS_COL_WIDTHS, + PROP_GNET_STATS_MSG_COL_WIDTHS, + PROP_GNET_STATS_FC_TTL_COL_WIDTHS, + PROP_GNET_STATS_FC_HOPS_COL_WIDTHS, + PROP_GNET_STATS_FC_COL_WIDTHS, + PROP_GNET_STATS_HORIZON_COL_WIDTHS, + PROP_GNET_STATS_DROP_REASONS_COL_WIDTHS, + PROP_GNET_STATS_RECV_COL_WIDTHS, + PROP_HCACHE_COL_WIDTHS, + PROP_WINDOW_COORDS, + PROP_FILTER_DLG_COORDS, + PROP_PREFS_DLG_COORDS, + PROP_FILEINFO_DIVIDER_POS, + PROP_MAIN_DIVIDER_POS, + PROP_GNET_STATS_DIVIDER_POS, + PROP_RESULTS_DIVIDER_POS, + PROP_GUI_DEBUG, + PROP_FILTER_MAIN_DIVIDER_POS, + PROP_SEARCH_RESULTS_SHOW_TABS, + PROP_SEARCHBAR_VISIBLE, + PROP_SIDEBAR_VISIBLE, + PROP_MENUBAR_VISIBLE, + PROP_STATUSBAR_VISIBLE, + PROP_PROGRESSBAR_UPLOADS_VISIBLE, + PROP_PROGRESSBAR_DOWNLOADS_VISIBLE, + PROP_PROGRESSBAR_CONNECTIONS_VISIBLE, + PROP_PROGRESSBAR_BWS_IN_VISIBLE, + PROP_PROGRESSBAR_BWS_OUT_VISIBLE, + PROP_PROGRESSBAR_BWS_GIN_VISIBLE, + PROP_PROGRESSBAR_BWS_GOUT_VISIBLE, + PROP_PROGRESSBAR_BWS_GLIN_VISIBLE, + PROP_PROGRESSBAR_BWS_GLOUT_VISIBLE, + PROP_AUTOHIDE_BWS_GLEAF, + PROP_PROGRESSBAR_BWS_IN_AVG, + PROP_PROGRESSBAR_BWS_OUT_AVG, + PROP_PROGRESSBAR_BWS_GIN_AVG, + PROP_PROGRESSBAR_BWS_GOUT_AVG, + PROP_PROGRESSBAR_BWS_GLIN_AVG, + PROP_PROGRESSBAR_BWS_GLOUT_AVG, + PROP_SEARCH_SORT_CASESENSE, + PROP_SEARCH_SORT_DEFAULT_ORDER, + PROP_SEARCH_SORT_DEFAULT_COLUMN, + PROP_SEARCH_DISCARD_SPAM, + PROP_SEARCH_DISCARD_HASHLESS, + PROP_SEARCH_JUMP_TO_CREATED, + PROP_SEARCH_STATS_MODE, + PROP_SEARCH_STATS_UPDATE_INTERVAL, + PROP_SEARCH_STATS_DELCOEF, + PROP_CONFIRM_QUIT, + PROP_SHOW_TOOLTIPS, + PROP_EXPERT_MODE, + PROP_GNET_STATS_PERC,
View file
gtk-gnutella-1.2.0.tar.xz/src/if/gui_property_priv.h -> gtk-gnutella-1.2.2.tar.xz/src/if/gui_property_priv.h
Changed
@@ -34,7 +34,7 @@ #ifdef GUI_SOURCES -#define GUI_PROPERTY(name) (gui_property_variable_ ## name) +#define GUI_PROPERTY(name) (gui_property_variable_ ## name) #define GUI_PROPERTY_PTR(name) (&gui_property_variable_ ## name) /* @@ -47,40 +47,40 @@ extern const gboolean gui_property_variable_monitor_enabled; -extern const guint32 gui_property_variable_monitor_max_items; +extern const guint32 gui_property_variable_monitor_max_items; extern const gboolean gui_property_variable_search_hide_downloaded; -extern const guint32 gui_property_variable_nodes_col_widthsNODES_VISIBLE_COLUMNS; +extern const guint32 gui_property_variable_nodes_col_widthsNODES_VISIBLE_COLUMNS; extern const gboolean gui_property_variable_nodes_col_visibleNODES_VISIBLE_COLUMNS; -extern const guint32 gui_property_variable_file_info_col_widthsFILEINFO_VISIBLE_COLUMNS; +extern const guint32 gui_property_variable_file_info_col_widthsFILEINFO_VISIBLE_COLUMNS; extern const gboolean gui_property_variable_file_info_col_visibleFILEINFO_VISIBLE_COLUMNS; -extern const guint32 gui_property_variable_sources_col_widthsSOURCES_VISIBLE_COLUMNS; -extern const guint32 gui_property_variable_search_list_col_widthsSEARCH_LIST_VISIBLE_COLUMNS; +extern const guint32 gui_property_variable_sources_col_widthsSOURCES_VISIBLE_COLUMNS; +extern const guint32 gui_property_variable_search_list_col_widthsSEARCH_LIST_VISIBLE_COLUMNS; extern const gboolean gui_property_variable_search_results_col_visibleSEARCH_RESULTS_VISIBLE_COLUMNS; -extern const guint32 gui_property_variable_search_results_col_widthsSEARCH_RESULTS_VISIBLE_COLUMNS; -extern const guint32 gui_property_variable_search_stats_col_widths3; -extern const guint32 gui_property_variable_ul_stats_col_widthsUPLOAD_STATS_GUI_VISIBLE_COLUMNS; +extern const guint32 gui_property_variable_search_results_col_widthsSEARCH_RESULTS_VISIBLE_COLUMNS; +extern const guint32 gui_property_variable_search_stats_col_widths3; +extern const guint32 gui_property_variable_ul_stats_col_widthsUPLOAD_STATS_GUI_VISIBLE_COLUMNS; extern const gboolean gui_property_variable_ul_stats_col_visibleUPLOAD_STATS_GUI_VISIBLE_COLUMNS; -extern const guint32 gui_property_variable_uploads_col_widthsUPLOADS_GUI_VISIBLE_COLUMNS; +extern const guint32 gui_property_variable_uploads_col_widthsUPLOADS_GUI_VISIBLE_COLUMNS; extern const gboolean gui_property_variable_uploads_col_visibleUPLOADS_GUI_VISIBLE_COLUMNS; -extern const guint32 gui_property_variable_filter_rules_col_widths4; -extern const guint32 gui_property_variable_filter_filters_col_widths3; -extern const guint32 gui_property_variable_gnet_stats_msg_col_widths8; -extern const guint32 gui_property_variable_gnet_stats_fc_ttl_col_widths10; -extern const guint32 gui_property_variable_gnet_stats_fc_hops_col_widths10; -extern const guint32 gui_property_variable_gnet_stats_fc_col_widths10; -extern const guint32 gui_property_variable_gnet_stats_horizon_col_widths4; -extern const guint32 gui_property_variable_gnet_stats_drop_reasons_col_widths2; -extern const guint32 gui_property_variable_gnet_stats_recv_col_widths10; -extern const guint32 gui_property_variable_hcache_col_widths4; -extern const guint32 gui_property_variable_window_coords4; -extern const guint32 gui_property_variable_filter_dlg_coords4; -extern const guint32 gui_property_variable_prefs_dlg_coords4; -extern const guint32 gui_property_variable_fileinfo_divider_pos; -extern const guint32 gui_property_variable_main_divider_pos; -extern const guint32 gui_property_variable_gnet_stats_divider_pos; -extern const guint32 gui_property_variable_results_divider_pos; -extern const guint32 gui_property_variable_gui_debug; -extern const guint32 gui_property_variable_filter_main_divider_pos; +extern const guint32 gui_property_variable_filter_rules_col_widths4; +extern const guint32 gui_property_variable_filter_filters_col_widths3; +extern const guint32 gui_property_variable_gnet_stats_msg_col_widths8; +extern const guint32 gui_property_variable_gnet_stats_fc_ttl_col_widths10; +extern const guint32 gui_property_variable_gnet_stats_fc_hops_col_widths10; +extern const guint32 gui_property_variable_gnet_stats_fc_col_widths10; +extern const guint32 gui_property_variable_gnet_stats_horizon_col_widths4; +extern const guint32 gui_property_variable_gnet_stats_drop_reasons_col_widths2; +extern const guint32 gui_property_variable_gnet_stats_recv_col_widths10; +extern const guint32 gui_property_variable_hcache_col_widths4; +extern const guint32 gui_property_variable_window_coords4; +extern const guint32 gui_property_variable_filter_dlg_coords4; +extern const guint32 gui_property_variable_prefs_dlg_coords4; +extern const guint32 gui_property_variable_fileinfo_divider_pos; +extern const guint32 gui_property_variable_main_divider_pos; +extern const guint32 gui_property_variable_gnet_stats_divider_pos; +extern const guint32 gui_property_variable_results_divider_pos; +extern const guint32 gui_property_variable_gui_debug; +extern const guint32 gui_property_variable_filter_main_divider_pos; extern const gboolean gui_property_variable_search_results_show_tabs; extern const gboolean gui_property_variable_searchbar_visible; extern const gboolean gui_property_variable_sidebar_visible; @@ -103,25 +103,25 @@ extern const gboolean gui_property_variable_progressbar_bws_glin_avg; extern const gboolean gui_property_variable_progressbar_bws_glout_avg; extern const gboolean gui_property_variable_search_sort_casesense; -extern const guint32 gui_property_variable_search_sort_default_order; -extern const guint32 gui_property_variable_search_sort_default_column; +extern const guint32 gui_property_variable_search_sort_default_order; +extern const guint32 gui_property_variable_search_sort_default_column; extern const gboolean gui_property_variable_search_discard_spam; extern const gboolean gui_property_variable_search_discard_hashless; extern const gboolean gui_property_variable_search_jump_to_created; -extern const guint32 gui_property_variable_search_stats_mode; -extern const guint32 gui_property_variable_search_stats_update_interval; -extern const guint32 gui_property_variable_search_stats_delcoef; +extern const guint32 gui_property_variable_search_stats_mode; +extern const guint32 gui_property_variable_search_stats_update_interval; +extern const guint32 gui_property_variable_search_stats_delcoef; extern const gboolean gui_property_variable_confirm_quit; extern const gboolean gui_property_variable_show_tooltips; extern const gboolean gui_property_variable_expert_mode; extern const gboolean gui_property_variable_gnet_stats_perc; extern const gboolean gui_property_variable_gnet_stats_bytes; extern const gboolean gui_property_variable_gnet_stats_hops; -extern const guint32 gui_property_variable_gnet_stats_source; -extern const guint32 gui_property_variable_gnet_stats_drop_reasons_type; +extern const guint32 gui_property_variable_gnet_stats_source; +extern const guint32 gui_property_variable_gnet_stats_drop_reasons_type; extern const gboolean gui_property_variable_gnet_stats_with_headers; extern const gboolean gui_property_variable_gnet_stats_drop_perc; -extern const guint32 gui_property_variable_gnet_stats_general_col_widths2; +extern const guint32 gui_property_variable_gnet_stats_general_col_widths2; extern const gboolean gui_property_variable_clear_uploads_complete; extern const gboolean gui_property_variable_clear_uploads_failed; extern const gboolean gui_property_variable_node_show_uptime; @@ -146,12 +146,12 @@ extern const gboolean gui_property_variable_show_gnet_info_rt; extern const gboolean gui_property_variable_show_gnet_info_shared_size; extern const gboolean gui_property_variable_show_gnet_info_shared_files; -extern const guint32 gui_property_variable_search_accumulation_period; -extern const guint32 gui_property_variable_treemenu_nodes_expandednb_main_page_num; -extern const guint32 gui_property_variable_gnet_stats_pkg_col_widths6; -extern const guint32 gui_property_variable_gnet_stats_byte_col_widths6; -extern const guint32 gui_property_variable_config_toolbar_style; -extern const guint32 gui_property_variable_search_lifetime; +extern const guint32 gui_property_variable_search_accumulation_period; +extern const guint32 gui_property_variable_treemenu_nodes_expandednb_main_page_num; +extern const guint32 gui_property_variable_gnet_stats_pkg_col_widths6; +extern const guint32 gui_property_variable_gnet_stats_byte_col_widths6; +extern const guint32 gui_property_variable_config_toolbar_style; +extern const guint32 gui_property_variable_search_lifetime; extern const gboolean gui_property_variable_status_icon_enabled; extern const gboolean gui_property_variable_autohide_bws_dht; extern const gboolean gui_property_variable_progressbar_bws_dht_in_visible; @@ -168,10 +168,10 @@ extern const gboolean gui_property_variable_search_discard_banned_guid; extern const gboolean gui_property_variable_search_display_guess_stats; extern const gboolean gui_property_variable_guess_stats_show_total; -extern const guint32 gui_property_variable_fileinfo_notebook_tab; -extern const guint32 gui_property_variable_main_notebook_tab; -extern const guint32 gui_property_variable_gnet_stats_notebook_tab; -extern const guint32 gui_property_variable_downloads_info_notebook_tab; +extern const guint32 gui_property_variable_fileinfo_notebook_tab; +extern const guint32 gui_property_variable_main_notebook_tab; +extern const guint32 gui_property_variable_gnet_stats_notebook_tab; +extern const guint32 gui_property_variable_downloads_info_notebook_tab; prop_set_t *gui_prop_init(void);
View file
gtk-gnutella-1.2.0.tar.xz/src/if/props.tpl -> gtk-gnutella-1.2.2.tar.xz/src/if/props.tpl
Changed
@@ -44,24 +44,24 @@ (define prop-array (sprintf "%s->props" (. prop-set))) (define prop-offset (get "offset")) (define (type_ok? type) - (cond - ((= type "boolean") #t) - ((= type "guint32") #t) - ((= type "guint64") #t) - ((= type "ip") #t) - ((= type "string") #t) - ((= type "storage") #t) - ((= type "timestamp") #t) - ((= type "multichoice") #t) - (else #f))) + (cond + ((= type "boolean") #t) + ((= type "guint32") #t) + ((= type "guint64") #t) + ((= type "ip") #t) + ((= type "string") #t) + ((= type "storage") #t) + ((= type "timestamp") #t) + ((= type "multichoice") #t) + (else #f))) (define func-prefix (if (exist? "func_prefix") (get "func_prefix") (. prop-set))) == IF (not (exist? "property_set"))== - (error "property set has no name")== + (error "property set has no name")== ENDIF== IF (not (exist? "offset"))== - (error "no offset for property numbering given")== + (error "no offset for property numbering given")== ENDIF= Generating files: = (sprintf "%s.h" (. set-name-down)) = @@ -84,11 +84,11 @@ #define =(. prop-num)= (=(. prop-end)=-=offset=) typedef enum {= - FOR prop = - PROP_=(string-upcase (get "name"))== - IF (= (for-index) 0)===(. prop-offset)==ENDIF=,= - ENDFOR prop = - =(. prop-end)= + FOR prop = + PROP_=(string-upcase (get "name"))== + IF (= (for-index) 0)===(. prop-offset)==ENDIF=,= + ENDFOR prop = + =(. prop-end)= } = (. set-name-down) =_t; /* @@ -122,9 +122,9 @@ * Property-change listeners */ void =(. func-prefix)=_add_prop_changed_listener( - property_t, prop_changed_listener_t, gboolean); + property_t, prop_changed_listener_t, gboolean); void =(. func-prefix)=_remove_prop_changed_listener( - property_t, prop_changed_listener_t); + property_t, prop_changed_listener_t); /* * get/set functions @@ -132,9 +132,9 @@ * The *_val macros are shortcuts for single scalar properties. */ void =(. func-prefix)=_set_boolean( - property_t, const gboolean *, size_t, size_t); + property_t, const gboolean *, size_t, size_t); gboolean *=(. func-prefix)=_get_boolean( - property_t, gboolean *, size_t, size_t); + property_t, gboolean *, size_t, size_t); static inline void =(. func-prefix)=_set_boolean_val(property_t p, gboolean value) @@ -154,9 +154,9 @@ char *=(. func-prefix)=_get_string(property_t, char *, size_t); void =(. func-prefix)=_set_guint32( - property_t, const guint32 *, size_t, size_t); + property_t, const guint32 *, size_t, size_t); guint32 *=(. func-prefix)=_get_guint32( - property_t, guint32 *, size_t, size_t); + property_t, guint32 *, size_t, size_t); void =(. func-prefix)=_reset(property_t); @@ -207,9 +207,9 @@ } void =(. func-prefix)=_set_guint64( - property_t, const guint64 *, size_t, size_t); + property_t, const guint64 *, size_t, size_t); guint64 *=(. func-prefix)=_get_guint64( - property_t, guint64 *, size_t, size_t); + property_t, guint64 *, size_t, size_t); static inline void =(. func-prefix)=_set_guint64_val(property_t p, guint64 value) @@ -224,9 +224,9 @@ } void =(. func-prefix)=_set_timestamp( - property_t, const time_t *, size_t, size_t); + property_t, const time_t *, size_t, size_t); time_t *=(. func-prefix)=_get_timestamp( - property_t, time_t *, size_t, size_t); + property_t, time_t *, size_t, size_t); static inline void =(. func-prefix)=_set_timestamp_val(property_t p, time_t value) @@ -241,9 +241,9 @@ } void =(. func-prefix)=_set_ip( - property_t, const host_addr_t *, size_t, size_t); + property_t, const host_addr_t *, size_t, size_t); host_addr_t *=(. func-prefix)=_get_ip( - property_t, host_addr_t *, size_t, size_t); + property_t, host_addr_t *, size_t, size_t); static inline void =(. func-prefix)=_set_ip_val(property_t p, host_addr_t value) @@ -277,7 +277,7 @@ #ifdef =(. private-src)= -#define =(. set-name-up)=(name) (=(. set-name-down)=_variable_ ## name) +#define =(. set-name-up)=(name) (=(. set-name-down)=_variable_ ## name) #define =(. set-name-up)=_PTR(name) (&=(. set-name-down)=_variable_ ## name) /* @@ -294,12 +294,12 @@ == CASE type== = boolean=extern const gboolean =(. item)== -= guint32=extern const guint32 =(. item)== -= guint64=extern const guint64 =(. item)== -= ip =extern const host_addr_t =(. item)== -= multichoice=extern const guint32 =(. item)== += guint32=extern const guint32 =(. item)== += guint64=extern const guint64 =(. item)== += ip =extern const host_addr_t =(. item)== += multichoice=extern const guint32 =(. item)== = string =extern const char *=(. item)== -= storage=extern const char =(. item)== += storage=extern const char =(. item)== = timestamp=extern const time_t =(. item)== ESAC == IF (exist? "vector_size") ==vector_size==ENDIF=; @@ -319,7 +319,7 @@ = = IF (= (get "property_set") "gui_property") = -= (sprintf "#ifndef USE_TOPLESS") = += (sprintf "#ifndef USE_TOPLESS") = = ENDIF = #include "lib/prop.h" @@ -353,232 +353,232 @@ (. set-name-down) (if (exist? "data.value") (get "data.value") (string-downcase (get "name")))))== - IF (= (get "type") "storage")= + IF (= (get "type") "storage")= char =(. item)==vector_size=; -static const char =(. item)=_default=vector_size=; +static const char =(. item)=_default=vector_size=; = - ELIF (= (get "type") "ip")= -host_addr_t =(. item)=;= - ELSE== + ELIF (= (get "type") "ip")= +host_addr_t =(. item)=;= + ELSE== (define vtype (cond - ((= (get "type") "boolean") "gboolean ") - ((= (get "type") "guint32") "guint32 ") - ((= (get "type") "guint64") "guint64 ") - ((= (get "type") "multichoice") "guint32 ") - ((= (get "type") "timestamp") "time_t ") - ((= (get "type") "ip") "host_addr_t ") - ((= (get "type") "string") "char *") + ((= (get "type") "boolean") "gboolean ") + ((= (get "type") "guint32") "guint32 ") + ((= (get "type") "guint64") "guint64 ") + ((= (get "type") "multichoice") "guint32 ") + ((= (get "type") "timestamp") "time_t ") + ((= (get "type") "ip") "host_addr_t ") + ((= (get "type") "string") "char *") ) ) (define vdef (cond - ((= (get "type") "boolean") (get "data.default")) - ((= (get "type") "guint32") (get "data.default")) - ((= (get "type") "guint64") (get "data.default"))
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/Jmakefile -> gtk-gnutella-1.2.2.tar.xz/src/lib/Jmakefile
Changed
@@ -165,6 +165,7 @@ http_range.c \ idtable.c \ inputevt.c \ + iovec.c \ iprange.c \ ipset.c \ iso3166.c \ @@ -360,6 +361,7 @@ NormalTestTarget(random) NormalTestTarget(sort) NormalTestTarget(spopen) +NormalTestTarget(stack) NormalTestTarget(stat) NormalTestTarget(thread)
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/Makefile.SH -> gtk-gnutella-1.2.2.tar.xz/src/lib/Makefile.SH
Changed
@@ -1,5 +1,5 @@ -: Makefile.SH generated from Jmake.tmpl and Jmakefile jmake 3.5-255 -: $X-Id$ +: Makefile.SH generated from Jmake.tmpl and Jmakefile jmake 3.5-36 +: $X-Id: Jmake.tmpl 183 2015-04-12 09:48:11Z rmanfredi $ case $CONFIG in '') @@ -57,12 +57,12 @@ # Automatically generated parameters -- do not edit USRINC = $usrinc -COMMON_LIBS = $libs -GLIB_CFLAGS = $glibcflags +SOURCES = \$(LSRC) filelock-test.c float-test.c ftw-test.c launch-test.c pattern-test.c random-test.c sort-test.c spopen-test.c stack-test.c stat-test.c thread-test.c GLIB_LDFLAGS = $glibldflags -SOURCES = \$(LSRC) filelock-test.c float-test.c ftw-test.c launch-test.c pattern-test.c random-test.c sort-test.c spopen-test.c stat-test.c thread-test.c -OBJECTS = \$(LOBJ) filelock-test.o float-test.o ftw-test.o launch-test.o pattern-test.o random-test.o sort-test.o spopen-test.o stat-test.o thread-test.o +COMMON_LIBS = $libs +OBJECTS = \$(LOBJ) filelock-test.o float-test.o ftw-test.o launch-test.o pattern-test.o random-test.o sort-test.o spopen-test.o stack-test.o stat-test.o thread-test.o DBUS_CFLAGS = $dbuscflags +GLIB_CFLAGS = $glibcflags ######################################################################## # New suffixes and associated building rules -- edit with care @@ -75,7 +75,7 @@ $spitshell >>Makefile <<'!NO!SUBS!' ######################################################################## # Jmake rules for building libraries, programs, scripts, and data files -# $X-Id$ +# $X-Id: Jmake.rules 195 2015-04-27 21:30:17Z rmanfredi $ ######################################################################## # Force 'make depend' to be performed first -- do not edit @@ -237,6 +237,7 @@ http_range.c \ idtable.c \ inputevt.c \ + iovec.c \ iprange.c \ ipset.c \ iso3166.c \ @@ -444,6 +445,7 @@ http_range.o \ idtable.o \ inputevt.o \ + iovec.o \ iprange.o \ ipset.o \ iso3166.o \ @@ -720,6 +722,17 @@ $(MV) $@$(_EXE) $@~$(_EXE); fi $(CC) -o $@$(_EXE) spopen-test.o $(JLDFLAGS) libshared.a $(LIBS) +all:: stack-test + +local_realclean:: + $(RM) stack-test$(_EXE) + +stack-test: stack-test.o libshared.a + -$(RM) $@$(_EXE) + if test -f $@$(_EXE); then \ + $(MV) $@$(_EXE) $@~$(_EXE); fi + $(CC) -o $@$(_EXE) stack-test.o $(JLDFLAGS) libshared.a $(LIBS) + all:: stat-test local_realclean::
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/aging.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/aging.c
Changed
@@ -226,11 +226,18 @@ if (ag) { aging_check(ag); + /* + * Need to do this before calling aging_synchronize() in case + * tha callout queue is in a concurrent thread and is about to + * invoke the periodic callback! + */ + + cq_periodic_remove(&ag->gc_ev); + aging_synchronize(ag); hikset_foreach(ag->table, aging_free, ag); hikset_free_null(&ag->table); - cq_periodic_remove(&ag->gc_ev); if (ag->lock != NULL) { mutex_destroy(ag->lock);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/array_util.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/array_util.h
Changed
@@ -49,6 +49,16 @@ #define _array_util_h_ /** + * Copy array `src' into array `dest'. + */ +#define ARRAY_COPY(dest, src) G_STMT_START { \ + g_assert_log(sizeof(dest) == sizeof(src), \ + "%s(): size mismatch: dest=%zu, src=%zu", \ + G_STRFUNC, sizeof(dest), sizeof(src)); \ + memcpy((dest), (src), sizeof(src)); \ +} G_STMT_END + +/** * Remove item 'i' from an array of 'n' items (before removal). * * When the removed item is not the last one in the array, all subsequent
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/ascii.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/ascii.c
Changed
@@ -47,7 +47,7 @@ * so that we can write more efficicient is_ascii_*() routines. */ const uint16 -ascii_ctype = +ascii_ctype256 = { /* 0 */ A_CTRL, /* 1 */ A_CTRL, @@ -189,7 +189,7 @@ { int c; - STATIC_ASSERT(128 == N_ITEMS(ascii_ctype)); + STATIC_ASSERT(256 == N_ITEMS(ascii_ctype)); if (dst != src) do {
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/ascii.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/ascii.h
Changed
@@ -97,8 +97,8 @@ /** * ctype-like functions that allow only ASCII characters whereas the locale - * would allow others. The parameter doesn't have to be casted to (unsigned - * char) because these functions return false for everything out of 0..127. + * would allow others. The parameter doesn't have to be cast to (unsigned + * char) because these functions return FALSE for everything out of 0..127. * * GLib 2.x has similar macros/functions but defines only a subset. */ @@ -106,92 +106,96 @@ static inline G_CONST WARN_UNUSED_RESULT bool is_ascii_blank(int c) { - return !(c & ~0x7f) && 0 != (A_BLANK & ascii_ctypec); + return ((uint) c < 0x80) & (0 != (A_BLANK & ascii_ctype(uint8) c)); } static inline G_CONST WARN_UNUSED_RESULT bool is_ascii_cntrl(int c) { - return !(c & ~0x7f) && 0 != (A_CTRL & ascii_ctypec); + return ((uint) c < 0x80) & (0 != (A_CTRL & ascii_ctype(uint8) c)); } static inline G_CONST WARN_UNUSED_RESULT bool is_ascii_digit(int c) { - return !(c & ~0x7f) && 0 != (A_DIGIT & ascii_ctypec); + return ((uint) c < 0x80) & (0 != (A_DIGIT & ascii_ctype(uint8) c)); } static inline G_CONST WARN_UNUSED_RESULT bool is_ascii_xdigit(int c) { - return !(c & ~0x7f) && 0 != (A_HEXA & ascii_ctypec); + return ((uint) c < 0x80) & (0 != (A_HEXA & ascii_ctype(uint8) c)); } static inline G_CONST WARN_UNUSED_RESULT bool is_ascii_upper(int c) { - return !(c & ~0x7f) && 0 != (A_UPPER & ascii_ctypec); + /* Using && here helps ascii_tolower() be faster */ + return ((uint) c < 0x80) && (0 != (A_UPPER & ascii_ctype(uint8) c)); } static inline G_CONST WARN_UNUSED_RESULT bool is_ascii_lower(int c) { - return !(c & ~0x7f) && 0 != (A_LOWER & ascii_ctypec); + /* Using && here helps ascii_toupper() be faster */ + return ((uint) c < 0x80) && (0 != (A_LOWER & ascii_ctype(uint8) c)); } static inline G_CONST WARN_UNUSED_RESULT bool is_ascii_alpha(int c) { - return !(c & ~0x7f) && 0 != ((A_UPPER | A_LOWER) & ascii_ctypec); + return ((uint) c < 0x80) & + (0 != ((A_UPPER | A_LOWER) & ascii_ctype(uint8) c)); } static inline G_CONST WARN_UNUSED_RESULT bool is_ascii_alnum(int c) { - return !(c & ~0x7f) && 0 != ((A_DIGIT | A_UPPER | A_LOWER) & ascii_ctypec); + return ((uint) c < 0x80) & + (0 != ((A_DIGIT | A_UPPER | A_LOWER) & ascii_ctype(uint8) c)); } static inline G_CONST WARN_UNUSED_RESULT bool is_ascii_ident(int c) { /* Part of an identifier, i,e, one of A-Za-z0-9_ */ - return !(c & ~0x7f) && 0 != (A_IDENT & ascii_ctypec); + return ((uint) c < 0x80) & (0 != (A_IDENT & ascii_ctype(uint8) c)); } static inline G_CONST WARN_UNUSED_RESULT bool is_ascii_space(int c) { - return !(c & ~0x7f) && 0 != (A_SPACE & ascii_ctypec); + return ((uint) c < 0x80) & (0 != (A_SPACE & ascii_ctype(uint8) c)); } static inline G_CONST WARN_UNUSED_RESULT bool is_ascii_graph(int c) { - return !(c & ~0x7f) && 0 != (A_GRAPH & ascii_ctypec); + return ((uint) c < 0x80) & (0 != (A_GRAPH & ascii_ctype(uint8) c)); } static inline G_CONST WARN_UNUSED_RESULT bool is_ascii_print(int c) { - return !(c & ~0x7f) && 0 != (A_PRINT & ascii_ctypec); + return ((uint) c < 0x80) & (0 != (A_PRINT & ascii_ctype(uint8) c)); } static inline G_CONST WARN_UNUSED_RESULT bool is_ascii_punct(int c) { - return !(c & ~0x7f) && 0 != (A_PUNCT & ascii_ctypec); + return ((uint) c < 0x80) & (0 != (A_PUNCT & ascii_ctype(uint8) c)); } static inline G_CONST WARN_UNUSED_RESULT int ascii_toupper(int c) { - return is_ascii_lower(c) ? c - 32 : c; + return c - (is_ascii_lower(c) << 5); } static inline G_CONST WARN_UNUSED_RESULT int ascii_tolower(int c) { - return is_ascii_upper(c) ? c + 32 : c; + return c + (is_ascii_upper(c) << 5); } /**
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/bfd_util.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/bfd_util.c
Changed
@@ -618,6 +618,15 @@ } /** + * Wrapper over bfd_init() since it does not return "void" in newer versions. + */ +static void +bfd_util_init_once(void) +{ + (void) bfd_init(); +} + +/** * Initialze a BFD symbol lookup environment context. * * @return new context that will need to be closed with bfd_util_close_null(). @@ -632,7 +641,7 @@ be->magic = BFD_ENV_MAGIC; mutex_init(&be->lock); - ONCE_FLAG_RUN(done, bfd_init); + ONCE_FLAG_RUN(done, bfd_util_init_once); return be; }
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/bit_array.ht -> gtk-gnutella-1.2.2.tar.xz/src/lib/bit_array.ht
Changed
@@ -40,6 +40,8 @@ #include "common.h" +#include "pow2.h" + /* * Functions for handling arrays of bits. On BSD systems, the macros from * <bitstring.h> could be used for better efficiency. @@ -50,6 +52,7 @@ typedef unsigned long bit_array_t; #if LONG_MAX == 0x7fffffffL +#define BIT_ARRAY_SETCOUNT(w) bits_set32(w) #if CHAR_BIT == 8 #define BIT_ARRAY_BITSHIFT (2 + 3) #elif CHAR_BIT == 16 @@ -58,6 +61,7 @@ #error "Unsupported size of char" #endif /* CHAR_BIT */ #elif (ULONG_MAX >> 31) > 0xffffffffUL +#define BIT_ARRAY_SETCOUNT(w) bits_set64(w) #if CHAR_BIT == 8 #define BIT_ARRAY_BITSHIFT (3 + 3) #elif CHAR_BIT == 16 @@ -69,6 +73,8 @@ #define BIT_ARRAY_BITSIZE (CHAR_BIT * sizeof(bit_array_t)) #define BIT_ARRAY_BITMASK (BIT_ARRAY_BITSIZE - 1) -#define BIT_ARRAY_WORD(base, i) base(i) >> BIT_ARRAY_BITSHIFT +#define BIT_ARRAY_IDX(i) ((i) >> BIT_ARRAY_BITSHIFT) +#define BIT_ARRAY_WORD(base, i) baseBIT_ARRAY_IDX(i) #define BIT_ARRAY_BIT(i) (1UL << ((i) & BIT_ARRAY_BITMASK)) +;# vi: set ts=4 sw=4 syn=c cindent:
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/bit_field.ht -> gtk-gnutella-1.2.2.tar.xz/src/lib/bit_field.ht
Changed
@@ -50,6 +50,8 @@ #include "common.h" +#include "pow2.h" + /* * Functions for handling arrays of bits. On BSD systems, the macros from * <bitstring.h> could be used for better efficiency. @@ -62,6 +64,9 @@ #define BIT_FIELD_BITSHIFT 3 #define BIT_FIELD_BITSIZE (8 * sizeof(bit_field_t)) #define BIT_FIELD_BITMASK (BIT_FIELD_BITSIZE - 1) -#define BIT_FIELD_WORD(base, i) base(i) >> BIT_FIELD_BITSHIFT +#define BIT_FIELD_IDX(i) ((i) >> BIT_FIELD_BITSHIFT) +#define BIT_FIELD_WORD(base, i) baseBIT_FIELD_IDX(i) #define BIT_FIELD_BIT(i) (1UL << ((i) & BIT_FIELD_BITMASK)) +#define BIT_FIELD_SETCOUNT(w) bits_set(w) +;# vi: set ts=4 sw=4 syn=c cindent:
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/bit_generic.ct -> gtk-gnutella-1.2.2.tar.xz/src/lib/bit_generic.ct
Changed
@@ -281,4 +281,70 @@ return (size_t) -1; } -/* vi: set ts=4 sw=4 cindent: */ +/** + * Peforms a linear scan of the bit <generic> to count set bits within given range. + * + * @param base The base address of the bit <generic> which must be initialized. + * @param from The first bit. + * @param to The last bit, must be equal to or above "from". + * + * @return the amount of set bits between from and to, inclusive. + */ +size_t +bit_generic_count_set(const bit_generic_t *base, size_t from, size_t to) +{ + size_t i, cnt = 0; + + g_assert(from <= to); + + for (i = from; i <= to; /* NOTHING */) { + /* Handle the first word if `i' is not 0 modulo the word size */ + + if (0 != (i & BIT_GENERIC_BITMASK)) { + bit_generic_t word = BIT_GENERIC_WORD(base, i); + bit_generic_t mask = BIT_GENERIC_BIT(i) - 1; + + word &= ~mask; /* Clear all bits before `i' in word */ + + if (BIT_GENERIC_IDX(i) == BIT_GENERIC_IDX(to)) { + mask = BIT_GENERIC_BIT(to) + (BIT_GENERIC_BIT(to) - 1); + word &= mask; /* Clear all bits above `to' in word */ + } + + cnt += BIT_GENERIC_SETCOUNT(word); + i += BIT_GENERIC_BITSIZE - (i & BIT_GENERIC_BITMASK); + + g_assert(0 == (i & BIT_GENERIC_BITMASK)); + } else { + size_t n = (to - i) >> BIT_GENERIC_BITSHIFT; + size_t j = BIT_GENERIC_IDX(i); + + /* Handle whole words between `i' and `to' */ + + while (n--) { + cnt += BIT_GENERIC_SETCOUNT(basej++); + i += BIT_GENERIC_BITSIZE; + } + + /* Handle trailing word where `to' lies */ + + g_assert(0 == (i & BIT_GENERIC_BITMASK)); + g_assert(implies(i <= to, to - i < BIT_GENERIC_BITSIZE)); + + if (i <= to) { + bit_generic_t word = BIT_GENERIC_WORD(base, i); + bit_generic_t mask = + BIT_GENERIC_BIT(to) + (BIT_GENERIC_BIT(to) - 1); + + g_assert(BIT_GENERIC_IDX(i) == BIT_GENERIC_IDX(to)); + + word &= mask; /* Clear all bits above `to' in word */ + cnt += BIT_GENERIC_SETCOUNT(word); + i += BIT_GENERIC_BITSIZE; + } + } + } + + return cnt; +} +/* vi: set ts=4 sw=4 syn=c cindent: */
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/bit_generic.ht -> gtk-gnutella-1.2.2.tar.xz/src/lib/bit_generic.ht
Changed
@@ -118,6 +118,8 @@ size_t bit_generic_first_clear(const bit_generic_t *base, size_t from, size_t to); size_t bit_generic_first_set(const bit_generic_t *base, size_t from, size_t to); size_t bit_generic_last_set(const bit_generic_t *base, size_t from, size_t to); +size_t bit_generic_count_set(const bit_generic_t *base, size_t from, size_t to); #endif /* _bit_generic_h_ */ -/* vi: set ts=4 sw=4 cindent: */ + +/* vi: set ts=4 sw=4 syn=c cindent: */
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/buf.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/buf.c
Changed
@@ -212,7 +212,7 @@ * with an associated free routine. */ - b = buf_new_embedded(size); + b = NOT_LEAKING(buf_new_embedded(size)); b->b_magic = BUF_MAGIC_PRIVATE; /* Prevents accidental free */ thread_private_add_extended(key, b, buf_private_reclaim, NULL);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/compat_setjmp.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/compat_setjmp.c
Changed
@@ -50,12 +50,27 @@ #include "compat_setjmp.h" +#include "alloca.h" /* For alloca_stack_direction() */ #include "log.h" #include "signal.h" #include "thread.h" #include "override.h" /* Must be the last header included */ +static void +setjmp_fill_ctx(struct compat_jmpbuf_ctx *x, + enum setjmp_magic magic, const void *sp, + const char *file, uint line, const char *routine) +{ + x->magic = magic; + x->stid = thread_small_id(); + x->sig_level = signal_thread_handler_level(x->stid); + x->sp = &sp; + x->routine = routine; + x->file = file; + x->line = line; +} + /** * Prepare for a setjmp(). * @@ -63,13 +78,12 @@ * The jmp_buf type here is not the system one but the one we redefine. */ void -setjmp_prep(jmp_buf env, const char *file, uint line) +setjmp_prep(jmp_buf env, + const char *file, uint line, const char *routine) { - env->stid = thread_small_id(); - env->sig_level = signal_thread_handler_level(env->stid); - env->magic = SETJMP_MAGIC; - env->file = file; - env->line = line; + int sp; + + setjmp_fill_ctx(&env->x, SETJMP_MAGIC, &sp, file, line, routine); } /** @@ -79,13 +93,13 @@ * The sigjmp_buf type here is not the system one but the one we redefine. */ void -sigsetjmp_prep(sigjmp_buf env, int savesigs, const char *file, uint line) +sigsetjmp_prep(sigjmp_buf env, + int savesigs, + const char *file, uint line, const char *routine) { - env->stid = thread_small_id(); - env->sig_level = signal_thread_handler_level(env->stid); - env->magic = SIGSETJMP_MAGIC; - env->file = file; - env->line = line; + int sp; + + setjmp_fill_ctx(&env->x, SIGSETJMP_MAGIC, &sp, file, line, routine); #ifndef HAS_SIGSETJMP env->mask_saved = booleanize(savesigs); @@ -102,6 +116,71 @@ #endif /* !HAS_SIGSETJMP */ } +static void +longjmp_validate(const char *caller, + const struct compat_jmpbuf_ctx *x, + enum setjmp_magic magic, const void *sp, uint stid, int val, + const char *file, uint line, const char *routine) +{ + if G_UNLIKELY(SETJMP_USED_MAGIC == x->magic) { + s_error( + "%s(): context was taken at %s:%u in %s() " + "and %slongjmp(%d) already called at %s:%u in %s() within %s", + caller, x->file, x->line, x->routine, + SIGSETJMP_MAGIC == magic ? "sig" : "", + x->used.arg, x->used.file, x->used.line, x->used.routine, + thread_safe_id_name(x->stid)); + } + + g_assert_log(magic == x->magic, + "%s(): magic=0x%x instead of 0x%x", caller, x->magic, magic); + + if G_UNLIKELY(x->stid != stid) { + s_error( + "%s(): x->stid=%u {%s}, stid=%u {%s}, context taken at %s:%u in %s()", + caller, x->stid, thread_safe_id_name(x->stid), + stid, thread_safe_id_name(stid), x->file, x->line, x->routine); + } + + /* + * See whether routine where (sig)setjmp() occurred has already returned. + * We must still be deeper in the call stack at the time of longjmp(), + * or the context is completely invalid. + * + * This is imperfect of couse, we could have grown the stack since we + * returned and not be able to detect the situation where the context is + * truly gone, but it will detect some blatant mistakes. + * + * We can't do this check when we are in a signal handler running on + * an alternate signal stack, sorry. + */ + + if G_UNLIKELY( + thread_stack_ptr_cmp(sp, x->sp) <= 0 && + !thread_on_altstack() + ) { + s_error( + "%s(): context, taken at %s:%u in %s(), already gone when " + "%slongjmp(%d) is called at %s:%u in %s() within %s " + "(SP was %p, now %p, stack growing %s)", + caller, x->file, x->line, x->routine, + SIGSETJMP_MAGIC == magic ? "sig" : "", + val, file, line, routine, thread_safe_id_name(x->stid), + x->sp, sp, alloca_stack_direction() < 0 ? "down" : "up"); + } +} + +static void +longjmp_flag_used(struct compat_jmpbuf_ctx *x, + int val, const char *file, uint line, const char *routine) +{ + x->magic = SETJMP_USED_MAGIC; + x->used.arg = val; + x->used.file = file; + x->used.line = line; + x->used.routine = routine; +} + /** * Wrapper for the longjmp() call to restore the signal handler level. * @@ -109,30 +188,19 @@ * The jmp_buf type here is not the system one but the one we redefine. */ void -compat_longjmp(jmp_buf env, int val, const char *file, uint line) +compat_longjmp(jmp_buf env, int val, + const char *file, uint line, const char *routine) { uint stid = thread_small_id(); - g_assert_log(env->magic != SETJMP_USED_MAGIC, - "context was taken at %s:%u and longjmp(%d) called at %s:%u in %s", - env->file, env->line, - env->used.arg, env->used.file, env->used.line, - thread_safe_id_name(env->stid)); - - g_assert_log(SETJMP_MAGIC == env->magic, "magic=0x%x", env->magic); g_assert(val != 0); - g_assert_log(env->stid == stid, - "%s(): env->stid=%u {%s}, stid=%u {%s}, context taken at %s:%u", - G_STRFUNC, env->stid, thread_safe_id_name(env->stid), - stid, thread_safe_id_name(stid), env->file, env->line); - - signal_thread_handler_level_set(stid, env->sig_level); + longjmp_validate(G_STRFUNC, + &env->x, SETJMP_MAGIC, &stid, stid, val, + file, line, routine); + longjmp_flag_used(&env->x, val, file, line, routine); - env->magic = SETJMP_USED_MAGIC; - env->used.arg = val; - env->used.file = file; - env->used.line = line; + signal_thread_handler_level_set(stid, env->x.sig_level); longjmp(env->buf, val); } @@ -144,35 +212,24 @@ * The sigjmp_buf type here is not the system one but the one we redefine. */ void -compat_siglongjmp(sigjmp_buf env, int val, const char *file, uint line) +compat_siglongjmp(sigjmp_buf env, int val, + const char *file, uint line, const char *routine) { uint stid = thread_small_id(); - g_assert_log(env->magic != SETJMP_USED_MAGIC, - "context was taken at %s:%u and longjmp(%d) called at %s:%u in %s", - env->file, env->line, - env->used.arg, env->used.file, env->used.line, - thread_safe_id_name(env->stid)); - - g_assert_log(SIGSETJMP_MAGIC == env->magic, "magic=0x%x", env->magic); g_assert(val != 0); - g_assert_log(env->stid == stid, - "%s(): env->stid=%u {%s}, stid=%u {%s}, context taken at %s:%u", - G_STRFUNC, env->stid, thread_safe_id_name(env->stid), - stid, thread_safe_id_name(stid), env->file, env->line);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/compat_setjmp.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/compat_setjmp.h
Changed
@@ -80,25 +80,31 @@ */ #ifndef SETJMP_SOURCE + +/* metaconfig symbols */ #undef Setjmp #undef Sigsetjmp +#undef Siglongjmp + +/* Possible libc macros */ #undef longjmp #undef siglongjmp -#undef Siglongjmp -#define Setjmp(e) (setjmp_prep((e), _WHERE_, __LINE__), setjmp((e)->buf)) +#define Setjmp(e) \ + (setjmp_prep((e), _WHERE_, __LINE__, G_STRFUNC), setjmp((e)->buf)) #ifdef HAS_SIGSETJMP #define Sigsetjmp(e,s) \ - (sigsetjmp_prep((e), (s), _WHERE_, __LINE__), sigsetjmp((e)->buf, (s))) + (sigsetjmp_prep((e), (s), _WHERE_, __LINE__, G_STRFUNC), \ + sigsetjmp((e)->buf, (s))) #else #define Sigsetjmp(e,s) \ - (sigsetjmp_prep((e), (s), _WHERE_, __LINE__), setjmp((e)->buf)) + (sigsetjmp_prep((e), (s), _WHERE_, __LINE__, G_STRFUNC), setjmp((e)->buf)) #endif -#define longjmp(e,v) compat_longjmp((e), (v), _WHERE_, __LINE__) -#define siglongjmp(e,v) compat_siglongjmp((e), (v), _WHERE_, __LINE__) -#define Siglongjmp(e,v) compat_siglongjmp((e), (v), _WHERE_, __LINE__) +#define longjmp(e,v) compat_longjmp((e), (v), _WHERE_, __LINE__, G_STRFUNC) +#define siglongjmp(e,v) compat_siglongjmp((e), (v), _WHERE_, __LINE__, G_STRFUNC) +#define Siglongjmp(e,v) compat_siglongjmp((e), (v), _WHERE_, __LINE__, G_STRFUNC) #endif /* SETJMP_SOURCE */ /* @@ -119,26 +125,30 @@ SETJMP_USED_MAGIC = 0x780be360 }; -#define JMPBUF_COMMON_ATTRIBUTES \ - sig_atomic_t sig_level; /**< Internal signal handler level */ \ - enum setjmp_magic magic; /**< Magic number */ \ - uint stid; /**< Thread which saved the context */ \ - uint line; /**< Line number where state was taken */ \ - const char *file; /**< File name where state was taken */ \ - struct { /**< To help debug multiple context usage */ \ - const char *file; /**< File name where state was used */ \ - uint line; /**< Line where state was used */ \ - int arg; /**< Argument passed to (sig)longjmp() */ \ +struct compat_jmpbuf_ctx { + sig_atomic_t sig_level; /**< Internal signal handler level */ + enum setjmp_magic magic; /**< Magic number */ + uint stid; /**< Thread which saved the context */ + uint line; /**< Line number where state was taken */ + const char *file; /**< Name of file where state was taken */ + const char *routine; /**< Name of routine where state was taken */ + void *sp; /**< Stack pointer at time of capture */ + struct { /**< To help debug multiple context usage */ + const char *routine; /**< Name of routine where state was used */ + const char *file; /**< File name where state was used */ + uint line; /**< Line where state was used */ + int arg; /**< Argument passed to (sig)longjmp() */ } used; +}; typedef struct compat_jmpbuf { native_jmp_buf buf; /**< CPU state, must be at the start */ - JMPBUF_COMMON_ATTRIBUTES + struct compat_jmpbuf_ctx x; /**< Our internal common context */ } jmp_buf1; typedef struct compat_sigjmpbuf { native_sigjmp_buf buf; /**< CPU state, must be at the start */ - JMPBUF_COMMON_ATTRIBUTES + struct compat_jmpbuf_ctx x; /**< Our internal common context */ #ifndef HAS_SIGSETJMP bool mask_saved; /**< Did we save the signal mask? */ sigset_t mask; /**< Signal mask saved */ @@ -149,11 +159,14 @@ * Public interface. */ -void setjmp_prep(jmp_buf env, const char *file, uint line); -void sigsetjmp_prep(sigjmp_buf env, int savesigs, const char *file, uint line); +void setjmp_prep(jmp_buf env, const char *file, uint line, const char *routine); +void sigsetjmp_prep(sigjmp_buf env, int savesigs, + const char *file, uint line, const char *routine); -void compat_longjmp(jmp_buf env, int val, const char *, uint) G_NORETURN; -void compat_siglongjmp(sigjmp_buf env, int val, const char *, uint) G_NORETURN; +void compat_longjmp(jmp_buf env, int val, const char *, uint, const char *) + G_NORETURN; +void compat_siglongjmp(sigjmp_buf env, int val, const char *, uint, const char *) + G_NORETURN; #endif /* _compat_setjmp_h_ */
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/cq.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/cq.c
Changed
@@ -74,6 +74,8 @@ CEVENT_EXT_MAGIC = 0x6a8fe830 }; +#define CEVENT_TRIGGERED ((cq_time_t) -1) /* Flags triggered events */ + /** * Callout queue event. */ @@ -131,6 +133,12 @@ return CEVENT_EXT_MAGIC == ce->ce_magic; } +static inline ALWAYS_INLINE bool +cevent_has_triggered(const cevent_t *ce) +{ + return CEVENT_TRIGGERED == ce->ce_time; +} + /** * @struct cqueue * @@ -402,6 +410,64 @@ return cq; } +static const char * +cq_to_string(const cqueue_t *cq) +{ + buf_t *b = buf_private(G_STRFUNC, 80); + + if G_UNLIKELY(NULL == cq) + return "NULL"; + + if (CQUEUE_MAGIC != cq->cq_magic && CSUBQUEUE_MAGIC != cq->cq_magic) { + buf_printf(b, "bad cq magic 0x%x", cq->cq_magic); + } else { + buf_printf(b, "c%sq \"%s\" at t=%s", + CSUBQUEUE_MAGIC == cq->cq_magic ? "sub" : "", + cq->cq_name, cq_time_to_string(cq->cq_time) + ); + } + + return buf_data(b); +} + +static const char * +ev_to_string_b(const cevent_t *ev, buf_t *b) +{ + if G_UNLIKELY(NULL == ev) + return "NULL"; + + if (CEVENT_MAGIC != ev->ce_magic && CEVENT_EXT_MAGIC != ev->ce_magic) { + buf_printf(b, "bad ev magic 0x%x", ev->ce_magic); + } else { + buf_printf(b, "%s(%p)", + stacktrace_function_name(ev->ce_fn), ev->ce_arg); + if (cevent_is_extended(ev)) { + const struct cevent_ext *evx = cast_to_cevent_ext(ev); + buf_catf(b, ", refcnt=%d", evx->cex_refcnt); + } + buf_catf(b, " scheduled at t=%s in %s", + CEVENT_TRIGGERED == ev->ce_time ? + "<now>" : cq_time_to_string(ev->ce_time), + cq_to_string(ev->ce_cq)); + } + + return buf_data(b); +} + +static const char * +ev_to_string(const cevent_t *ev) +{ + buf_t *b = buf_private(G_STRFUNC, 128); + return ev_to_string_b(ev, b); +} + +static const char * +ev_to_string2(const cevent_t *ev) +{ + buf_t *b = buf_private(G_STRFUNC, 128); + return ev_to_string_b(ev, b); +} + /** * Did the event trigger? */ @@ -422,17 +488,19 @@ if G_UNLIKELY(cevent_is_extended(ev)) { const struct cevent_ext *evx = cast_to_cevent_ext(ev); g_assert(evx->cex_refcnt <= 2); - return 1 == evx->cex_refcnt; + g_assert(equiv(1 == evx->cex_refcnt, cevent_has_triggered(ev))); + } else { + g_assert(!cevent_has_triggered(ev)); } - return FALSE; + return cevent_has_triggered(ev); } /** - * Free callout queue event. + * Free callout queue event, without checking whether it's part of the list. */ static void -ev_free(cevent_t *ev) +ev_forced_free(cevent_t *ev) { cevent_check(ev); @@ -452,6 +520,19 @@ } /** + * Free callout queue event. + */ +static void +ev_free(cevent_t *ev) +{ + cevent_check(ev); + /* Event must no longer be part of a callout queue list */ + g_assert(NULL == ev->ce_bnext && NULL == ev->ce_bprev); + + ev_forced_free(ev); +} + +/** * Link event into the callout queue. */ static void @@ -465,51 +546,41 @@ cevent_check(ev); cq = ev->ce_cq; + cqueue_check(cq); - g_assert(ev->ce_time > cq->cq_time || cq->cq_current); + g_assert(ev->ce_time >= cq->cq_time); + g_assert(NULL == ev->ce_bnext && NULL == ev->ce_bprev); assert_mutex_is_owned(&cq->cq_lock); trigger = ev->ce_time; cq->cq_items++; + ch = &cq->cq_hashEV_HASH(trigger); - /* - * Important corner case: we may be rescheduling an event BEFORE - * the current clock time, in which case we must insert the event - * in the current bucket, so it gets fired during the current - * cq_clock() run. - */ - - if (trigger <= cq->cq_time) - ch = cq->cq_current; - else - ch = &cq->cq_hashEV_HASH(trigger); - - g_assert(ch); + g_assert(ch != NULL); /* * If bucket is empty, the event is the new head. */ - if (ch->ch_head == NULL) { - g_assert(ch->ch_tail == NULL); + if (NULL == ch->ch_head) { + g_assert(NULL == ch->ch_tail); ch->ch_tail = ch->ch_head = ev; - ev->ce_bnext = ev->ce_bprev = NULL; + /* This is a precondition: ev->ce_bnext = ev->ce_bprev = NULL; */ return; } - g_assert(ch->ch_tail); - /* * If item is larger than the tail, insert at the end right away. */ hev = ch->ch_tail; - g_assert(hev->ce_bnext == NULL); + cevent_check(hev); + g_assert(NULL == hev->ce_bnext); if (trigger >= hev->ce_time) { hev->ce_bnext = ev; - ev->ce_bnext = NULL; + /* This is a precondition: ev->ce_bnext = NULL; */ ev->ce_bprev = hev; ch->ch_tail = ev; return; @@ -521,12 +592,13 @@ hev = ch->ch_head; - g_assert(hev->ce_bprev == NULL); + cevent_check(hev);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/crash.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/crash.c
Changed
@@ -111,6 +111,7 @@ #include "stacktrace.h" #include "str.h" #include "stringify.h" +#include "symbols.h" #include "thread.h" /* For thread_name(), et al. */ #include "timestamp.h" #include "tm.h" @@ -1361,6 +1362,7 @@ char lbufULONG_DEC_BUFLEN; char pbufULONG_DEC_BUFLEN; char u64bufUINT64_HEX_BUFLEN; + char rtbufULONG_DEC_BUFLEN; time_delta_t t; struct utsname u; long cpucount = getcpucount(); @@ -1539,7 +1541,6 @@ print_str("; parent still there"); /* 2 */ } } else if (t <= CRASH_MIN_ALIVE) { - char rtbufULONG_DEC_BUFLEN; print_str("; run time threshold of "); /* 2 */ print_str(PRINT_NUMBER(rtbuf, CRASH_MIN_ALIVE)); print_str("s not reached"); /* 4 */ @@ -1550,21 +1551,35 @@ } print_str("\n"); /* 5 */ { - enum stacktrace_sym_quality sq = stacktrace_quality(); - if (STACKTRACE_SYM_GOOD != sq) { - const char *quality = stacktrace_quality_string(sq); + enum symbol_quality sq = stacktrace_quality(); + + if (SYMBOL_Q_GOOD != sq) { + const char *quality = symbol_quality_string(sq); print_str("Stacktrace-Symbols: "); /* 6 */ print_str(quality); /* 7 */ print_str("\n"); /* 8 */ } } - print_str("Stacktrace:\n"); /* 9 */ flush_str(clf); crash_stack_print(clf, 3); rewind_str(0); - print_str("\n"); /* 0 -- End of Header */ + { + const struct symbol_load_info *uli = symbols_load_first(); + if (uli != NULL) { + print_str("Symbols-Loaded: from "); /* 0 */ + print_str(uli->path); /* 1 */ + print_str(" via "); /* 2 */ + print_str(uli->method); /* 3 */ + print_str("\n"); /* 4 */ + } else { + print_str("Symbols-Loaded: never"); /* 0 */ + print_str("\n"); /* 1 */ + } + + } + print_str("\n"); /* 5 -- End of Header */ flush_str(clf); } @@ -1930,9 +1945,8 @@ "gdb", "-q", "-n", "-p", pid_str, NULL_PTR); if (-1 == spfd) { - crash_logerr("spopen() failed", pid_str, + crash_logerr("spopenlp() failed", pid_str, STDERR_FILENO, clf, STDOUT_FILENO); - crash_stack_print_decorated(clf, 2, FALSE); } else { /* We'll wait for child and close the pipe ourselves */ pid = sppid(spfd, TRUE); @@ -3329,13 +3343,14 @@ } the_end: - if (!v->in_child) + if (!v->in_child && vars->may_restart) crash_auto_restart(); raise(SIGABRT); /* This is the end of our road */ g_assert_not_reached(); return NULL; /* Never used by caller! */ } + /** * The signal handler used to trap harmful signals. */
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/dbus_util.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/dbus_util.c
Changed
@@ -44,6 +44,7 @@ #include "hstrfn.h" /* For h_strdup() */ #include "log.h" #include "misc.h" /* For str_chomp() */ +#include "utf8.h" #include "override.h" /* Must be last header included */ @@ -121,6 +122,20 @@ if (NULL == bus) return; + /* + * We need to have a valid UTF-8 string or the D-Bus library can + * crash whilst attempting to decode the text. We don't attempt + * to "fix" bad UTF-8, we simply ignore it and loudly log it. + * --RAM, 2022-01-25 + */ + + if (!utf8_is_valid_string(text)) { + s_carp("%s(): invalid text (not valid UTF-8): cannot send signal %s %s", + G_STRFUNC, signal_name, text); + return; + } + + /* Create a new message on the DBUS_INTERFACE */ message = dbus_message_new_signal(DBUS_PATH, DBUS_INTERFACE, signal_name);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/eval.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/eval.c
Changed
@@ -39,6 +39,7 @@ #include "eval.h" #include "ascii.h" +#include "atoms.h" #include "constants.h" #include "cstr.h" #include "debug.h" @@ -47,7 +48,9 @@ #include "halloc.h" #include "hstrfn.h" #include "path.h" +#include "str.h" #include "unsigned.h" +#include "xmalloc.h" #include "override.h" /* Must be the last header included */ @@ -60,7 +63,7 @@ * of the character right after the variable name. */ static const char * -get_variable(const char *s, const char **end) +eval_get_variable(const char *s, const char **end) { const char *value, *p = s; bool end_brace = FALSE; @@ -75,9 +78,8 @@ end_brace = TRUE; } - while (is_ascii_alnum(*p) || *p == '_') { + while (is_ascii_ident(*p)) p++; - } if (end_brace && *p == '}') *end = &p1; @@ -107,37 +109,42 @@ } /** - * Insert value `val' at beginning of string `start'. - * - * The string `start' is held in a buffer capable of holding a string of - * `maxlen' bytes, and the string is currently `len' bytes long, with `start' - * being at the offset `off' within buffer. + * Perform leading ~ and $ENV variable substitutions on string. * - * @return the pointer right after the inserted value. + * @param s the string being edited inplace */ -static char * -insert_value(const char *val, char *start, size_t off, - size_t len, size_t maxlen) +static void +eval_substitute(str_t *s) { - size_t vlen = vstrlen(val); + size_t i; - g_assert(len <= maxlen); - g_assert(off <= len); + if (common_dbg > 3) + s_debug("%s(): on entry: \"%s\"", G_STRFUNC, str_2c(s)); - if (vlen > maxlen - len) { - g_warning("ignoring variable substitution text \"%s\"", val); - return start; - } + /* + * Handle standalone "~" or leading "~/". + */ + + if ('~' == str_at(s, 0) && (1 == str_len(s) || '/' == str_at(s, 1))) + str_replace(s, 0, 1, gethomedir()); - memmove(&startvlen, start, len + 1 - off); - memmove(start, val, vlen); + for (i = 0; i < str_len(s); i++) { + const char *val, *start, *after; - return &startvlen; + if ('$' != str_at(s, i)) + continue; + + start = str_2c_from(s, i + 1); + val = eval_get_variable(start, &after); + str_replace(s, i, after - start + 1, val); + i += vstrlen(val) - 1; + } + + if (common_dbg > 3) + s_debug("%s(): on exit: \"%s\"", G_STRFUNC, str_2c(s)); } /** - * Needs brief description here. - * * Substitutes variables from string: * * - The leading "~" is replaced by the home directory. @@ -146,81 +153,81 @@ * * If given a NULL input, we return NULL. * + * @param str string where variables must be substituted + * * @return string constant, which is not meant to be freed until exit time. */ const char * eval_subst(const char *str) { - char bufMAX_STRING; - char *end = &bufsizeof(buf); - char *p; - size_t len; - char c; + str_t *s; + const char *constant; - if (str == NULL) + if G_UNLIKELY(NULL == str) return NULL; - len = cstr_lcpy(ARYLEN(buf), str); - if (len >= sizeof buf) { - g_warning("%s(): string too large for substitution (%zu bytes)", - G_STRFUNC, len); - return constant_str(str); - } + s = str_new_from(str); + eval_substitute(s); + constant = constant_str(str_2c(s)); + str_destroy_null(&s); + return constant; +} - if (common_dbg > 3) - g_debug("%s: on entry: \"%s\"", G_STRFUNC, buf); - - for (p = buf, c = *p++; c; c = *p++) { - const char *val = NULL; - char *start = p - 1; - - switch (c) { - case '~': - if (start == buf && ('\0' == buf1 || '/' == buf1)) { - /* Leading ~ only */ - val = gethomedir(); - g_assert(val); - memmove(start, &start1, len - (start - buf)); - len--; - - g_assert(size_is_non_negative(len)); - } - break; - case '$': - { - const char *after; - - val = get_variable(p, &after); - g_assert(val); - memmove(start, after, len + 1 - (after - buf)); - len -= after - start; /* Also removing leading '$' */ - - g_assert(size_is_non_negative(len)); - } - break; - } - - if (val != NULL) { - char *next; - - next = insert_value(val, start, start - buf, len, sizeof buf - 1); - len += next - start; - p = next; - - g_assert(len < sizeof buf); - g_assert(p < end); - } - - g_assert(p <= &buflen); - } +/** + * Substitutes variables from string: + * + * - The leading "~" is replaced by the home directory. + * - Variables like "$PATH" or "${PATH}" are replaced by their value, as + * fetched from the environment, or the empty string if not found. + * + * If given a NULL input, we return NULL. + * + * @param str string where variables must be substituted + * + * @return new string that can be freed with xfree(). + */ +char * +eval_subst_x(const char *str)
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/eval.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/eval.h
Changed
@@ -41,6 +41,8 @@ */ const char *eval_subst(const char *str); +const char *eval_subst_atom(const char *str); +char *eval_subst_x(const char *str); #endif /* _eval_h_ */
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/evq.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/evq.c
Changed
@@ -331,6 +331,8 @@ evq_close(void) { atomic_bool_set(&evq_run, FALSE); + if (THREAD_INVALID_ID == evq_thread_id) + return; if (-1 != thread_kill(evq_thread_id, TSIG_TERM)) { tm_t tmout;
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/fd.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/fd.c
Changed
@@ -133,7 +133,7 @@ static void fd_preserved_allocate(void) { - fd_preserved = hset_create(HASH_KEY_SELF, 0); + fd_preserved = NOT_LEAKING(hset_create(HASH_KEY_SELF, 0)); hset_thread_safe(fd_preserved); }
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/filelock.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/filelock.c
Changed
@@ -846,6 +846,10 @@ * * We use our malloc() layer here on purpose, because the locks can be * disposed of very late when auto-cleaning triggers. + * + * Note that for fcntl() locks, the file descriptor needs to be kept + * around as closing it would release the advisory locks we took for + * that file. */ once_flag_run(&filelock_inited, filelock_init_once);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/getcpucount.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/getcpucount.c
Changed
@@ -34,9 +34,17 @@ #include "common.h" #include "getcpucount.h" +#ifndef _SC_NPROCESSORS_ONLN +/* + * Only include <sys/sysctl.h> if we're going to actually need it. + * Indeed, that header file is now deprecated on linux, but since linux + * has sysconf(), we don't really need to include that file there! + * --RAM, 2020-11-10. + */ #if defined(I_SYS_SYSCTL) && defined(HAS_SYSCTL) #include <sys/sysctl.h> #endif +#endif /* !_SC_NPROCESSORS_ONLN */ #include "override.h" /* Must be the last header included */
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/getphysmemsize.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/getphysmemsize.c
Changed
@@ -36,9 +36,17 @@ #include "vmm.h" #include "getphysmemsize.h" +#ifndef _SC_PHYS_PAGES +/* + * Only include <sys/sysctl.h> if we're going to actually need it. + * Indeed, that header file is now deprecated on linux, but since linux + * has sysconf(), we don't really need to include that file there! + * --RAM, 2020-11-10. + */ #if defined(I_SYS_SYSCTL) && defined(HAS_SYSCTL) #include <sys/sysctl.h> #endif +#endif /* !_SC_PHYS_PAGES */ #ifdef I_INVENT #include <invent.h>
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/halloc.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/halloc.c
Changed
@@ -630,7 +630,16 @@ /* EMPTY */ } -#ifdef REMAP_ZALLOC +/** + * Is halloc() possible given current walloc() limits? + */ +bool +halloc_is_possible(void) +{ + return TRUE; +} + +#if defined(REMAP_ZALLOC) && !defined(TRACK_MALLOC) void * halloc(size_t size) { @@ -666,7 +675,13 @@ { return TRUE; } -#endif /* REMAP_ZALLOC */ + +bool +halloc_is_possible(void) +{ + return FALSE; +} +#endif /* REMAP_ZALLOC && !TRACK_MALLOC */ #endif /* !REMAP_ZALLOC && !TRACK_MALLOC */ @@ -750,6 +765,10 @@ } #endif /* USE_HALLOC */ +#if !defined(REMAP_ZALLOC) && !defined(TRACK_MALLOC) +static bool replacing_malloc; +static bool halloc_is_compiled = TRUE; + /** * Is halloc() possible given current walloc() limits? */ @@ -759,10 +778,6 @@ return walloc_maxsize() > sizeof(union halign); } -#if !defined(REMAP_ZALLOC) && !defined(TRACK_MALLOC) -static bool replacing_malloc; -static bool halloc_is_compiled = TRUE; - static void halloc_init_once(void) {
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/hash.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/hash.c
Changed
@@ -531,7 +531,7 @@ hv2 += hash_offset_secondary; - return (hv2 & 0x1) ? hv2 : ~hv2; /* Ensure it is an odd number */ + return hv2 + !(hv2 & 0x1); /* Ensure it is an odd number */ } /**
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/hashing.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/hashing.h
Changed
@@ -184,7 +184,20 @@ /** * Fast inlined hashing of integers. - * + * The identity function makes a poor hash for consecutive integers. + */ +static inline ALWAYS_INLINE unsigned +uint_hash(uint v) +{ +#if INTSIZE <= 4 + return u32_hash(v); +#else + return u32_hash(v) + u32_hash(v >> 32); +#endif +} + +/** + * Fast inlined hashing of integers. * The identity function makes a poor hash for consecutive integers. */ static inline ALWAYS_INLINE unsigned
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/hashtable.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/hashtable.c
Changed
@@ -37,7 +37,7 @@ * * A simple hashtable implementation. * - * There are fiven interesting properties in this hash table: + * There are five interesting properties in this hash table: * * - The items and the internal data structures are allocated out of a * same contiguous memory region (aka the "arena"). @@ -75,6 +75,7 @@ #include "pow2.h" #include "rand31.h" #include "spinlock.h" +#include "stringify.h" /* For PLURAL() */ #include "vmm.h" #include "xmalloc.h" @@ -139,6 +140,7 @@ unsigned once:1; /* Object allocated using "once" memory */ unsigned self_keys:1; /* Keys are self-representing */ unsigned fixed_size:1; /* Table allocated statically */ + unsigned resizing:1; /* Table being resized */ }; /** @@ -563,7 +565,7 @@ hash_key(const hash_table_t *ht, const void *key) { /* - * There is no offseting of the hashed value for fixed-size table. + * There is no offsetting of the hashed value for fixed-size table. * Rather than issuing a test and a branch, we use an array indexed * by 0 or 1. */ @@ -610,9 +612,9 @@ idx = hashing_keep(hash_key(ht, key), ht->bin_bits); item = ht->binsidx; - if (bin) { + + if (bin) *bin = idx; - } for ( /* NOTHING */ ; item != NULL; item = item->next) { if G_LIKELY(hash_eq(ht, key, item->key)) { @@ -637,14 +639,14 @@ void hash_table_foreach(const hash_table_t *ht, ckeyval_fn_t func, void *data) { - size_t i, n; + size_t i, n, old_n; hash_table_check(ht); g_assert(func != NULL); ht_synchronize(ht); - n = ht->num_held; + old_n = n = ht->num_held; i = ht->num_bins; while (i-- > 0) { @@ -655,12 +657,105 @@ n--; } } - g_assert(0 == n); + + /* + * That's either a bug in our implementation, or a table changing whilst + * we were iterating over it! + */ + + g_soft_assert_log(0 == n, + "%s(): did not loop through %zu item%s, %zd %s visited (%s count=%zu)", + G_STRFUNC, PLURAL(old_n), + (ssize_t) n > 0 ? n : -n, + (ssize_t) n > 0 ? "non" : "new", + old_n == ht->num_held ? "stable" : "MODIFIED", ht->num_held); ht_return_void(ht); } /** + * Iterate over the hashtable, invoking the "func" callback on each item + * with the additional "data" argument. + * + * Unlike hash_table_foreach(), we work on a copy of the table, in case + * the table could change whilst we iterate over it. + * + * This is particularity useful for memory allocators who can do some actions + * whilst iterating that cause memory allocation that in turn gets tracked + * into the hash table we are iterating over! + */ +void +hash_table_copy_foreach(const hash_table_t *ht, ckeyval_fn_t func, void *data) +{ + size_t i, n, old_n; + void **keys, **values; + + hash_table_check(ht); + g_assert(func != NULL); + + ht_synchronize(ht); + + n = old_n = ht->num_held; + i = ht->num_bins; + + if G_UNLIKELY(0 == n) + ht_return_void(ht); + + keys = vmm_alloc(n * sizeof keys0); + values = vmm_alloc(n * sizeof values0); + + /* + * If we have no memory left, then use hash_table_foreach() as a + * last resort but loudly warn because if they used this routine, + * it was because it might be altered whilst iterating. + */ + + if (NULL == keys || NULL == values) { + VMM_FREE_NULL(keys, n * sizeof keys0); + VMM_FREE_NULL(values, n * sizeof values0); + s_carp("%s(): falling back to hash_table_foreach(): " + "no memory for %zu item%s", G_STRFUNC, PLURAL(n)); + hash_table_foreach(ht, func, data); + ht_return_void(ht); + } + + while (i-- > 0) { + hash_item_t *item; + + for (item = ht->binsi; NULL != item; item = item->next) { + keys--n = deconstify_pointer(item->key); + valuesn = deconstify_pointer(item->value); + } + } + + /* + * That's either a bug in our implementation, or a table changing whilst + * we were allocating the keys and values array! No luck! + */ + + g_soft_assert_log(0 == n, + "%s(): did not loop through %zu item%s, %zd %s visited (%s count=%zu)", + G_STRFUNC, PLURAL(old_n), + (ssize_t) n > 0 ? n : -n, + (ssize_t) n > 0 ? "non" : "new", + old_n == ht->num_held ? "stable" : "MODIFIED", ht->num_held); + + /* + * We can now release the lock and iterate on our copy. + */ + + ht_unsynchronize(ht); + + n = old_n; + + while (n-- > 0) + (*func)(keysn, valuesn, data); + + vmm_free(keys, old_n * sizeof keys0); + vmm_free(values, old_n * sizeof values0); +} + +/** * Remove all items from hash table. */ void @@ -709,16 +804,9 @@ g_assert(!ht->readonly); arena = hash_bins_items_arena_size(ht, NULL); - hash_vmm_free(ht, ht->bins, arena); - ht->bins = NULL; - ht->num_bins = 0; - ht->items = NULL; - ht->num_held = 0; - ht->num_items = 0; - ht->free_list = NULL; - ht->last_key = NULL; - ht->last_item = NULL; + + ZERO(ht); } /** @@ -774,24 +862,37 @@ hash_table_t tmp; g_assert(!ht->fixed_size); + g_assert(!ht->resizing); + + ht->resizing = TRUE; ZERO(&tmp); hash_copy_flags(&tmp, ht); hash_table_new_intern(&tmp, n, ht->hash, ht->eq, NULL, 0);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/hashtable.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/hashtable.h
Changed
@@ -92,6 +92,7 @@ bool hash_table_remove(hash_table_t *ht, const void *key); bool hash_table_remove_no_resize(hash_table_t *ht, const void *key); void hash_table_foreach(const hash_table_t *ht, ckeyval_fn_t func, void *data); +void hash_table_copy_foreach(const hash_table_t *ht, ckeyval_fn_t fn, void *d); size_t hash_table_foreach_remove(hash_table_t *ht, ckeyval_rm_fn_t func, void *data);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/hgeneric.ct -> gtk-gnutella-1.2.2.tar.xz/src/lib/hgeneric.ct
Changed
@@ -981,4 +981,4 @@ } @end /* TABLE */ -/* vi: set ts=4 sw=4 cindent: */ +/* vi: set ts=4 sw=4 syn=c cindent: */
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/hgeneric.ht -> gtk-gnutella-1.2.2.tar.xz/src/lib/hgeneric.ht
Changed
@@ -133,4 +133,4 @@ #endif /* _h<generic>_h_ */ -/* vi: set ts=4 sw=4 cindent: */ +/* vi: set ts=4 sw=4 syn=c cindent: */
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/host_addr.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/host_addr.c
Changed
@@ -57,7 +57,6 @@ #include "hset.h" #include "parse.h" #include "pslist.h" -#include "random.h" #include "stringify.h" #include "walloc.h" @@ -1463,7 +1462,7 @@ { g_assert(sl_ptr); - if (*sl_ptr) { + if (*sl_ptr != NULL) { pslist_t *sl; PSLIST_FOREACH(*sl_ptr, sl) { @@ -1487,13 +1486,10 @@ addr = zero_host_addr; sl_addr = name_to_host_addr(host, net); - if (sl_addr) { - size_t i, len; + if (sl_addr != NULL) { const host_addr_t *addr_ptr; - len = pslist_length(sl_addr); - i = len > 1 ? random_value(len - 1) : 0; - addr_ptr = pslist_nth_data(sl_addr, i); + addr_ptr = pslist_data(pslist_random(sl_addr)); g_assert(addr_ptr != NULL); addr = *addr_ptr;
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/hstrfn.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/hstrfn.h
Changed
@@ -63,6 +63,14 @@ char **h_strsplit_set(const char *str, const char *delim, size_t max_tokens) G_NON_NULL; +#define H_STRFREEV_NULL(p) \ +G_STMT_START { \ + if (p != NULL) { \ + h_strfreev(p); \ + p = NULL; \ + } \ +} G_STMT_END + #endif /* _hstrfn_h_ */ /* vi: set ts=4 sw=4 cindent: */
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/http_range.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/http_range.c
Changed
@@ -462,6 +462,28 @@ return NULL; /* + * Range `hri' MUST overlap with `range' defined by start, end. + * + * We already know that start <= end, since this is a pre-condition. + * + * We first assert that hri is a valid interval, which implies that + * hri>start <= hri->end naturally. + * + * And then we need to ensure that the two ranges overlap, that is + * we both have: + * + * start <= hri->end + * hri->start <= end + */ + + http_range_item_check(hri); + g_assert_log(start <= hri->end && hri->start <= end, + "%s(): given range %zu, %zu not overlapping with found %zu, %zu", + G_STRFUNC, + (size_t) start, (size_t) end, + (size_t) hri->start, (size_t) hri->end); + + /* * Move to the earliest overlapping range. */ @@ -480,6 +502,21 @@ break; /* Not overlapping */ hri = prange; /* Update earliest overlapping range */ + + /* + * Same assertions as above, but this time we already know that + * hri->end >= start due to the comparison we just did between + * prange->end and start. + * + * Also since we called http_range_item_check() on prange, we know + * due to the above assignment that hri->start <= hri->end. + */ + + g_assert_log(hri->start <= end, + "%s(): given range %zu, %zu not overlapping with found %zu, %zu", + G_STRFUNC, + (size_t) start, (size_t) end, + (size_t) hri->start, (size_t) hri->end); } return HTTP_RANGE(hri);
View file
gtk-gnutella-1.2.2.tar.xz/src/lib/iovec.c
Added
@@ -0,0 +1,123 @@ +/* + * Copyright (c) 2004, Christian Biere + * Copyright (c) 2012-2018, Raphael Manfredi + * + *---------------------------------------------------------------------- + * This file is part of gtk-gnutella. + * + * gtk-gnutella is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * gtk-gnutella is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with gtk-gnutella; if not, write to the Free Software + * Foundation, Inc.: + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + *---------------------------------------------------------------------- + */ + +/** + * @ingroup lib + * @file + * + * I/O vector helping routines. + * + * It is necessary to have routines using XMALLOC allocation macros to + * be in a C file and not defined as inlined routines in a header file. + * Otherwise, it is not possible to trap the allocation through a CPP + * remapping in "override.h". + * --RAM, 2020-08-19 + * + * @author Christian Biere + * @date 2004 + * @author Raphael Manfredi + * @date 2012-2018 + */ + +#include "common.h" + +#include "iovec.h" + +#include "xmalloc.h" + +#include "override.h" /* Must be the last header included */ + +/** + * Allocates an array of "struct iov" elements. + * @param n The desired array length in elements. + */ +iovec_t * +iov_alloc_n(size_t n) +{ + iovec_t *iov; + + if (n > (size_t) -1 / sizeof *iov) { + g_assert_not_reached(); /* We don't want to handle failed allocations */ + return NULL; + } + XMALLOC0_ARRAY(iov, n); + return iov; +} + +/** + * Free array of "struct iov" elements allocated via iov_alloc_n(). + */ +void +iov_free(iovec_t *iov) +{ + xfree(iov); +} + +/** + * Scatters a NUL-terminated string over an array of struct iovec buffers. The + * trailing buffer space is zero-filled. If the string is too long, it is + * truncated, so that there is a terminating NUL in any case, except if the + * buffer space is zero. + * + * @param iov An array of initialized memory buffers. + * @param iov_cnt The array length of iov. + * @return The amount of bytes copied excluding the terminating NUL. + */ +size_t +iov_scatter_string(iovec_t *iov, size_t iov_cnt, const char *s) +{ + size_t i, len, avail, size; + + g_assert(iov); + g_assert(s); + + /* Reserve one byte for the trailing NUL */ + size = iov_calculate_size(iov, iov_cnt); + len = vstrlen(s); + if (len >= size) { + len = size > 0 ? (size - 1) : 0; + } + avail = len; + + for (i = 0; i < iov_cnt; i++) { + size_t n; + + n = MIN(iovec_len(&iovi), avail); + memmove(iovec_base(&iovi), s, n); + avail -= n; + s += n; + if (0 == avail) { + iov_clear(&iovi, n); + i++; + break; + } + } + while (i < iov_cnt) { + iov_clear(&iovi, 0); + i++; + } + return len; +} + +/* vi: set ts=4 sw=4 cindent: */
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/iovec.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/iovec.h
Changed
@@ -39,24 +39,9 @@ #include "common.h" -#include "xmalloc.h" - -/** - * Allocates an array of "struct iov" elements. - * @param n The desired array length in elements. - */ -static inline iovec_t * -iov_alloc_n(size_t n) -{ - iovec_t *iov; - - if (n > (size_t) -1 / sizeof *iov) { - g_assert_not_reached(); /* We don't want to handle failed allocations */ - return NULL; - } - XMALLOC0_ARRAY(iov, n); - return iov; -} +iovec_t *iov_alloc_n(size_t n); +void iov_free(iovec_t *iov); +size_t iov_scatter_string(iovec_t *iov, size_t iov_cnt, const char *s); static inline iovec_t iov_get(void *base, size_t size) @@ -71,15 +56,6 @@ } /** - * Free array of "struct iov" elements allocated via iov_alloc_n(). - */ -static inline void -iov_free(iovec_t *iov) -{ - xfree(iov); -} - -/** * Resets an array of "struct iov" elements, so that iov_base is NULL * and iov_len is 0 for each element. * @@ -217,52 +193,6 @@ return size; } -/** - * Scatters a NUL-terminated string over an array of struct iovec buffers. The - * trailing buffer space is zero-filled. If the string is too long, it is - * truncated, so that there is a terminating NUL in any case, except if the - * buffer space is zero. - * - * @param iov An array of initialized memory buffers. - * @param iov_cnt The array length of iov. - * @return The amount of bytes copied excluding the terminating NUL. - */ -static inline size_t -iov_scatter_string(iovec_t *iov, size_t iov_cnt, const char *s) -{ - size_t i, len, avail, size; - - g_assert(iov); - g_assert(s); - - /* Reserve one byte for the trailing NUL */ - size = iov_calculate_size(iov, iov_cnt); - len = vstrlen(s); - if (len >= size) { - len = size > 0 ? (size - 1) : 0; - } - avail = len; - - for (i = 0; i < iov_cnt; i++) { - size_t n; - - n = MIN(iovec_len(&iovi), avail); - memmove(iovec_base(&iovi), s, n); - avail -= n; - s += n; - if (0 == avail) { - iov_clear(&iovi, n); - i++; - break; - } - } - while (i < iov_cnt) { - iov_clear(&iovi, 0); - i++; - } - return len; -} - #endif /* _lib_iovec_h_ */ /* vi: set ts=4 sw=4 cindent: */
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/leak.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/leak.c
Changed
@@ -82,6 +82,7 @@ struct leak_set *ls; XMALLOC0(ls); + (void) NOT_LEAKING(ls); ls->magic = LEAK_SET_MAGIC; ls->places = htable_create_real(HASH_KEY_STRING, 0); /* No walloc() */ ls->stacks = htable_create_any_real(stack_hash, NULL, stack_eq);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/log.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/log.c
Changed
@@ -1426,6 +1426,16 @@ msglen = LOG_MSG_REGULAR_LEN; } + /* + * During early initializations, signal_chunk() can return NULL. + * Hence if we are crashing very early, we must take care of that. + */ + + if G_UNLIKELY(NULL == ck) { + s_rawlogv(level, TRUE, FALSE, format, args); /* Lower size limit */ + goto log_done; + } + saved = ck_save(ck); msg = str_new_in_chunk(ck, msglen); @@ -1472,7 +1482,8 @@ * message logged. */ - ck_restore(ck, saved); + if (ck != NULL) + ck_restore(ck, saved); if (G_LIKELY(NULL == lt)) { loggingstid = FALSE;
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/malloc.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/malloc.c
Changed
@@ -27,6 +27,12 @@ * * Debugging malloc, to supplant dmalloc which is not satisfactory. * + * Code compiled with "-DTRACK_MALLOC -DREMAP_ZALLOC" will be able to + * track most memory leaks, as well as detect (after the fact, alas) some + * block corruptions (see MALLOC_SAFE below). + * + * Make sure to call malloc_close() to be able to get the final leak report. + * * @author Raphael Manfredi * @date 2004-2010, 2020 */ @@ -37,7 +43,7 @@ #define TRACK_MALLOC #endif -#define MALLOC_SOURCE /**< Avoid nasty remappings, but include signatures */ +#define MALLOC_SOURCE /**< Avoid nasty remapping, but include signatures */ #include "ascii.h" #include "atomic.h" @@ -52,6 +58,7 @@ #include "once.h" #include "parse.h" /* For parse_pointer() */ #include "path.h" /* For filepath_basename() */ +#include "pow2.h" #include "spinlock.h" #include "stacktrace.h" #include "str.h" @@ -65,7 +72,7 @@ /* * The following setups are more or less independent from each other. * - * This comes at the price of heavy usage of conditinal compilation + * This comes at the price of heavy usage of conditional compilation * throughout the file... * * All of these have effect even when TRACK_MALLOC is not defined. @@ -75,8 +82,12 @@ #define MALLOC_VTABLE /* Try to redirect glib's malloc here */ #endif #if 0 -#define MALLOC_SAFE /* Add trailer magic to each block */ -#define MALLOC_TRAILER_LEN 8 /* Additional trailer len, past end mark */ +#define MALLOC_TIME /* Track allocation / tracking times */ +#endif +#if 0 +#define MALLOC_SAFE /* Add trailer magic to each block */ +/* Additional trailer len, past end mark */ +#define MALLOC_TRAILER_LEN (2 * MEM_ALIGNBYTES) #endif #if 0 #define MALLOC_SAFE_HEAD /* Additional header magic before each block */ @@ -94,13 +105,13 @@ #if 0 #define MALLOC_LEAK_ALL /* Report all leaked "real" blocks as well */ #endif -#if 1 -#define MALLOC_CATCH_MALLOC /* Catch all malloc(), realloc() and free() calls */ -#endif #if 0 #define MALLOC_CATCH_VERBOSE /* Whether to be verbose about allocations */ #endif +/* Leave this one defined, we rely on it now -- RAM 2020-08-20 */ +#define MALLOC_CATCH_MALLOC /* Catch all malloc(), realloc() and free() calls */ + /* * Enable MALLOC_VTABLE to avoid missing free() events from GTK if they * turn on TRACK_MALLOC. @@ -225,6 +236,9 @@ static hash_table_t *reals; static hash_table_t *unknowns; #endif +#ifdef MALLOC_FRAMES +static hash_table_t *alloc_points; /**< Maps a block to its allocation frame */ +#endif #ifdef MALLOC_VTABLE static bool vtable_works; /* Whether we can trap glib memory calls */ @@ -253,17 +267,23 @@ static void *call_libc_realloc(void *, size_t); static void *call_libc_calloc(size_t, size_t); static void call_libc_free(void *); +static bool malloc_is_boot(const void *p); +static size_t malloc_boot_size(void *p); #else #define MALLOC_INIT(x) = x +#define malloc_is_boot(p) FALSE +static inline size_t +malloc_boot_size(const void *p) +{ + (void) p; + g_assert_not_reached(); /* Cannot be called */ +} #endif -static void *(*libc_malloc)(size_t) MALLOC_INIT(malloc); - -#ifdef TRACK_MALLOC -static void *(*libc_realloc)(void *, size_t) MALLOC_INIT(realloc); -static void *(*libc_calloc)(size_t, size_t) MALLOC_INIT(calloc); -static void (*libc_free)(void *) MALLOC_INIT(free); -#endif /* TRACK_MALLOC */ +static void *(*libc_malloc)(size_t) MALLOC_INIT(malloc); +static void G_UNUSED *(*libc_realloc)(void *, size_t) MALLOC_INIT(realloc); +static void G_UNUSED *(*libc_calloc)(size_t, size_t) MALLOC_INIT(calloc); +static void G_UNUSED (*libc_free)(void *) MALLOC_INIT(free); /** * Structure keeping track of allocated blocks. (visible for convenience) @@ -277,6 +297,7 @@ GSList *reallocations; /**< Reallocations that happened for block */ size_t size; /**< Size of tracked block */ int line; /**< Line number in file where block is tracked */ + int stid; /**< ID of thread which allocated block */ #ifdef MALLOC_TIME time_t ttime; /**< Tracking start time */ #endif @@ -286,6 +307,12 @@ #endif }; +#ifdef MALLOC_TIME +#define malloc_block_time(b) (b)->ttime +#else +#define malloc_block_time(b) 0 +#endif + /** * Structure keeping information for blocks allocated through real_malloc() * or from other allocators (in which case `is_real' will be set to FALSE). @@ -295,6 +322,7 @@ struct frame *alloc; /**< Allocation frame (atom) */ #endif size_t size; /**< Size of allocated block */ + int stid; /**< ID of the allocating thread */ #ifdef MALLOC_TIME time_t atime; /**< Allocation time */ #endif @@ -302,9 +330,23 @@ uint corrupted:1; /**< Whether block was marked as corrupted */ uint header_corrupted:1;/**< Whether header corruption was reported */ #endif - uint is_real:1; /**< Allocated from real_malloc() */ + uint is_real:1; /**< Allocated from real_malloc() directly */ + uint is_shifted:1; /**< Allocated with real_malloc_header */ + uint is_raw:1; /**< Has no malloc_header nor any trailer */ }; +#ifdef MALLOC_TIME +#define malloc_real_time(rb) (rb)->atime +#else +#define malloc_real_time(rb) 0 +#endif + +#ifdef MALLOC_FRAMES +#define malloc_real_ast(rb) (NULL == (rb)->alloc ? NULL : (rb)->alloc->ast) +#else +#define malloc_real_ast(rb) NULL +#endif + #ifdef TRACK_MALLOC static time_t init_time = 0; static time_t reset_time = 0; @@ -407,14 +449,14 @@ ht = *hptr; if (NULL == ht) { - static spinlock_t frame_lock = SPINLOCK_INIT; - spinlock(&frame_lock); + static spinlock_t frame_lck = SPINLOCK_INIT; + spinlock(&frame_lck); if (NULL == (ht = *hptr)) { ht = hash_table_new_full_real(stack_hash, stack_eq); hash_table_thread_safe(ht); *hptr = ht; } - spinunlock(&frame_lock); + spinunlock(&frame_lck); } else { fr = hash_table_lookup(ht, ast); } @@ -432,7 +474,7 @@ #endif /* MALLOC_FRAMES */ /** - * @struct stats + * @struct malloc_stats * * When MALLOC_STATS is supplied, we keep information about the amount * of bytes allocated from a single point in the code, and the amount @@ -444,15 +486,15 @@ */ #ifdef MALLOC_STATS -struct stats { +struct malloc_stats { const char *file; /**< Place where allocation took place */
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/malloc.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/malloc.h
Changed
@@ -61,6 +61,7 @@ #if defined(TRACK_MALLOC) && !defined(MALLOC_SOURCE) +#include "atomic.h" #include "hashlist.h" #undef strdup /**< Defined in <bits/string2.h> */ @@ -124,8 +125,6 @@ #endif /* !XMALLOC_SOURCE */ -#undef XCOPY -#define XCOPY(p) malloc_copy_track(e_xmalloc, p, sizeof *p, _WHERE_, __LINE__) #define xcopy(p,s) malloc_copy_track(e_xmalloc, (p), (s), _WHERE_, __LINE__) /* FIXME: This is only correct if xmlFree() is equivalent to free(). */ @@ -150,8 +149,10 @@ #define g_hash_table_new(x,y) hashtable_new_track(x, y, _WHERE_, __LINE__) #define g_hash_table_destroy(x) hashtable_destroy_track(x, _WHERE_, __LINE__) +#ifndef REMAP_ZALLOC #define hash_list_new(h,c) hash_list_new_track((h),(c),_WHERE_, __LINE__) #define hash_list_free(h) hash_list_free_track((h), _WHERE_, __LINE__) +#endif /* !REMAP_ZALLOC */ #define g_slist_alloc() track_slist_alloc(_WHERE_, __LINE__) #define g_slist_append(l,d) track_slist_append((l),(d), _WHERE_, __LINE__) @@ -371,6 +372,8 @@ #ifdef MALLOC_FRAMES +#include "atomic.h" /* For AU64 */ + #define FRAME_DEPTH_MAX 128 #define FRAME_DEPTH 10 /**< Size of allocation frame we keep around */ @@ -385,9 +388,9 @@ */ struct frame { const struct stackatom *ast; /**< Atomic stack frame */ - size_t blocks; /**< Blocks allocated from this stack frame */ - size_t count; /**< Bytes allocated/freed since reset */ - size_t total_count; /**< Grand total for this stack frame */ + AU64(blocks); /**< Blocks allocated from this stack frame */ + AU64(count); /**< Bytes allocated/freed since reset */ + AU64(total_count); /**< Grand total for this stack frame */ }; struct frame *get_frame_atom(hash_table_t **hptr, const struct stacktrace *st);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/mem.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/mem.c
Changed
@@ -41,6 +41,7 @@ #include "mem.h" +#include "atomic.h" #include "fd.h" /* For is_a_fifo() */ #include "file.h" #include "log.h" @@ -446,6 +447,37 @@ return mem_is_accessible(p, len, mem_is_writable); } +static int mem_done = 0; +static bool mem_prot_checks_working; +static bool mem_valid_checks_working; + +/** + * Return whether memory validity checks are possible. + * + * @note + * If mem_test() was not called, we return FALSE to avoid possibly + * harmful late initializations. + */ +bool +mem_validity_testable(void) +{ + return mem_valid_checks_working; +} + +/** + * Return whether we are ready to perform page protection enquiry + * under dire conditions. + * + * @note + * If mem_test() was not called, we return FALSE to avoid possibly + * harmful late initializations. + */ +bool +mem_protection_testable(void) +{ + return mem_prot_checks_working; +} + /** * Ensure memory checking primitives are working properly. */ @@ -454,19 +486,34 @@ { static const char str = "x"; - if (!mem_is_valid_ptr(str) || mem_is_valid_ptr(NULL)) + if (0 != atomic_int_inc(&mem_done)) + return; /* Already done */ + + /* Be optimist */ + mem_valid_checks_working = TRUE; + mem_prot_checks_working = TRUE; + + if (!mem_is_valid_ptr(str) || mem_is_valid_ptr(NULL)) { s_warning("%s(): cannot check whether a pointer is valid", G_STRFUNC); + mem_valid_checks_working = FALSE; + } - if (mem_is_writable(str) || mem_is_writable(mem_test)) + if (mem_is_writable(str) || mem_is_writable(mem_test)) { s_warning("%s(): writable memory checks may not be working", G_STRFUNC); + mem_prot_checks_working = FALSE; + } - if (MEM_PROT_NONE == mem_protection(str)) + if (MEM_PROT_NONE == mem_protection(str)) { s_warning("%s(): memory protection checks are not working", G_STRFUNC); + mem_prot_checks_working = FALSE; + } g_assert('x' == str0); /* mem_protection() leaves memory intact */ - if (!mem_is_valid_range(ARYLEN(str))) + if (!mem_is_valid_range(ARYLEN(str))) { s_warning("%s(): memory range checks are not working", G_STRFUNC); + mem_valid_checks_working = FALSE; + } } /* vi: set ts=4 sw=4 cindent: */
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/mem.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/mem.h
Changed
@@ -55,6 +55,8 @@ bool mem_is_writable_range(const void *p, size_t len); void mem_test(void); +bool mem_validity_testable(void); +bool mem_protection_testable(void); /* * Convenience aliases, for symetry with mem_is_writable().
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/mingw32.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/mingw32.c
Changed
@@ -5351,12 +5351,81 @@ return res; } +/** + * Special version of freopen() to be used when re-opening files for writing. + * + * Blindly using freopen() opens the file with exclusive access, which + * prevents opening the file to inspect it whilst the program runs. + * + * So we use a different strategy by going deeper into the Windows API to + * open the file with shared access, and then we just change the file + * descriptor of the file structure to use our new descriptor. + * + * @param wpathname the wpathname.utf16 is the wide-char pathname + * @param flags O_XXX read/write/trunc/append flags + * @param file the existing FILE we want to redirect to wpathname + * + * @return TRUE on success. + */ +static bool +mingw_write_redirect(pncs_t wpathname, int flags, FILE *file) +{ + HANDLE h; + int fd, r; + DWORD mode = 0; + + /* Assert they are flags, not values we cannot combine */ + STATIC_ASSERT(3 == (O_RDWR | O_WRONLY | O_RDONLY)); + + if (flags & (O_RDWR | O_WRONLY)) + mode |= GENERIC_WRITE; + + if (flags & (O_RDWR | O_RDONLY)) + mode |= GENERIC_READ; + + if (flags & O_APPEND) + mode |= FILE_APPEND_DATA; + + h = CreateFileW(wpathname.utf16, mode, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + + if (INVALID_HANDLE_VALUE == h) + return FALSE; + + if (flags & O_TRUNC) + SetEndOfFile(h); + + /* + * According to MSDN, the only flags interesting here are O_APPEND and + * O_RDONLY. Limit to those then. + */ + + fd = _open_osfhandle((intptr_t) h, flags & (O_APPEND | O_RDONLY)); + if (-1 == fd) { + CloseHandle(h); + return FALSE; + } + + r = mingw_dup2(fd, fileno(file)); /* replaces old fd in `file' */ + close(fd); + + if (-1 == r) { + /* Should already be taken care of by close(fd) if dup2() failed */ + CloseHandle(h); + return FALSE; + } + + return TRUE; +} + FILE * mingw_freopen(const char *pathname, const char *mode, FILE *file) { pncs_t wpathname; char bin_mode14; wchar_t wmode32; + int flags = 0; FILE *res; if (pncs_convert(&wpathname, pathname)) @@ -5378,9 +5447,52 @@ return NULL; } - res = _wfreopen(wpathname.utf16, wmode, file); - if (NULL == res) - errno = mingw_last_error(); + /* + * Analyze the reopen flags to determine how the file will be + * written to, in case we have to handle it manually. + */ + + if (NULL != vstrchr(mode, 'a')) { + if (NULL != vstrstr(mode, "a+")) + flags |= O_RDWR | O_APPEND; + else + flags |= O_WRONLY | O_APPEND; + } + + if (NULL != vstrchr(mode, 'w')) { + if (NULL != vstrstr(mode, "w+")) + flags |= O_RDWR | O_TRUNC; + else + flags |= O_WRONLY | O_TRUNC; + } + + if (NULL != vstrchr(mode, 'r')) { + if (NULL != vstrstr(mode, "r+")) + flags |= O_RDWR; + else + flags |= O_RDONLY; + } + + /* + * Handle re-opening for writing specially to avoid exclusive access + * preventing concurrent reads. + */ + + if (flags & (O_WRONLY | O_RDWR)) { + /* Writing to file, use special version */ + if (mingw_write_redirect(wpathname, flags, file)) { + res = file; + } else { + errno = mingw_last_error(); + res = NULL; + } + } else { + /* No writing, let the default Windows behaviour apply */ + res = _wfreopen(wpathname.utf16, wmode, file); + if (NULL == res) + errno = mingw_last_error(); + } + return res; } @@ -9546,7 +9658,7 @@ STARTUP_DEBUG("stdout file will be %s", pathname); mingw_file_rotate(pathname, MINGW_TRACEFILE_KEEP); STARTUP_DEBUG("stdout files rotated"); - if (NULL != freopen(pathname, "ab", stdout)) { + if (NULL != mingw_freopen(pathname, "ab", stdout)) { log_set(LOG_STDOUT, pathname); STARTUP_DEBUG("stdout (unbuffered) reopened"); } else { @@ -9557,7 +9669,7 @@ STARTUP_DEBUG("stderr file will be %s", pathname); mingw_file_rotate(pathname, MINGW_TRACEFILE_KEEP); STARTUP_DEBUG("stderr files rotated"); - if (NULL != freopen(pathname, "ab", stderr)) { + if (NULL != mingw_freopen(pathname, "ab", stderr)) { log_set(LOG_STDERR, pathname); STARTUP_DEBUG("stderr (unbuffered) reopened"); } else {
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/misc.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/misc.c
Changed
@@ -658,10 +658,9 @@ } } -const char * -short_size(uint64 size, bool metric) +static const char * +short_size_b(uint64 size, bool metric, buf_t *b) { - buf_t *b = buf_private(G_STRFUNC, SIZE_FIELD_MAX); char *p = buf_data(b); size_t n, sz = buf_size(b); @@ -671,15 +670,24 @@ } const char * +short_size(uint64 size, bool metric) +{ + buf_t *b = buf_private(G_STRFUNC, SIZE_FIELD_MAX); + return short_size_b(size, metric, b); +} + +const char * short_size2(uint64 size, bool metric) { buf_t *b = buf_private(G_STRFUNC, SIZE_FIELD_MAX); - char *p = buf_data(b); - size_t n, sz = buf_size(b); + return short_size_b(size, metric, b); +} - n = short_size_to_string_buf(size, metric, p, sz); - g_assert(n < sz); - return p; +const char * +short_size3(uint64 size, bool metric) +{ + buf_t *b = buf_private(G_STRFUNC, SIZE_FIELD_MAX); + return short_size_b(size, metric, b); } const char * @@ -890,6 +898,38 @@ return buf; } +char * +long_value(char *buf, size_t size, uint64 v, bool metric) +{ + if (v < kilo(metric)) { + str_bprintf(buf, size, "%u ", (uint) v); + } else { + uint q, r; + char c; + + c = norm_size_scale(v, &q, &r, metric); + r = (r * 1000) / kilo(metric); + str_bprintf(buf, size, "%u.%03u %c%s", q, r, c, metric ? "" : "i"); + } + + return buf; +} + +static size_t +long_value_to_string_buf(uint64 value, bool metric, char *dst, size_t size) +{ + long_value(dst, size, value, metric); + return clamp_strcat(dst, size, "B"); +} + +short_string_t +long_value_get_string(uint64 value, bool metric) +{ + short_string_t buf; + long_value_to_string_buf(value, metric, ARYLEN(buf.str)); + return buf; +} + const char * compact_size(uint64 size, bool metric) {
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/misc.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/misc.h
Changed
@@ -120,6 +120,7 @@ const char *short_frequency(uint64 freq); const char *short_size(uint64 size, bool metric); const char *short_size2(uint64 size, bool metric); +const char *short_size3(uint64 size, bool metric); const char *short_html_size(uint64 size, bool metric); const char *short_kb_size(uint64 size, bool metric); const char *short_kb_size2(uint64 size, bool metric); @@ -131,6 +132,7 @@ const char *compact_rate(uint64 rate, bool metric); const char *compact_kb_size(uint32 size, bool metric); const char *nice_size(uint64 size, bool metric); +char *long_value(char *buf, size_t size, uint64 v, bool metric); char *short_value(char *buf, size_t size, uint64 v, bool metric); char *compact_value(char *buf, size_t size, uint64 v, bool metric); @@ -139,6 +141,7 @@ size_t short_size_to_string_buf(uint64 size, bool metric, char *, size_t); short_string_t short_rate_get_string(uint64 rate, bool metric); +short_string_t long_value_get_string(uint64 value, bool metric); /* * SHA1<->base32 string conversion
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/mutex.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/mutex.c
Changed
@@ -552,17 +552,19 @@ thread_t t = thread_current(); #ifdef SPINLOCK_DEBUG - s_minierror("thread #%u expected to own mutex %p (%s) at %s:%u" + s_minierror("thread #%u expected to own mutex %p (%s%s) at %s:%u" " (depth=%zu, owner=thread #%d %lu from %s:%u," " current/self=%lu, %lu #%d)", thread_small_id(), m, thread_lock_holds(m) ? "known" : "hidden", + spinlock_is_held(&m->lock) ? "" : " unlocked", file, line, m->depth, thread_stid_from_thread(m->owner), (ulong) m->owner, m->lock.file, m->lock.line, (ulong) t, (ulong) thread_self(), thread_stid_from_thread(t)); #else /* !SPINLOCK_DEBUG */ - s_minierror("thread #%u expected to own mutex %p (%s) at %s:%u" + s_minierror("thread #%u expected to own mutex %p (%s%s) at %s:%u" " (depth=%zu, owner=thread #%d %lu, current/self=%lu, %lu #%d)", thread_small_id(), m, thread_lock_holds(m) ? "known" : "hidden", + spinlock_is_held(&m->lock) ? "" : " unlocked", file, line, m->depth, thread_stid_from_thread(m->owner), (ulong) m->owner, (ulong) t, (ulong) thread_self(), thread_stid_from_thread(t));
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/mutex.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/mutex.h
Changed
@@ -121,7 +121,9 @@ static inline bool mutex_is_valid(const volatile mutex_t * const m) { - return m != NULL && MUTEX_MAGIC == m->magic; + return m != NULL && + MUTEX_MAGIC == m->magic && + SPINLOCK_MAGIC == m->lock.magic; } /**
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/once.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/once.c
Changed
@@ -186,14 +186,16 @@ static void G_NORETURN once_recursive(const char *caller, int id, once_fn_t routine, const char *name) { + /* Avoid calling stacktrace_function_name() here */ + (void) routine; /* For now, we trust G_STRFUNC, hence `name' */ + s_minilog(G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL, - "%s(): recursive attempt to initialize routine %s(), aka. %s() in %s", - caller, stacktrace_function_name(routine), name, - thread_safe_id_name(id)); + "%s(): recursive attempt to initialize routine %s() in %s", + caller, name, thread_safe_id_name(id)); once_backtrace(id); - s_minierror("%s(): recursive initialization request", caller); + s_minierror("%s(): recursive initialization request for %s()", caller, name); } /** @@ -284,7 +286,7 @@ } once_recursive(G_STRFUNC, id, routine, name); s_minierror("%s(): recursive attempt to initialize routine %s()", - G_STRFUNC, stacktrace_function_name(routine)); + G_STRFUNC, name); } for (n = 0; n < ONCE_LOOP_MAX && ONCE_F_PROGRESS == *flag; n++) { @@ -295,8 +297,7 @@ if (ONCE_F_PROGRESS == *flag) { s_warning("%s(): timeout waiting for completion of %s() by %s", - G_STRFUNC, stacktrace_function_name(routine), - thread_id_name(stid)); + G_STRFUNC, name, thread_id_name(stid)); thread_lock_dump_all(STDERR_FILENO); s_minierror("%s(): %s timed out", G_STRFUNC, thread_name()); }
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/ostream.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/ostream.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Raphael Manfredi + * Copyright (c) 2010, 2018 Raphael Manfredi * *---------------------------------------------------------------------- * This file is part of gtk-gnutella. @@ -34,7 +34,7 @@ * or even memory. * * @author Raphael Manfredi - * @date 2010 + * @date 2010, 2018 */ #include "common.h" @@ -58,6 +58,7 @@ OSTREAM_T_PMSG, /**< PDU message stream */ OSTREAM_T_FILE, /**< FILE stream */ OSTREAM_T_FD, /**< File descriptor stream */ + OSTREAM_T_STR, /**< String stream */ OSTREAM_T_MAX }; @@ -74,6 +75,7 @@ pmsg_t *mb; /**< pmsg_write() */ int fd; /**< write() */ FILE *f; /**< fwrite() */ + str_t *s; /**< str_cat() */ } u; unsigned ioerr:1; /**< Set on I/O error */ }; @@ -115,6 +117,7 @@ case OSTREAM_T_PMSG: case OSTREAM_T_FD: case OSTREAM_T_FILE: + case OSTREAM_T_STR: break; case OSTREAM_T_MAX: g_assert_not_reached(); @@ -143,7 +146,9 @@ { ostream_check(os); - return OSTREAM_T_MEM == os->type || OSTREAM_T_PMSG == os->type; + return + OSTREAM_T_MEM == os->type || OSTREAM_T_PMSG == os->type || + OSTREAM_T_STR == os->type; } /** @@ -206,6 +211,24 @@ } /** + * Open stream to string. + * + * Stream must be closed with ostream_close(). + */ +ostream_t * +ostream_open_str(str_t *s) +{ + ostream_t *os; + + str_check(s); + + os = ostream_alloc(OSTREAM_T_STR); + os->u.s = s; + + return os; +} + +/** * Open stream to specified file descriptor. */ ostream_t * @@ -270,6 +293,7 @@ break; case OSTREAM_T_MEM: case OSTREAM_T_PMSG: + case OSTREAM_T_STR: case OSTREAM_T_MAX: g_assert_not_reached(); } @@ -331,6 +355,10 @@ w = pmsg_write(os->u.mb, data, len); w = (len == UNSIGNED(w)) ? w : -1; break; + case OSTREAM_T_STR: + str_cat_len(os->u.s, data, len); + w = len; + break; case OSTREAM_T_MAX: g_assert_not_reached(); } @@ -359,6 +387,12 @@ va_start(args, fmt); + if (OSTREAM_T_STR == os->type) { + /* Handled specially since way more efficient here */ + w = str_vcatf(os->u.s, fmt, args); + goto done; + } + VA_COPY(args2, args); len = str_vbprintf(ARYLEN(buf), fmt, args2); va_end(args2); @@ -368,13 +402,15 @@ } else { data = buf; } - va_end(args); w = ostream_write(os, data, len); if (data != buf) hfree(data); + /* FALL THROUGH */ +done: + va_end(args); return w; } @@ -390,6 +426,12 @@ ostream_check(os); + if (OSTREAM_T_STR == os->type) { + /* Handled specially since more efficient here */ + str_putc(os->u.s, c); + return 1; + } + buf0 = c & 0xff; return ostream_write(os, ARYLEN(buf)); }
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/ostream.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/ostream.h
Changed
@@ -35,8 +35,10 @@ #define _ostream_h_ #include "common.h" -#include "slist.h" -#include "pmsg.h" + +struct slist; +struct pmsg; +struct str; struct ostream; typedef struct ostream ostream_t; @@ -48,12 +50,13 @@ bool ostream_is_file(const ostream_t *os); bool ostream_is_memory(const ostream_t *os); ostream_t *ostream_open_memory(void); -slist_t *ostream_close_memory(ostream_t *os); +struct slist *ostream_close_memory(ostream_t *os); ostream_t *ostream_open_fd(int fd); ostream_t *ostream_open_file(FILE *f); +ostream_t *ostream_open_str(struct str *s); +ostream_t *ostream_open_pmsg(struct pmsg *mb); int ostream_close_file(ostream_t *os); bool ostream_has_ioerr(const ostream_t *os); -ostream_t *ostream_open_pmsg(pmsg_t *mb); bool ostream_close(ostream_t *os); ssize_t ostream_write(ostream_t *os, const void *data, size_t len);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/pattern.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/pattern.c
Changed
@@ -312,12 +312,14 @@ if (cp->d8bits) { uint8 *up = cp->uperiod; - up0 = 0; /* Trivial, zero letters */ - up1 = 1; /* Trivial, one letter */ + up0 = 0; /* Trivial, zero letters */ + if (cp->len != 0) + up1 = 1; /* Trivial, one letter */ } else { size_t *up = cp->uperiod; up0 = 0; /* Trivial, zero letters */ - up1 = 1; /* Trivial, one letter */ + if (cp->len != 0) + up1 = 1; /* Trivial, one letter */ } while (j < cp->len) { @@ -504,6 +506,17 @@ XFREE_NULL(p->uperiod); } +/** + * @return pattern string + */ +const char * +pattern_string(const cpattern_t *p) +{ + pattern_check(p); + + return p->pattern; +} + /* * Code factorization for routines below. *
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/pattern.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/pattern.h
Changed
@@ -60,6 +60,7 @@ void pattern_free(cpattern_t *cpat); void pattern_free_null(cpattern_t **cpat_ptr); size_t pattern_len(const cpattern_t *p); +const char *pattern_string(const cpattern_t *p); char *pattern_strstr(const char *haystack, const cpattern_t *p); char *pattern_strstrlen(const char *haystack, size_t hlen, const cpattern_t *p);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/pow2.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/pow2.h
Changed
@@ -180,6 +180,19 @@ return popcount(v); } +/** + * @returns amount of bits set in a 64-bit value. + */ +static inline ALWAYS_INLINE G_CONST int +bits_set64(uint64 v) +{ + if G_LIKELY(v <= 0xffffffffU) + return bits_set32(v); + else + return bits_set32((uint32) v) + bits_set32(v >> 32); + return popcount(v); +} + #endif /* _pow2_h_ */ /* vi: set ts=4 sw=4 cindent: */
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/progname.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/progname.c
Changed
@@ -171,13 +171,22 @@ } /** + * Was progstart() called? + */ +bool +progstart_was_called(void) +{ + return progname_info.name != NULL; +} + +/** * Ensure progstart() was called. */ static void progstart_called(const char *routine) { - g_assert_log(progname_info.name != NULL, - "%s(): must not be called before progstart()", routine); + if (!progstart_was_called()) + s_error("%s(): must not be called before progstart()", routine); } /** @@ -192,7 +201,8 @@ } /** - * Duplicate the original main() arguments + environment into read-only. + * Duplicate the original main() arguments + environment into a read-only + * memory segment. */ static void progstart_duplicate(void) @@ -209,6 +219,8 @@ arg_count = progname_argc; arg_size = strvec_size(progname_argv); + /* +2 for the trailing NULL entries of both argv and envp */ + len = total_size = (arg_count + env_count + 2) * sizeof(char *) + env_size + arg_size; @@ -217,10 +229,17 @@ envp = ptr_add_offset(argv, (arg_count + 1) * sizeof(char *)); q = ptr_add_offset(envp, (env_count + 1) * sizeof(char *)); + len -= ptr_diff(q, p); /* Amount available for strings */ + q = strvec_cpy(argv, progname_argv, arg_count, q, &len); + g_assert(q != NULL); + q = strvec_cpy(envp, environ, env_count, q, &len); + g_assert(q != NULL); - g_assert(ptr_diff(q, p) == total_size); + g_assert_log(ptr_diff(q, p) == total_size, + "%s(): ptr_diff=%zd, total_size=%zu, len=%zd", + G_STRFUNC, ptr_diff(q, p), total_size, len); if (-1 == mprotect(p, total_size, PROT_READ)) s_warning("%s(): cannot protect memory as read-only: %m", G_STRFUNC); @@ -239,7 +258,7 @@ * argument pointers and progstart_dup() must be called as soon as possible, * before alteration of the argument list or the passed environment. * - * @param argv_ptr where the allocated argment vector is returned + * @param argv_ptr where the allocated argument vector is returned * @param envp_ptr where the allocated environment is returned * * @return the amount of entries in the returned argv
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/progname.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/progname.h
Changed
@@ -50,6 +50,7 @@ struct tmval; void progstart(int argc, char * const *argv); +bool progstart_was_called(void); struct tmval progstart_time(void); int progstart_dup(const char ***argv_ptr, const char ***envp_ptr); const char *progstart_arg(int n);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/prop.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/prop.c
Changed
@@ -362,7 +362,7 @@ d = &PROP(ps, p); - mutex_lock(&d->lock); + PROP_DEF_LOCK(d); } /** @@ -383,7 +383,7 @@ g_assert_log(mutex_is_owned(&d->lock), "%s(): attempt to unlock property %u which is not owned", G_STRFUNC, p); - mutex_unlock(&d->lock); + PROP_DEF_UNLOCK(d); } /** @@ -706,7 +706,7 @@ prop_assert(ps, prop, offset + length <= d->vector_size); n = length * sizeof *target; - target = t != NULL ? (gpointer) t : g_malloc(n); + target = t != NULL ? (gpointer) t : xmalloc(n); PROP_DEF_LOCK(d); memcpy(target, &d->data.boolean.valueoffset, n); PROP_DEF_UNLOCK(d); @@ -812,7 +812,7 @@ prop_assert(ps, prop, offset + length <= d->vector_size); n = length * sizeof *target; - target = t != NULL ? (gpointer) t : g_malloc(n); + target = t != NULL ? (gpointer) t : xmalloc(n); PROP_DEF_LOCK(d); memcpy(target, &d->data.guint64.valueoffset, n); PROP_DEF_UNLOCK(d); @@ -942,7 +942,7 @@ prop_assert(ps, prop, offset + length <= d->vector_size); n = length * sizeof *target; - target = t != NULL ? (gpointer) t : g_malloc(n); + target = t != NULL ? (gpointer) t : xmalloc(n); PROP_DEF_LOCK(d); memcpy(target, &d->data.guint32.valueoffset, n); PROP_DEF_UNLOCK(d); @@ -1050,7 +1050,7 @@ prop_assert(ps, prop, offset + length <= d->vector_size); n = length * sizeof *target; - target = t != NULL ? (gpointer) t : g_malloc(n); + target = t != NULL ? (gpointer) t : xmalloc(n); PROP_DEF_LOCK(d); memcpy(target, &d->data.timestamp.valueoffset, n); PROP_DEF_UNLOCK(d); @@ -1127,7 +1127,7 @@ prop_assert(ps, prop, offset + length <= d->vector_size); n = length * sizeof *target; - target = t != NULL ? (gpointer) t : g_malloc(n); + target = t != NULL ? (gpointer) t : xmalloc(n); PROP_DEF_LOCK(d); memcpy(target, &d->data.ip.valueoffset, n); PROP_DEF_UNLOCK(d); @@ -1184,7 +1184,7 @@ prop_assert(ps, prop, length == d->vector_size); - target = t != NULL ? (gpointer) t : g_malloc(length); + target = t != NULL ? (gpointer) t : xmalloc(length); PROP_DEF_LOCK(d); memcpy(target, d->data.storage.value, length); PROP_DEF_UNLOCK(d); @@ -1231,8 +1231,8 @@ return; } - *d->data.string.value = g_strdup(val); - G_FREE_NULL(old); + *d->data.string.value = xstrdup(val); + XFREE_NULL(old); if (debug >= 5) s_debug("PROP updated property %s = \"%s\"", @@ -1818,15 +1818,20 @@ product_date(), product_website()); } { + time_t now = tm_time(); + fprintf(config, "# %s saved on %s\n#\n", + ps->name, timestamp_to_string(now)); + } + { char *comment = config_comment(ps->desc); - fprintf(config, - "#\n# Description of contents\n" - "%s\n\n", - comment); + if ('\0' != *comment) + fprintf(config, "# Description of contents\n%s\n#\n", comment); HFREE_NULL(comment); } + fputc('\n', config); /* End of descriptive header */ + /* * We're about to save the properties. * Because some properties could be changed during saving by other @@ -2278,7 +2283,7 @@ char *d, *buf; if (p->vector_size > sizeof s) { - d = g_malloc(p->vector_size); + d = xmalloc(p->vector_size); buf = d; } else { d = NULL; @@ -2288,7 +2293,7 @@ stub->storage.set(prop, buf, p->vector_size); } - G_FREE_NULL(d); + XFREE_NULL(d); } break; case NUM_PROP_TYPES:
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/prop.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/prop.h
Changed
@@ -336,9 +336,9 @@ static inline prop_def_t * get_prop(prop_set_t *ps, property_t prop, const char *loc) { - if (!ps) - g_error("%s: ps != NULL failed", loc); - if (!prop_in_range(ps, prop)) + if G_UNLIKELY(NULL == ps) + g_error("%s: ps != NULL failed for property %u", loc, prop); + if G_UNLIKELY(!prop_in_range(ps, prop)) g_error("%s: unknown property %u", loc, (uint) prop); return &ps->propsprop - ps->offset; }
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/random-test.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/random-test.c
Changed
@@ -74,11 +74,12 @@ usage(void) { fprintf(stderr, - "Usage: %s -24eghluxABGMPQSTW -b mask -c items -m min\n" + "Usage: %s -24aeghluvxABGMPQSTW -b mask -c items -m min\n" " -p period -s skip -t amount -C val -D count\n" " -F upper -R seed -U upper -X upper\n" " -2 : test entropy_minirand() instead of rand31()\n" " -4 : test arc4random() instead of rand31()\n" + " -a : used with -t (and -l) to benchmark all routines in sequence\n" " -b : bit mask to apply on random values (focus on some bits)\n" " -c : sets item count to remember, for period computation\n" " -e : test entropy_random() instead of rand31()\n" @@ -90,6 +91,7 @@ " -s : skip that amount of initial random values\n" " -t : benchmark generation of specified amount of random values\n" " -u : test rand31_u32() instead of rand31()\n" + " -v : use verbose benchmarking when -a is used\n" " -x : disable caching (pre-computing) of AJE random numbers\n" " -A : test aje_rand(), the Fortuna-like PRNG, instead of rand31()\n" " -B : count '1' occurrences of each bit\n" @@ -443,7 +445,7 @@ } static void -timeit(random_fn_t fn, unsigned amount, const char *name) +timeit(random_fn_t fn, unsigned amount, const char *name, bool verbose) { tm_t start, end; double ustart, uend; @@ -457,10 +459,11 @@ tm_cputime(&uend, NULL); tm_now_exact(&end); - printf("%s() initialization took %.3gs (CPU=%.3gs)\n", - name, tm_elapsed_f(&end, &start), uend - ustart); - - fflush(stdout); + if (verbose) { + printf("%s() initialization took %.3gs (CPU=%.3gs)\n", + name, tm_elapsed_f(&end, &start), uend - ustart); + fflush(stdout); + } tm_now_exact(&start); tm_cputime(&ustart, NULL); @@ -480,9 +483,13 @@ double elapsed = tm_elapsed_f(&end, &start); double cpu = uend - ustart; - printf("Calling %s() %u times took %.3gs (CPU=%.3gs), %g numbers/s\n", - name, generated, elapsed, cpu, generated / elapsed); - + if (verbose) { + printf( + "Calling %s() %u times took %.3gs (CPU=%.3gs), %g numbers/s\n", + name, generated, elapsed, cpu, generated / elapsed); + } else { + printf("%25s(): %12g numbers/s\n", name, generated / elapsed); + } } } @@ -557,6 +564,39 @@ printf("Started entropy generation thread.\n"); } +#define FN(x) { #x, (random_fn_t) x } + +struct random_function { + const char *name; + random_fn_t fn; +}; + +static struct random_function random_global = { + FN(aje_rand), + FN(aje_rand_strong), + FN(arc4random), + FN(cmwc_rand), + FN(entropy_minirand), + FN(entropy_random), + FN(mt_rand), + FN(rand31), + FN(rand31_u32), + FN(random_strong), + FN(shuffle_thread_rand), + FN(well_rand), +}; + +static struct random_function random_threaded = { + FN(aje_thread_rand), + FN(aje_thread_rand_strong), + FN(arc4_thread_rand), + FN(cmwc_thread_rand), + FN(mt_thread_rand), + FN(well_thread_rand), +}; + +#undef FN + int main(int argc, char **argv) { @@ -570,11 +610,11 @@ unsigned mask = (unsigned) -1; unsigned rseed = 0, cval = 0, skip = 0, dumpcnt = 0, benchmark = 0, chi = 0; bool cperiod = FALSE, countval = FALSE, countbits = FALSE, dumpraw = FALSE; - bool generate = FALSE, no_precompute = FALSE; + bool all = FALSE, generate = FALSE, no_precompute = FALSE, verbose = FALSE; random_fn_t fn = (random_fn_t) rand31; bool test_local = FALSE; const char *fnname = "rand31"; - const char options = "24b:c:eghlm:p:s:t:uxABC:D:F:GMPQR:STU:WX:"; + const char options = "24ab:c:eghlm:p:s:t:uvxABC:D:F:GMPQR:STU:WX:"; #define SET_RANDOM(x) \ G_STMT_START { \ @@ -613,6 +653,9 @@ SET_RANDOM(arc4random); } break; + case 'a': /* with -t, benchmark all routines */ + all = TRUE; + break; case 'b': /* bitmask to apply to random values */ mask = get_number(optarg, c); break; @@ -642,6 +685,9 @@ case 'u': /* check rand31_u32() instead */ SET_RANDOM(rand31_u32); break; + case 'v': /* verbose benchmarking */ + verbose = TRUE; + break; case 'x': /* disable AJE caching (already handled before) */ break; case 'A': /* check aje_random() instead */ @@ -732,6 +778,12 @@ printf("Testing %s()\n", fnname); + if (is_strprefix(fnname, "rand31")) { + rand31_set_seed(rseed); + printf("Initial random seed is %s\n", + uint32_to_gstring(rand31_initial_seed())); + } + if (fp.max != 0) { fp.rf = fn; fn = rand_fp; @@ -747,13 +799,23 @@ uniform.max, fnname); } - if (benchmark != 0) - timeit(fn, benchmark, fnname); - - if (is_strprefix(fnname, "rand31")) { - rand31_set_seed(rseed); - printf("Initial random seed is %s\n", - uint32_to_gstring(rand31_initial_seed())); + if (benchmark != 0) { + if (all) { + size_t n, i; + struct random_function *afn; + if (test_local) { + n = N_ITEMS(random_threaded); + afn = random_threaded; + } else { + n = N_ITEMS(random_global); + afn = random_global; + } + for (i = 0; i < n; i++) { + timeit(afni.fn, benchmark, afni.name, verbose); + } + } else { + timeit(fn, benchmark, fnname, TRUE); + } } if (skip != 0)
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/rwlock.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/rwlock.c
Changed
@@ -129,6 +129,53 @@ rwlock_contention_trace = on; } +#ifdef RWLOCK_WRITER_DEBUG +/** + * Record that we got the writer lock. + */ +static void +rwlock_writer_record(rwlock_t *rw, const char *file, unsigned line) +{ + rwlock_check(rw); + + /* + * Locking would be unnecessary since we have the write lock, but in + * case of bugs, avoid race conditions whilst updating these fields. + */ + + if (!rwlock_pass_through) { + RWLOCK_LOCK(rw); + rw->file = file; + rw->line = line; + RWLOCK_UNLOCK(rw); + } +} + +/** + * Record that we lost the writer lock. + */ +static void +rwlock_writer_clear(rwlock_t *rw) +{ + rwlock_check(rw); + + /* + * Locking would be unnecessary since we still have the write lock, but in + * case of bugs, avoid race conditions whilst updating these fields. + */ + + if (!rwlock_pass_through) { + RWLOCK_LOCK(rw); + rw->file = NULL; + rw->line = 0; + RWLOCK_UNLOCK(rw); + } +} +#else /* !RWLOCK_WRITER_DEBUG */ +#define rwlock_writer_record(rw,f,l) +#define rwlock_writer_clear(rw) +#endif /* RWLOCK_WRITER_DEBUG */ + #if defined(RWLOCK_READER_DEBUG) || defined(RWLOCK_READSPOT_DEBUG) /** * Record that the current thread is becoming a reader. @@ -503,10 +550,20 @@ s_rawwarn("waiting queue for rwlock %p is empty?", rw); } +#ifdef RWLOCK_WRITER_DEBUG + if (RWLOCK_WFREE != rw->owner) { + s_rawinfo("(rwlock %p write-locked by %s from %s:%u)", + rw, thread_safe_id_name(rw->owner), rw->file, rw->line); + } else if (rw->file != NULL) { + s_rawinfo("(rwlock %p was last write-locked from %s:%u)", + rw, rw->file, rw->line); + } +#else /* !RWLOCK_WRITER_DEBUG */ if (RWLOCK_WFREE != rw->owner) { s_rawinfo("(rwlock %p write-locked by %s)", rw, thread_safe_id_name(rw->owner)); } +#endif /* RWLOCK_WRITER_DEBUG */ #if defined(RWLOCK_READER_DEBUG) || defined(RWLOCK_READSPOT_DEBUG) { @@ -564,6 +621,15 @@ rw->waiters - rw->write_waiters, rw->write_waiters, file, line); +#ifdef RWLOCK_WRITER_DEBUG + if (rw->file != NULL) { + s_rawinfo("rwlock (%c) %p %s %s:%u", + reading ? 'R' : 'W', rw, + rw->writers != 0 ? "owned by " : "traced to", + rw->file, rw->line); + } +#endif + atomic_mb(); rwlock_check(rw); @@ -907,8 +973,10 @@ PLURAL(rw->writers), PLURAL(rwait), PLURAL(rw->write_waiters)); } - if (owned) + if (owned) { + rwlock_writer_clear(rw); rwlock_write_unaccount(rw); + } } rw->magic = RWLOCK_DESTROYED; /* Now invalid */ @@ -1160,13 +1228,17 @@ rwlock_wait_grant(rw, &wc, file, line); + rwlock_writer_record(rw, file, line); + if (account) rwlock_write_account(rw, file, line); g_assert(1 == rw->writers || rwlock_pass_through); } - else if (account) { - rwlock_write_account(rw, file, line); + else { + rwlock_writer_record(rw, file, line); + if (account) + rwlock_write_account(rw, file, line); } } @@ -1354,6 +1426,7 @@ RWLOCK_UNLOCK(rw); if G_LIKELY(got) { + rwlock_writer_record(rw, file, line); rwlock_write_account(rw, file, line); } else if G_UNLIKELY(rwlock_contention_trace) { s_rawinfo("LOCK contention for write-lock %p at %s:%u", rw, file, line); @@ -1380,8 +1453,9 @@ "attempting to release unowned write-lock %p at %s:%u", rw, file, line); - rwlock_wungrab(rw); + rwlock_writer_clear(rw); rwlock_write_unaccount(rw); + rwlock_wungrab(rw); } /**
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/rwlock.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/rwlock.h
Changed
@@ -75,6 +75,14 @@ #define RWLOCK_READSPOT_DEBUG /* Tracks first read lock point per thread */ #endif +/** + * Set RWLOCK_WRITER_DEBUG to track write-owner origin (filename and line) + * so that we can more easily spot which place took the write lock. + */ +#if 0 +#define RWLOCK_WRITER_DEBUG /* Tracks write lock point */ +#endif + #ifdef RWLOCK_READER_DEBUG #include "bit_array.h" #endif @@ -112,6 +120,10 @@ #ifdef RWLOCK_READSPOT_DEBUG struct { const char *file; unsigned line; } readspotTHREAD_MAX; #endif +#ifdef RWLOCK_WRITER_DEBUG + const char *file; /* Filename where write lock was acquired */ + uint line; /* Line number where write lock was acquired */ +#endif } rwlock_t; #ifdef RWLOCK_READER_DEBUG @@ -126,6 +138,11 @@ #define RWLOCK_READSPOT_INIT #endif +#ifdef RWLOCK_WRITER_DEBUG +#define RWLOCK_WRITER_INIT , NULL, 0 +#else +#define RWLOCK_WRITER_INIT +#endif /** * Static initialization value for a rwlock structure. @@ -134,6 +151,7 @@ { RWLOCK_MAGIC, RWLOCK_WFREE, 0, 0, 0, 0, SPINLOCK_INIT, NULL, NULL \ RWLOCK_READING_INIT \ RWLOCK_READSPOT_INIT \ + RWLOCK_WRITER_INIT \ } /*
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/signal.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/signal.c
Changed
@@ -42,6 +42,7 @@ #include "dl_util.h" #include "glib-missing.h" /* For g_strlcpy() */ #include "log.h" +#include "mem.h" #include "misc.h" #include "mutex.h" #include "once.h" @@ -226,6 +227,7 @@ static sig_atomic_t in_signal_handlerTHREAD_MAX; static bool in_safe_handlerTHREAD_MAX; static once_flag_t signal_inited; +static once_flag_t signal_chunk_inited; static bool signal_catch_segv; static void signal_uncaught(int signo); @@ -1061,6 +1063,26 @@ } /** + * Are we running on a signal alternate stack? + */ +bool +signal_on_altstack(void) +{ +#ifdef HAS_SIGALTSTACK + stack_t ss; + + if (-1 == sigaltstack(NULL, &ss)) { + s_carp("%s(): cannot check alt stack status: %m", G_STRFUNC); + return FALSE; + } else { + return SS_ONSTACK == ss.ss_flags; + } +#else + return FALSE; +#endif +} + +/** * Wrapper for signal delivery. */ static void @@ -1301,7 +1323,26 @@ #endif case SIGSEGV: str_catf(&s, " for VA=%p", si->si_addr); + { + const void *page = vmm_page_start(si->si_addr); + str_catf(&s, " {PA=%p+%zd}", page, ptr_diff(si->si_addr, page)); + } pc = sig_get_pc(u); +#ifdef SEGV_ACCERR + if ( + !recursive && + SEGV_ACCERR == si->si_code && + mem_protection_testable() + ) { + int prot = mem_protection(si->si_addr); + char pstr3 = { '-', '-', '\0' }; + if (prot & MEM_PROT_READ) + pstr0 = 'r'; + if (prot & MEM_PROT_WRITE) + pstr1 = 'w'; + str_catf(&s, " %s", pstr); + } +#endif /* SEGV_ACCERR */ break; #ifdef SIGTRAP case SIGTRAP: @@ -1463,7 +1504,7 @@ STATIC_ASSERT(SIGNAL_COUNT == N_ITEMS(signal_handler)); - if G_UNLIKELY(!ONCE_DONE(signal_inited)) + if G_UNLIKELY(!ONCE_DONE(signal_chunk_inited)) signal_init(); SIGNAL_LOCK; @@ -1853,6 +1894,23 @@ } /** + * Once initialization done when it is safe. + */ +static void G_COLD +signal_init_chunk_once(void) +{ + /* + * Chunk allocated as non-leaking because the signal chunk must + * remain active up to the very end, way past the point where we're + * supposed to have freed everything and leak detection kicks in. + */ + + sig_chunk = ck_init_not_leaking(SIGNAL_CHUNK_SIZE, SIGNAL_CHUNK_RESERVE); + + mem_test(); +} + +/** * Initialize the signal layer. */ static void G_COLD @@ -1866,14 +1924,6 @@ } /* - * Chunk allocated as non-leaking because the signal chunk must - * remain active up to the very end, way past the point where we're - * supposed to have freed everything and leak detection kicks in. - */ - - sig_chunk = ck_init_not_leaking(SIGNAL_CHUNK_SIZE, SIGNAL_CHUNK_RESERVE); - - /* * Compute the PC register index in the saved user machine context. */ @@ -1903,6 +1953,9 @@ signal_init(void) { once_flag_run(&signal_inited, signal_init_once); + + if (thread_main_has_started()) + once_flag_run(&signal_chunk_inited, signal_init_chunk_once); } /**
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/signal.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/signal.h
Changed
@@ -83,6 +83,7 @@ void signal_abort(void); size_t signal_stack_allocate(void **base_ptr); bool signal_stack_free(void **base_ptr); +bool signal_on_altstack(void); void signal_crashing(void); void signal_uncrashing(void);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/spinlock.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/spinlock.c
Changed
@@ -323,6 +323,17 @@ spinlock_source_string(src), src_object, i, file, line); } + /* + * Normally there is a synchronization done whenever s->lock is + * acquired or released, hence all the CPUs will read s->lock + * consistently. Furthermore, the value is flagged as being + * volatile to force the compiler to re-fetch it each time and + * never optimize accesses. + * + * Therefore, we can bluntly read s->lock without first issuing + * an atomic_mb(). + */ + if G_LIKELY(s->lock) { /* Lock is busy, do nothing as cheaply as possible */ } else if (atomic_acquire(&s->lock)) {
View file
gtk-gnutella-1.2.2.tar.xz/src/lib/stack-test.c
Added
@@ -0,0 +1,161 @@ +/* + * stack-test -- tests the stack tracing functions. + * + * Copyright (c) 2018 Raphael Manfredi <Raphael_Manfredi@pobox.com> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the authors nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "common.h" + +#include "progname.h" +#include "stacktrace.h" +#include "str.h" + +static void G_NORETURN +usage(void) +{ + fprintf(stderr, + "Usage: %s -h\n" + " -h : prints this help message\n" + , getprogname()); + exit(EXIT_FAILURE); +} + +/* + * Our own printf() for Windows which does not support "%zu" for instance. + */ +static void G_PRINTF(1, 2) +my_printf(const char *fmt, ...) +{ + va_list args; + str_t *s = str_new(0); + + va_start(args, fmt); + str_vprintf(s, fmt, args); + va_end(args); + + puts(str_2c(s)); + str_destroy_null(&s); +} + +static NO_INLINE void +test_caller(void) +{ + size_t i; + + for (i = 0; i < 3; i++) { + const void *caller = stacktrace_caller(i); + const char *name = stacktrace_caller_name(i); + + my_printf("%s(): caller%zu=%p (%s)", + G_STRFUNC, i, caller, name); + } +} + +static NO_INLINE void +test_caller_fast(void) +{ + size_t i; + + for (i = 0; i < 3; i++) { + const void *caller = stacktrace_caller(i); + const void *fast = stacktrace_caller_fast(i); + + my_printf("%s(): caller%zu=%p (fast=%p) %s", + G_STRFUNC, i, caller, fast, + caller == fast ? "OK" : "DIFFERS"); + } + + for (i = 0; i < 3; i++) { + const void *caller = stacktrace_caller_fast(i); + const char *name = stacktrace_routine_name(caller, FALSE); + + my_printf("%s(): caller%zu=%p (%s)", + G_STRFUNC, i, caller, name); + } +} + +static NO_INLINE void +test_routine_name(void) +{ + size_t i; + + for (i = 0; i < 3; i++) { + const void *caller = stacktrace_caller(i); + const char *name = stacktrace_routine_name(caller, FALSE); + const char *name2 = stacktrace_caller_name(i); + + if (0 != strcmp(name, name2)) { + s_warning("%s(): caller%zu differs (name=%s, name2=%s)", + G_STRFUNC, i, name, name2); + } + + my_printf("%s(): caller%zu=%p (%s)", + G_STRFUNC, i, caller, name); + } +} + +static NO_INLINE void +test_basics(void) +{ + test_caller(); + test_caller_fast(); + test_routine_name(); + test_caller(); /* Witness effect of tail call optimization */ +} + +int +main(int argc, char **argv) +{ + extern int optind; + extern char *optarg; + int c; + const char options = "h"; + + progstart(argc, argv); + stacktrace_init(argv0, FALSE); + + while ((c = getopt(argc, argv, options)) != EOF) { + switch (c) { + case 'h': /* show help */ + /* FALL THROUGH */ + default: + usage(); + break; + } + } + + if (0 != (argc -= optind)) + usage(); + + test_basics(); + + return 0; +} + +/* vi: set ts=4 sw=4 cindent: */
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/stacktrace.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/stacktrace.c
Changed
@@ -129,10 +129,8 @@ */ static size_t stack_auto_offset; -#ifndef MINGW32 static void *getreturnaddr(size_t level); static void *getframeaddr(size_t level); -#endif /** * Limit stacktraces to simple stacks, avoiding the BFD library or the @@ -190,7 +188,6 @@ #endif } -#ifndef MINGW32 /** * Unwind current stack into supplied stacktrace array. * @@ -212,12 +209,6 @@ void *frame; /* - * Adjust the offset according to the auto-tunings. - */ - - offset = size_saturate_add(offset, stack_auto_offset); - - /* * Go carefully to stack frame "offset", in case the stack is * currently corrupted. */ @@ -249,7 +240,6 @@ return i - offset; } -#endif /* !MINGW32 */ /** * Unwind current stack into supplied stacktrace array. @@ -267,13 +257,29 @@ */ NO_INLINE size_t stacktrace_unwind(void *stack, size_t count, size_t offset) +{ + size_t idx; + + /* + * Apply the auto-configured extra offset, computed initially + * by stacktrace_auto_tune() for this stacktrace_unwind() routine. + * + * We do this here so that all the mis-indented code blocks below + * can share the value and do not need to do the adjustment (or + * worse, forget to do it). + */ + + idx = size_saturate_add(offset, stack_auto_offset); + g_assert(size_is_non_negative(idx)); + +/* Indentation wrong on the remaining, on purpose */ #ifdef HAS_BACKTRACE { static uint8 in_unwindTHREAD_MAX; void *traceSTACKTRACE_DEPTH_MAX + 5; /* +5 to leave room for offsets */ int depth; size_t amount; /* Amount of entries we can copy in result */ - size_t i, idx; + size_t i; int id = thread_safe_small_id(); static bool called; @@ -309,7 +315,7 @@ * address it reaches, there is no need to post-process the result. */ - i = stacktrace_gcc_unwind(stack, count, offset + 1); + i = stacktrace_gcc_unwind(stack, count, idx + 1); goto done; } @@ -345,10 +351,6 @@ if (id >= 0) in_unwindid = FALSE; - idx = size_saturate_add(offset, stack_auto_offset); - - g_assert(size_is_non_negative(idx)); - if (UNSIGNED(depth) <= idx) return 0; @@ -368,7 +370,7 @@ } #elif defined(MINGW32) { - return mingw_backtrace(stack, count, offset + stack_auto_offset); + return mingw_backtrace(stack, count, idx); } #else /* !HAS_BACKTRACE */ { @@ -376,9 +378,11 @@ * Don't increase offset, this is tail recursion and it can be optimized * away. At worst we'll see this call in the stack. */ - return stacktrace_gcc_unwind(stack, count, offset); + return stacktrace_gcc_unwind(stack, count, idx); } #endif /* HAS_BACKTRACE */ +/* End of wrong indentation */ +} static sigjmp_buf stacktrace_safe_envTHREAD_MAX; @@ -470,28 +474,11 @@ /** * Return self-assessed symbol quality. */ -enum stacktrace_sym_quality +enum symbol_quality stacktrace_quality(void) { return NULL == stacktrace_symbols ? - STACKTRACE_SYM_GOOD : symbols_quality(stacktrace_symbols); -} - -/** - * Return string version of the self-assessed symbol quality. - */ -const char * -stacktrace_quality_string(const enum stacktrace_sym_quality sq) -{ - switch (sq) { - case STACKTRACE_SYM_GOOD: return "good"; - case STACKTRACE_SYM_STALE: return "stale"; - case STACKTRACE_SYM_MISMATCH: return "mismatch"; - case STACKTRACE_SYM_GARBAGE: return "garbage"; - case STACKTRACE_SYM_MAX: break; - } - - return "UNKNOWN"; + SYMBOL_Q_GOOD : symbols_quality(stacktrace_symbols); } /** @@ -1584,7 +1571,56 @@ g_assert(size_is_non_negative(n)); g_assert(n <= STACKTRACE_DEPTH_MAX); - count = stacktrace_unwind(stack, N_ITEMS(stack), 1); + count = stacktrace_unwind(stack, MIN(n+1, N_ITEMS(stack)), 1); + + return n < count ? stackn : NULL; +} + +/** + * Faster version of the n-th caller in the stack. + * + * This attemps to use internal GCC unwinding (following frame pointers) + * and if we cannot determine that information, we go back to regular + * unwinding (which may be more CPU-intensive, especially on Windows). + */ +const void * +stacktrace_caller_fast(size_t n) +{ + void *stackSTACKTRACE_DEPTH_MAX; + size_t count; + + g_assert(size_is_non_negative(n)); + g_assert(n <= STACKTRACE_DEPTH_MAX); + + /* + * Quick version following stack frames. + * + * If the first entry is not for this current call, then the output + * is probably wrong (frame pointers not available) so move to the + * "full version" which hopefully can decompile stacks without + * frame pointers. + */ + + count = stacktrace_gcc_unwind(stack, MIN(n+2, N_ITEMS(stack)), 0); + + if (0 == count) + goto full; + + if (ptr_cmp(stack0, stacktrace_caller_fast) < 0) + goto full; /* Falls before this routine */ + + /* 100 is an arbitrary magic distance (about 25 RISC instructions) */ + + if (ptr_diff(stack0, stacktrace_caller_fast) > 100) + goto full; /* Too far ahead from this routine start */ + + if (n + 1 < count) + return stackn+1; + +full: + /* Full version -- output identical to above if no backtrace() support */ + + count = stacktrace_unwind(stack, MIN(n+1, N_ITEMS(stack)), 1);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/stacktrace.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/stacktrace.h
Changed
@@ -34,6 +34,8 @@ #ifndef _stacktrace_h_ #define _stacktrace_h_ +enum symbol_quality; + #define STACKTRACE_DEPTH_MAX 128 /**< Maximum depth we can handle */ #define STACKTRACE_DEPTH 10 /**< Typical fixed-size trace */ @@ -56,18 +58,6 @@ size_t len; /**< Number of valid entries in stack */ }; -/** - * Self-assessed stacktrace symbol quality. - */ -enum stacktrace_sym_quality { - STACKTRACE_SYM_GOOD = 0, - STACKTRACE_SYM_STALE, - STACKTRACE_SYM_MISMATCH, - STACKTRACE_SYM_GARBAGE, - - STACKTRACE_SYM_MAX -}; - /* * Decoration flags for stack traces. */ @@ -119,6 +109,7 @@ const struct stackatom *stacktrace_get_atom(const struct stacktrace *st); const void *stacktrace_caller(size_t n); +const void *stacktrace_caller_fast(size_t n); bool stacktrace_caller_known(size_t offset); const void *stacktrace_routine_start(const void *pc); bool stacktrace_pc_within_our_text(const void *pc); @@ -131,8 +122,7 @@ void stacktrace_close(void); size_t stacktrace_memory_used(void); void stacktrace_crash_mode(void); -enum stacktrace_sym_quality stacktrace_quality(void); -const char *stacktrace_quality_string(const enum stacktrace_sym_quality sq); +enum symbol_quality stacktrace_quality(void); /** * @return function's name given a function pointer.
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/stats.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/stats.c
Changed
@@ -45,25 +45,45 @@ #include "override.h" /* Must be the last header included */ -enum statx_magic { STATX_MAGIC = 0x560044e5 }; +enum statx_magic { + STATX_MAGIC = 0x560044e5, /**< No data kept */ + STATX_DATA_MAGIC = 0x78dede41 /**< Data kept */ +}; -/** - * A one-dimension container (x). +/* + * Summed stats, no data history kept. */ struct statistics { enum statx_magic magic; /**< Magic number */ - elist_t data; /**< Data points */ long n; /**< Amount of data points */ double sx; /**< Sx: sum of all points */ double sx2; /**< Sx2: sum of the square of all points */ - bool no_data; /**< Do not keep data, it is managed externally */ +}; + +/** + * A one-dimension container (x). + */ +struct statistics_ext { + struct statistics stats; /** Must be the first member! */ + elist_t data; /**< Data points */ }; static inline void statx_check(const struct statistics * const sx) { g_assert(sx != NULL); - g_assert(STATX_MAGIC == sx->magic); + g_assert(STATX_MAGIC == sx->magic || STATX_DATA_MAGIC == sx->magic); +} + +static inline ALWAYS_INLINE struct statistics_ext * +cast_to_statistics_ext(const struct statistics *sx) +{ + statx_check(sx); + + if (STATX_DATA_MAGIC == sx->magic) + return (struct statistics_ext *) sx; + + return NULL; } /** @@ -85,12 +105,12 @@ statx_t * statx_make(void) { - statx_t *sx; + struct statistics_ext *sxe; - WALLOC0(sx); - sx->magic = STATX_MAGIC; - elist_init(&sx->data, offsetof(struct stat_datapoint, data_link)); - return sx; + WALLOC0(sxe); + sxe->stats.magic = STATX_DATA_MAGIC; + elist_init(&sxe->data, offsetof(struct stat_datapoint, data_link)); + return (statx_t *) sxe; } /** @@ -101,8 +121,8 @@ { statx_t *sx; - sx = statx_make(); - sx->no_data = TRUE; + WALLOC0(sx); + sx->magic = STATX_MAGIC; return sx; } @@ -112,11 +132,15 @@ void statx_free(statx_t *sx) { - statx_check(sx); + struct statistics_ext *sxe = cast_to_statistics_ext(sx); statx_clear(sx); sx->magic = 0; - WFREE(sx); + + if (NULL == sxe) + WFREE(sx); + else + WFREE(sxe); } /** @@ -139,9 +163,10 @@ void statx_clear(statx_t *sx) { - statx_check(sx); + struct statistics_ext *sxe = cast_to_statistics_ext(sx); - elist_wfree(&sx->data, sizeof(struct stat_datapoint)); + if (sxe != NULL) + elist_wfree(&sxe->data, sizeof(struct stat_datapoint)); sx->n = 0; sx->sx = 0.0; @@ -158,10 +183,12 @@ static void statx_opx(statx_t *sx, double val, stats_op_t op) { + struct statistics_ext *sxe = cast_to_statistics_ext(sx); + g_assert(op == STATS_OP_ADD || sx->n > 0); - g_assert(op == STATS_OP_ADD || 0 != elist_count(&sx->data) || sx->no_data); + g_assert(op == STATS_OP_ADD || NULL == sxe || 0 != elist_count(&sxe->data)); - if (!sx->no_data) { + if (sxe != NULL) { struct stat_datapoint *dp; if (op == STATS_OP_REMOVE) { @@ -169,11 +196,11 @@ * If value is removed, it must belong to the data set. */ - ELIST_FOREACH_DATA(&sx->data, dp) { + ELIST_FOREACH_DATA(&sxe->data, dp) { double delta = dp->value - val; if (fabs(delta) < 1e-56) { - elist_remove(&sx->data, dp); + elist_remove(&sxe->data, dp); WFREE(dp); break; } @@ -183,7 +210,7 @@ } else { WALLOC0(dp); dp->value = val; - elist_prepend(&sx->data, dp); + elist_prepend(&sxe->data, dp); } } @@ -222,11 +249,12 @@ { struct stat_datapoint *dp; double val = 0; + struct statistics_ext *sxe = cast_to_statistics_ext(sx); statx_check(sx); - g_assert(!sx->no_data); + g_assert_log(sxe != NULL, "must be keeping data"); g_assert(sx->n >= 0); - g_assert((sx->n > 0) ^ (0 == elist_count(&sx->data))); + g_assert((sx->n > 0) ^ (0 == elist_count(&sxe->data))); if (sx->n < 1) return; @@ -235,17 +263,17 @@ * Since we prepend new items to the list, the oldest item is the last. */ - dp = elist_tail(&sx->data); + dp = elist_tail(&sxe->data); g_assert(dp != NULL); /* We have at least one item */ val = dp->value; - elist_remove(&sx->data, dp); + elist_remove(&sxe->data, dp); WFREE(dp); sx->n--; sx->sx -= val; sx->sx2 -= val * val; - g_assert((sx->n > 0) ^ (0 == elist_count(&sx->data))); + g_assert((sx->n > 0) ^ (0 == elist_count(&sxe->data))); } /** @@ -310,15 +338,15 @@ double *array; int i; struct stat_datapoint *dp; + struct statistics_ext *sxe = cast_to_statistics_ext(sx); - statx_check(sx); - g_assert(!sx->no_data); + g_assert_log(sxe != NULL, "must be keeping data"); g_assert(sx->n > 0); HALLOC_ARRAY(array, sx->n); i = 0;
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/str.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/str.c
Changed
@@ -107,6 +107,32 @@ } /** + * Check the available room we have in string to add new bytes to it. + * + * A dynamic string that can be resized has no limits, but a string for + * which we do not own the data pointer cannot be resized and is therefore + * constrained. + * + * @return amount of available room in string. + */ +size_t +str_avail(const str_t *s) +{ + str_check(s); + + if (G_UNLIKELY(s->s_flags & STR_FOREIGN_PTR)) { + size_t avail = s->s_size - s->s_len; + if ('\0' == s->s_datas->s_len - 1) + avail++; /* Already NUL-terminated */ + if (avail <= 1) + return 0; /* Must leave room for tailing NUL */ + return avail - 1; /* Trailing NUL accounted */ + } + + return MAX_INT_VAL(size_t); /* No limits but virtual memory */ +} + +/** * Allocate a new non-leaking string structure. * * This should only be used with static string objects that are never freed. @@ -763,6 +789,33 @@ } /** + * Like str_2c() but starts at given offset. + * + * If the starting offset is negative, it is interpreted as an offset + * relative to the end of the string, i.e. -1 is the last character. + * + * @param s the string + * @param idx starting index + */ +char * +str_2c_from(str_t *s, ssize_t idx) +{ + size_t len; + + str_check(s); + + len = s->s_len; + + if (idx < 0) /* Stands for chars before end */ + idx += len; + + if G_UNLIKELY(idx < 0 || (size_t) idx >= len) /* Off string */ + return ""; /* Empty string! */ + + return str_2c(s) + idx; /* NUL-terminated string */ +} + +/** * Destroy the str_t container and keep only its data arena, returning a * pointer to it as a `C' string (NUL-terminated). * @@ -1066,6 +1119,9 @@ * If index is negative, insert from the end of the string, i.e. -1 means * before the last character, and so on. * + * As a convenience, act as str_putc() if index equals string length. + * This allows us to treat str_ichar(s, 0, ...) nicely even if s is empty. + * * @return TRUE if insertion took place, FALSE if it was ignored. */ bool @@ -1080,9 +1136,14 @@ if (idx < 0) /* Stands for chars before end */ idx += len; - if G_UNLIKELY(idx < 0 || (size_t) idx >= len) /* Off string */ + if G_UNLIKELY(idx < 0 || (size_t) idx > len) /* Off string */ return FALSE; + if G_UNLIKELY((size_t) idx == len) { + str_putc(str, c); + return TRUE; + } + str_makeroom(str, 1); memmove(str->s_data + idx + 1, str->s_data + idx, len - idx); str->s_dataidx = (uchar) c; @@ -1096,6 +1157,9 @@ * If index is negative, insert from the end of the string, i.e. -1 means * before the last character, etc... * + * As a convenience, act as str_cat() if index equals string length. + * This allows us to treat str_istr(s, 0, ...) nicely even if s is empty. + * * @return TRUE if insertion took place, FALSE if it was ignored. */ bool @@ -1110,6 +1174,9 @@ /** * Same as str_istr, only the first `n' chars of string are inserted. * + * As a convenience, act as str_cat_len() if index equals string length. + * This allows us to treat str_instr(s, 0, ...) nicely even if s is empty. + * * @return TRUE if insertion took place, FALSE if it was ignored. */ bool @@ -1129,9 +1196,14 @@ if (idx < 0) /* Stands for chars before end */ idx += len; - if G_UNLIKELY(idx < 0 || (size_t) idx >= len) /* Off string */ + if G_UNLIKELY(idx < 0 || (size_t) idx > len) /* Off string */ return FALSE; + if G_UNLIKELY((size_t) idx == len) { + str_cat_len(str, string, n); + return TRUE; + } + str_makeroom(str, n); memmove(str->s_data + idx + n, str->s_data + idx, len - idx); memmove(str->s_data + idx, string, n);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/str.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/str.h
Changed
@@ -63,16 +63,6 @@ g_assert(s->s_len <= s->s_size); } -/** - * @return available bytes in current string's buffer. - */ -static inline size_t -str_avail(const struct str * const s) -{ - str_check(s); - return s->s_size - s->s_len; -} - struct ckhunk; /* Avoids dependency on "ckalloc.h" here */ /* @@ -80,6 +70,7 @@ */ size_t str_len(const str_t *s) G_PURE; +size_t str_avail(const str_t *s) G_PURE; str_t *str_new(size_t szhint); str_t *str_new_from(const char *string); str_t *str_new_not_leaking(size_t szhint); @@ -95,6 +86,7 @@ void str_destroy(str_t *str); void str_destroy_null(str_t **s_ptr); char *str_2c(str_t *str); +char *str_2c_from(str_t *str, ssize_t idx); char *str_s2c_null(str_t **s_ptr); char *str_dup(const str_t *str); str_t *str_clone(const str_t *str);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/stringify.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/stringify.h
Changed
@@ -223,6 +223,13 @@ return 1 == v ? "f" : "ves"; } +/* Plural of "child" */ +static inline const char * +plural_child(const unsigned long v) +{ + return 1 == v ? "" : "ren"; +} + /* * Convenience macros to supply both the quantity argument and * the correct plural, in formatting arguments. @@ -238,6 +245,7 @@ #define PLURAL_Y(n) (n), plural_y(n) #define PLURAL_ES(n) (n), plural_es(n) #define PLURAL_F(n) (n), plural_f(n) +#define PLURAL_CHILD(n) (n), plural_child(n) #endif /* _stringify_h_ */
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/strvec.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/strvec.c
Changed
@@ -204,12 +204,6 @@ avail = *len; - if G_UNLIKELY(0 == avail) - return NULL; - - if G_UNLIKELY(0 == cnt) - return mem; - for (i = 0; i < cnt; i++) { size_t n = strsize(strvi);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/symbols.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/symbols.c
Changed
@@ -51,6 +51,7 @@ #include "htable.h" #include "log.h" #include "misc.h" +#include "omalloc.h" #include "parse.h" #include "path.h" #include "rwlock.h" @@ -113,14 +114,14 @@ * happened after the fact. * * These structures are linked together to form a single list that will be - * flushed as soon as symbols_set_verbose() is called. + * flushed to logs as soon as symbols_set_verbose() is called. */ struct symbols_loadinfo { enum symbols_loadinfo_magic magic; size_t count; size_t stripped; size_t offset; - char *path; + const char *path; const char *method; uint garbage:1; uint mismatch:1; @@ -146,35 +147,135 @@ #define SYMBOLS_LOADED_UNLOCK spinunlock(&symbols_loaded_slk) /** + * Return string version of the self-assessed symbol quality. + */ +const char * +symbol_quality_string(const enum symbol_quality sq) +{ + switch (sq) { + case SYMBOL_Q_GOOD: return "good"; + case SYMBOL_Q_STALE: return "stale"; + case SYMBOL_Q_MISMATCH: return "mismatch"; + case SYMBOL_Q_GARBAGE: return "garbage"; + case SYMBOL_Q_MAX: break; + } + + return "UNKNOWN"; +} + +/** + * Export internal info from `sli' into user-visible `uli' structure. + */ +static void +symbols_export_info( + struct symbol_load_info *uli, + const struct symbols_loadinfo *sli) +{ + symbols_loadinfo_check(sli); + +#define UCP(x) uli->x = sli->x + + UCP(count); + UCP(stripped); + UCP(offset); + UCP(path); + UCP(method); + UCP(secs); + UCP(when); + + if (sli->garbage) + uli->quality = SYMBOL_Q_GARBAGE; + else if (sli->mismatch) + uli->quality = SYMBOL_Q_MISMATCH; + else + uli->quality = SYMBOL_Q_GOOD; + +#undef UCP +} + +/** + * Iterate over the list of loaded symbols and invoke callback on each of + * them. + * + * The callback will be invoked with a "struct symbol_load_info" data. + * + * @param cb callback to invoke + * @param udata opaque user data supplied to callback + */ +void +symbols_load_foreach(cdata_fn_t cb, void *udata) +{ + const struct symbols_loadinfo *sli; + + SYMBOLS_LOADED_LOCK; + + ESLIST_FOREACH_DATA(&symbols_loaded, sli) { + struct symbol_load_info uli; + + symbols_export_info(&uli, sli); + (*cb)(&uli, udata); + } + + SYMBOLS_LOADED_UNLOCK; +} + +/** + * Return information about the first symbol load operation, NULL if none. + * This is a pointer to static data. + */ +const struct symbol_load_info * +symbols_load_first(void) +{ + const struct symbols_loadinfo *sli; + static struct symbol_load_info uli; + + SYMBOLS_LOADED_LOCK; + sli = eslist_head(&symbols_loaded); + SYMBOLS_LOADED_UNLOCK; + + if (NULL == sli) + return NULL; + + symbols_export_info(&uli, sli); + + return &uli; +} + +/** * Log symbol loading if requested. */ static void -symbols_log_loaded(const char *path, - const char *method, size_t count, size_t stripped, - size_t offset, bool garbage, bool mismatch, double secs, double ago) +symbols_log_loaded(const struct symbols_loadinfo *sli) { - if (symbols_verbose) { - char buf20; + char buf20; + tm_t now; + double ago; - buf0 = '\0'; - if (ago != 0.0) - str_bprintf(ARYLEN(buf), " %.3f secs ago", ago); + symbols_loadinfo_check(sli); - s_info("loaded %zu symbol%s for \"%s\" via %s in %.3f secs%s", - PLURAL(count), path, method, secs, buf); + if (!symbols_verbose) + return; - if (stripped != 0) { - s_message("stripped %zu duplicate symbol%s", PLURAL(stripped)); - } - if (offset != 0) { - s_message("will be offsetting symbol addresses by 0x%lx (%ld)", - (unsigned long) offset, (long) offset); - } - if (garbage) { - s_warning("loaded symbols are pure garbage"); - } else if (mismatch) { - s_warning("loaded symbols are partially inaccurate"); - } + tm_now_exact(&now); + ago = tm_elapsed_f(&now, &sli->when); + + buf0 = '\0'; + if (ago != 0.0) + str_bprintf(ARYLEN(buf), " %.3f secs ago", ago); + + s_info("loaded %zu symbol%s from \"%s\" via %s in %.3f secs%s", + PLURAL(sli->count), sli->path, sli->method, sli->secs, buf); + + if (sli->stripped != 0) + s_message("stripped %zu duplicate symbol%s", PLURAL(sli->stripped)); + if (sli->offset != 0) { + s_message("will be offsetting symbol addresses by 0x%lx (%ld)", + (unsigned long) sli->offset, (long) sli->offset); + } + if (sli->garbage) { + s_warning("loaded symbols are pure garbage"); + } else if (sli->mismatch) { + s_warning("loaded symbols are partially inaccurate"); } } @@ -187,33 +288,40 @@ const char *method, size_t count, size_t stripped, size_t offset, bool garbage, bool mismatch, double secs) { - SYMBOLS_LOADED_LOCK; + struct symbols_loadinfo *sli; - if (!symbols_verbose_set) { - struct symbols_loadinfo *sli; - - XMALLOC0(sli); - sli->magic = SYMBOLS_LOADINFO_MAGIC; - sli->path = xstrdup(path); - sli->method = method; - sli->count = count; - sli->stripped = stripped; - sli->offset = offset;
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/symbols.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/symbols.h
Changed
@@ -34,6 +34,8 @@ #ifndef _symbols_h_ #define _symbols_h_ +#include "tm.h" /* For tm_t */ + /** * An entry in the symbol table. */ @@ -45,11 +47,40 @@ struct symbols; typedef struct symbols symbols_t; +/** + * Self-assessed stacktrace symbol quality. + */ +enum symbol_quality { + SYMBOL_Q_GOOD = 0, + SYMBOL_Q_STALE, + SYMBOL_Q_MISMATCH, + SYMBOL_Q_GARBAGE, + + SYMBOL_Q_MAX +}; + +/** + * Give information about a symbol loading operation. + */ +struct symbol_load_info { + size_t count; /**> Amount of symbols loaded */ + size_t stripped; /**> Amount of stripped symbols (dups) */ + size_t offset; /**> Offsetting done to get symbol */ + const char *path; /**> File from which symbols were loaded */ + const char *method; /**> How symbols were loaded */ + enum symbol_quality quality; /**> Self-assessed quality */ + double secs; /**> Time spent processing symbols */ + tm_t when; /**> When were symbols loaded? */ +}; + /* * Public interface. */ +const char *symbol_quality_string(const enum symbol_quality sq); void symbols_set_verbose(bool verbose); +void symbols_load_foreach(cdata_fn_t cb, void *udata); +const struct symbol_load_info *symbols_load_first(void); symbols_t *symbols_make(size_t capacity, bool once); void symbols_free_null(symbols_t **st_ptr); const char *symbols_name(const symbols_t *st, const void *pc, bool offset); @@ -57,7 +88,7 @@ const char *symbols_name_light(const symbols_t *st, const void *pc, size_t *off); const void *symbols_addr(const symbols_t *st, const void *pc); void symbols_load_from(symbols_t *st, const char *path, const char *lpath); -enum stacktrace_sym_quality symbols_quality(const symbols_t *st); +enum symbol_quality symbols_quality(const symbols_t *st); size_t symbols_count(const symbols_t *st); void symbols_mark_stale(symbols_t *st); size_t symbols_memory_size(const symbols_t *st);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/thread-test.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/thread-test.c
Changed
@@ -1066,6 +1066,13 @@ (void) unused_sig; s_rawdebug("stack overflow signal properly caught!"); + + s_rawinfo("signal_on_altstack(() = %s", + bool_to_string(signal_on_altstack())); + s_rawinfo("thread_on_altstack(() = %s", + bool_to_string(thread_on_altstack())); + + g_assert(signal_on_altstack() == thread_on_altstack()); } static void *
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/thread.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/thread.c
Changed
@@ -740,7 +740,7 @@ * Compare two stack pointers according to the stack growth direction. * A pointer is larger than another if it is further away from the base. */ -static inline int +int thread_stack_ptr_cmp(const void *a, const void *b) { return thread_sp_direction > 0 ? ptr_cmp(a, b) : ptr_cmp(b, a); @@ -4589,8 +4589,15 @@ { const struct thread_element *te; + /* + * This will catch negative IDs as well, coming from + * thread_safe_small_id() for instance, which become + * large numbers in our unsigned argument. + */ + if (id >= THREAD_MAX) { - str_bprintf(b, len, "<invalid thread ID %u>", id); + /* Note the %d to print -1 and -2 nicely and the cast */ + str_bprintf(b, len, "<invalid thread ID %d>", (int) id); return b; } @@ -4956,7 +4963,7 @@ int thread_sighandler_level(void) { - struct thread_element *te = thread_get_element(); + const struct thread_element *te = thread_get_element(); return te->in_signal_handler; } @@ -4977,12 +4984,25 @@ unsigned thread_sig_generation(void) { - struct thread_element *te = thread_get_element(); + const struct thread_element *te = thread_get_element(); return te->sig_generation; } /** + * Get the known stack size for the thread. + * + * @return the stack size for created threads, 0 for discovered ones. + */ +size_t +thread_stack_size(void) +{ + const struct thread_element *te = thread_get_element(); + + return te->stack_size; +} + +/** * Check whether current thread, whose thread element is known, has been * cancelled. * @@ -5191,6 +5211,53 @@ } /** + * Suspend specific thread, without waiting for it to clear its locks. + * + * @param stid the thread to suspend + */ +void +thread_suspend(int stid) +{ + struct thread_element *xte; + + g_assert(UNSIGNED(stid) < THREAD_MAX); + + if (thread_small_id() == UNSIGNED(stid)) + return; /* Does not mean anything to suspend ourselves */ + + xte = threadsstid; + if (!xte->valid) + return; + + /* Note: done without a lock on "xte" using an atomic operation */ + atomic_int_inc(&xte->suspend); +} + +/** + * Unsuspend specific thread. + * + * @param stid the thread to unsuspend + */ +void +thread_unsuspend(int stid) +{ + struct thread_element *xte; + + g_assert(UNSIGNED(stid) < THREAD_MAX); + + if (thread_small_id() == UNSIGNED(stid)) + return; /* Does not mean anything to unsuspend ourselves */ + + xte = threadsstid; + if (!xte->valid) + return; + + /* Note: done without a lock on "xte" using an atomic operation */ + if (atomic_int_dec(&xte->suspend) <= 0) + s_error("%s(): %s was not suspended", G_STRFUNC, thread_id_name(stid)); +} + +/** * Suspend other threads (advisory, not kernel-enforced). * * This is voluntary suspension, which will only occur when threads actively @@ -7302,9 +7369,6 @@ thread_element_check(te); - if G_UNLIKELY(thread_lock_is_problematic()) - goto done; - tls = &te->waits; /* @@ -7330,6 +7394,9 @@ G_STRFUNC, thread_lock_kind_to_string(l->kind), l->lock, l->file, l->line, lock); + if G_UNLIKELY(thread_lock_is_problematic()) + goto done; + /* * Make sure the lock is not present in the waiting stack, or * we have a mismatch in the thread_lock_waiting_element() / @@ -7366,7 +7433,7 @@ * Record that current thread is waiting on the specified condition variable. * * This is used to allow signals to be delivered to threads whilst they - * are aslept, waiting in the condition variable. + * are asleep, waiting in the condition variable. * * @return the thread element as an opaque pointer that can be given back * to thread_cond_waiting_done() to skip the thread lookup. @@ -9638,7 +9705,7 @@ * In case PTHREAD_STACK_MIN is not defined by <pthread.h>. */ #ifndef PTHREAD_STACK_MIN -#define PTHREAD_STACK_MIN 0 +#define PTHREAD_STACK_MIN 1024U #endif /** @@ -9670,12 +9737,7 @@ pthread_attr_init(&attr); if (stack != 0) { - /* Avoid compiler warning when PTHREAD_STACK_MIN == 0 */ -#if PTHREAD_STACK_MIN != 0 stacksize = MAX(PTHREAD_STACK_MIN, stack); -#else - stacksize = stack; -#endif stacksize = MAX(stacksize, THREAD_STACK_MIN); } else { stacksize = MAX(THREAD_STACK_DFLT, PTHREAD_STACK_MIN); @@ -10183,7 +10245,7 @@ bool thread_is_exiting(void) { - struct thread_element *te = thread_get_element(); + const struct thread_element *te = thread_get_element(); return te->exit_started; } @@ -11296,6 +11358,18 @@ } /** + * Is current thread running on its alternate signal stack? + */ +bool +thread_on_altstack(void) +{ + struct thread_element *te = thread_get_element(); + thread_qid_t qid = thread_quasi_id_fast(&te);; + + return qid >= te->low_sig_qid && qid <= te->high_sig_qid; +} + +/** * Block thread until a signal is received or until we are explicitly unblocked. * * @note
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/thread.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/thread.h
Changed
@@ -63,7 +63,7 @@ typedef unsigned int thread_key_t; /* Local thread storage key */ #define THREAD_MAX 64 /**< Max amount of threads we can track */ -#define THREAD_STACK_DFLT (65536 * PTRSIZE) /**< Default stack requested */ +#define THREAD_STACK_DFLT (65536U * PTRSIZE) /**< Default stack requested */ #define THREAD_LOCAL_MAX 1024 /**< Max amount of thread-local keys */ #define THREAD_SUSPEND_TIMEOUT 90 /**< secs: thread max suspension time */ @@ -276,6 +276,9 @@ ssize_t thread_stack_diff(const void *sp) G_PURE; void thread_stack_check(void); +void thread_suspend(int stid); +void thread_unsuspend(int stid); + size_t thread_suspend_others(bool lockwait); size_t thread_unsuspend_others(void); bool thread_check_suspended(void); @@ -370,6 +373,7 @@ tsighandler_t thread_signal(int signum, tsighandler_t handler); int thread_sighandler_level(void); unsigned thread_sig_generation(void); +size_t thread_stack_size(void); bool thread_signal_has_pending(size_t locks); bool thread_signal_process(void); bool thread_pause(void); @@ -389,6 +393,8 @@ notify_data_fn_t completed, void *udata); void *thread_sp(void); +int thread_stack_ptr_cmp(const void *a, const void *b); +bool thread_on_altstack(void); void thread_cleanup_push_from(notify_fn_t cleanup, void *arg, const char *routine, const char *file, unsigned line, const void *sp);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/tm.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/tm.h
Changed
@@ -50,6 +50,11 @@ #define TM_ZERO { 0L, 0L } +/* + * For printing a tmval structure, as "%ld:%ld" for instance. + */ +#define TM_LONG(x) (x).tv_sec, (x).tv_usec + /** * Copies the timeval fields into our internal tmval structure. * @@ -80,6 +85,11 @@ #define TM_NANO_ZERO { 0L, 0L } +/* + * For printing a tmspec structure, as "%ld:%ld" for instance. + */ +#define TM_NANO_LONG(x) (x).tv_sec, (x).tv_nsec + /** * Copies the timespec fields into our internal tmspec structure. * @@ -252,6 +262,18 @@ return tmn2f(&elapsed); } +/** + * Computes the elapsed time (t1 - t0) and return duration in nanoseconds. + */ +static inline long +tm_precise_elapsed_ns(const tm_nano_t *t1, const tm_nano_t *t0) +{ + tm_nano_t elapsed; + + tm_precise_elapsed(&elapsed, t1, t0); + return tmn2ns(&elapsed); +} + extern tm_t tm_cached_now; /* Currently cached time */ /**
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/tmalloc.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/tmalloc.c
Changed
@@ -290,6 +290,9 @@ /* statistics */ struct tmalloc_stats tma_stats; + + /* flags */ + uint tma_protected:1; /* Whether objects (pages) can be protected */ }; static inline void @@ -602,6 +605,9 @@ * Chain the objects to free using their first pointer. */ + if (d->tma_protected) + vmm_validate(p, d->tma_size); + if G_UNLIKELY(NULL == tail) { head = tail = p; } else { @@ -700,6 +706,8 @@ while (m->tmag_count != 0) { void **p = m->tmag_objects--m->tmag_count; + if (d->tma_protected) + vmm_validate(p, d->tma_size); *p = d->tma_obj_trash; d->tma_obj_trash = p; d->tma_obj_trash_count++; @@ -791,6 +799,8 @@ d->tma_obj_trash = *p; /* Next in the chain */ d->tma_obj_trash_count--; fm->tmag_objectsfm->tmag_count++ = p; + if (d->tma_protected) + vmm_invalidate(p, d->tma_size); } g_assert(size_is_non_negative(d->tma_obj_trash_count)); @@ -1038,6 +1048,9 @@ g_assert((NULL == d->tma_obj_trash) == (0 == d->tma_obj_trash_count)); tmalloc_trash_list_check(d); + if (d->tma_protected) + vmm_validate(p, d->tma_size); + *(void **) p = d->tma_obj_trash; d->tma_obj_trash = p; d->tma_obj_trash_count++; @@ -2691,6 +2704,178 @@ } /** + * Check whether given magazine contains the specified pointer. + */ +static bool +tmalloc_magazine_contains(const tmalloc_magazine_t *mag, const void *p) +{ + int count, i; + + tmalloc_magazine_check(mag); + + count = mag->tmag_count; + g_assert_log(count >= 0 && count <= mag->tmag_capacity, + "%s(): count=%d, mag->tmag_capacity=%d", + G_STRFUNC, count, mag->tmag_capacity); + + for (i = 0; i < count; i++) { + if (mag->tmag_objectsi == p) + return TRUE; + } + + return FALSE; +} + +/* + * Check whether any of the magazines contain the pointer. + * + * @param tmt the thread-specific TM allocator + * @param p the pointer to check against + * @param local whether this belongs to the local thread + * + * @return TRUE if we found the pointer listed + */ +static bool +tmalloc_magazines_contains(const struct tmalloc_thread *tmt, + const void *p, bool local) +{ + bool found = FALSE; + size_t i; + + tmalloc_thread_check(tmt); + + if (!local) { + g_assert(tmt->tmt_stid != thread_small_id()); + thread_suspend(tmt->tmt_stid); + } + + for (i = 0; i < N_ITEMS(tmt->tmt_mag); i++) { + const tmalloc_magazine_t *mag = tmt->tmt_magi; + + if (mag != NULL && tmalloc_magazine_contains(mag, p)) { + found = TRUE; + goto done; + } + } + +done: + if (!local) + thread_unsuspend(tmt->tmt_stid); + + return found; +} + +struct tmalloc_contains_ctx { + const void *p; + bool found; +}; + +/** + * Callback from thread_foreach_local() to check whether magazine contains + * the pointer. + */ +static void +tmalloc_thread_contains(const void *data, void *udata) +{ + const struct tmalloc_thread *tmt = data; + struct tmalloc_contains_ctx *ctx = udata; + + tmalloc_thread_check(tmt); + + if (ctx->found) + return; + + /* We're looking in magazines from foreign threads, be careful */ + + ctx->found = tmalloc_magazines_contains(tmt, ctx->p, FALSE); +} + +/** + * Check whether allocator contains the given pointer. + * + * This is meant to be used by assertions, to detect double frees for instance. + * + * @note + * When `other' is TRUE, we also look at the magazines of other threads but + * because we do not lock them (there are no locks, these are thread-private + * data), we cannot be 100% certain that the pointer is not there. + * + * @param tma the thread magazine allocator + * @param p the pointer to check against + * @param other whether to "look" at magazines from other threads (unsafe!) + * + * @return TRUE if we found the block in the magazine(s) or the depot. + */ +bool +tmalloc_contains(tmalloc_t *tma, const void *p, bool other) +{ + const struct tmalloc_thread *tmt; + const tmalloc_magazine_t *m; + bool found = FALSE; + + tmalloc_check(tma); + g_assert(p != NULL); + + tmt = thread_local_get(tma->tma_key); + + if (tmt != NULL) { + tmalloc_thread_check(tmt); + g_assert(tmt->tmt_depot == tma); + + if (tmalloc_magazines_contains(tmt, p, TRUE)) + return TRUE; + } + + if (other) { + struct tmalloc_contains_ctx ctx; + + ZERO(&ctx); + ctx.p = p; + + thread_foreach_local(tma->tma_key, + THREAD_LOCAL_SKIP_SELF, tmalloc_thread_contains, &ctx); + + if (ctx.found) + return TRUE; + } + + TMALLOC_LOCK(tma); /* Keeping it long enough, make it visible */ + + ESLIST_FOREACH_DATA(&tma->tma_full.tml_trash, m) { + if (tmalloc_magazine_contains(m, p)) { + found = TRUE; + goto done; + } + } + + ESLIST_FOREACH_DATA(&tma->tma_full.tml_list, m) { + if (tmalloc_magazine_contains(m, p)) { + found = TRUE; + goto done;
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/tmalloc.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/tmalloc.h
Changed
@@ -116,9 +116,13 @@ void tmalloc_reset(tmalloc_t *tma); size_t tmalloc_size(const tmalloc_t *tma); +bool tmalloc_contains(tmalloc_t *tma, const void *p, bool other); + struct pslist; struct eslist; +void tmalloc_set_protected(tmalloc_t *tma, bool flag); + void *tmalloc(tmalloc_t *tma) G_MALLOC G_NON_NULL; void *tmalloc0(tmalloc_t *tma) G_MALLOC G_NON_NULL; void *tmalloc_smart(tmalloc_t *tma, tmalloc_better_fn_t cb, const void *p)
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/vmea.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/vmea.c
Changed
@@ -296,6 +296,7 @@ vr->allocations++; spinunlock(&vr->lock); vmea_stacktrace(size, TRUE); + vmm_validate(p, size); return p; } @@ -348,6 +349,8 @@ * We found memory that falls within the emergency region. Free it! */ + vmm_invalidate(p, size); + n = vmm_page_count(size); first = vmm_page_count(ptr_diff(p, vr->memory));
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/vmm.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/vmm.c
Changed
@@ -175,6 +175,30 @@ #define VMM_PROTECT_FREE_PAGES #endif +/* + * Add runtime assertions ensuring that the pmap is consistent with the + * blocks we are freeing. + */ +#if 0 +#define VMM_PMAP_CHECK +#endif + +/* + * Add runtime assertions to ensure we're not freeing a region that is + * already cached or held in a magazine, meaning it would be a duplicate free. + */ +#if 0 +#define VMM_CACHE_FREE_CHECK +#define VMM_MAGAZINE_FREE_CHECK +#endif + +/* + * Whether to verbosely log all operations. + */ +#if 0 +#define VMM_LOG_OPS +#endif + static size_t kernel_pagesize = 0; static size_t kernel_pagemask = 0; static unsigned kernel_pageshift = 0; @@ -459,6 +483,16 @@ #define vmm_debugging(lvl) G_UNLIKELY(vmm_debug > (lvl) && safe_to_log) +#ifdef VMM_LOG_OPS +#define vmm_rawdebug(...) \ +G_STMT_START { \ + if (!vmm_crashing) \ + s_rawdebug(__VA_ARGS__); \ +} G_STMT_END +#else +#define vmm_rawdebug(...) {} +#endif + bool vmm_is_debugging(uint32 level) { @@ -1776,10 +1810,11 @@ } } -static void +static inline void vmm_validate_pages(void *p, size_t size) { - g_assert(p); + g_assert(p != NULL); + g_assert(page_start(p) == p); g_assert(size_is_positive(size)); #ifdef VMM_PROTECT_FREE_PAGES mprotect(p, size, PROT_READ | PROT_WRITE); @@ -1790,10 +1825,21 @@ #endif /* VMM_INVALIDATE_FREE_PAGES */ } -static void +/** + * Validate page by ensuring `size' bytes starting at `p' are + * both readable and writable. + */ +void +vmm_validate(void *p, size_t size) +{ + vmm_validate_pages(p, size); +} + +static inline void vmm_invalidate_pages(void *p, size_t size) { - g_assert(p); + g_assert(p != NULL); + g_assert(page_start(p) == p); g_assert(size_is_positive(size)); if (G_UNLIKELY(stop_freeing)) @@ -1808,6 +1854,16 @@ } /** + * Invalidate pages, ensuring that any acccess to `size' bytes starting + * at `p' will result in a page fault (SIGSEGV with "invalid access"). + */ +void +vmm_invalidate(void *p, size_t size) +{ + vmm_invalidate_pages(p, size); +} + +/** * Insert region in the pmap, known to be native. */ static size_t @@ -2610,6 +2666,9 @@ g_assert(base != NULL); g_assert(size_is_positive(size)); + if G_UNLIKELY(vmm_crashing) + return; + if (locked) { /* * Must prevent deadlocks if we are called with a spinlock held. @@ -2643,6 +2702,97 @@ rwlock_runlock(&pm->lock); } +#ifdef VMM_PMAP_CHECK +static void +assert_pmap_allocated(const void *base, size_t size, vmf_type_t type) +{ + assert_vmm_is_allocated(base, size, type, FALSE); +} +#else /* !VMM_PMAP_CHECK */ +#define assert_pmap_allocated(b,s,t) +#endif /* VMM_PMAP_CHECK */ + +#ifdef VMM_CACHE_FREE_CHECK +static void +assert_not_cached(const char *caller, const void *p, size_t size) +{ + size_t i; + const void *end; + bool found = FALSE; + + if G_UNLIKELY(vmm_crashing) + return; + + end = const_ptr_add_offset(p, size); + + for (i = 0; i < N_ITEMS(page_cache) && !found; i++) { + struct page_cache *pc = &page_cachei; + size_t j; + + spinlock(&pc->lock); + + for (j = 0; j < pc->current; j++) { + const struct page_info *pi = &pc->infoj; + const void *pend = const_ptr_add_offset(pi->base, pc->chunksize); + + + if ( + /* p lies within cached region */ + (ptr_cmp(pi->base, p) <= 0 && ptr_cmp(p, pend) < 0) || + /* end lies well into cached region */ + (ptr_cmp(pi->base, end) < 0 && ptr_cmp(end, pend) < 0) + ) { + s_rawwarn("%s(): %zu-byte %p %s %zu-byte region %p, %p", + caller, size, p, + (ptr_cmp(pi->base, p) <= 0 && ptr_cmp(end, pend) <= 0) ? + "contained within" : "overlaps with", + pc->chunksize, pi->base, pend); + found = TRUE; + break; + } + + if (ptr_cmp(p, pi->base) <= 0 && ptr_cmp(pend, end) <= 0) { + s_rawwarn("%s(): %zu-byte %p contains %zu-byte region %p, %p", + caller, size, p, pc->chunksize, pi->base, pend); + found = TRUE; + break; + } + } + + spinunlock(&pc->lock); + } + + if (found) { + s_error("%s(): %zu-byte region %p, %p conficts with cached pages", + caller, size, p, end); + } +} +#else /* !VMM_CACHE_FREE_CHECK */ +#define assert_not_cached(c,p,s) +#endif /* VMM_CACHE_FREE_CHECK */ + +#ifdef VMM_MAGAZINE_FREE_CHECK +static void +assert_not_in_free_magazine(const char *caller, const void *p) +{ + size_t n; + + if G_UNLIKELY(vmm_crashing) + return; + + for (n = 1; n <= VMM_MAGAZINE_PAGEMAX; n++) { + tmalloc_t *depot = vmm_magazinen - 1; + + if (depot != NULL && tmalloc_contains(depot, p, TRUE)) { + s_error("%s(): %p found in %zu-page magazine",
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/vmm.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/vmm.h
Changed
@@ -173,6 +173,13 @@ int prot, int flags, int fd, fileoffset_t offset); int vmm_munmap(void *addr, size_t length); +/* + * These rely on the definition of some internal options in lib/vmm.c. + * By default, they are doing nothing. + */ +void vmm_validate(void *p, size_t size); +void vmm_invalidate(void *p, size_t size); + #define VMM_FREE_NULL(p, size) \ G_STMT_START { \ if (p) { \
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/waiter.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/waiter.c
Changed
@@ -72,9 +72,11 @@ #include "common.h" #include "waiter.h" + #include "elist.h" #include "fd.h" #include "spinlock.h" +#include "stringify.h" /* For PLURAL_CHILD() */ #include "thread.h" /* For thread_assert_no_locks() */ #include "walloc.h" @@ -525,7 +527,7 @@ G_STRFUNC, w, mw, mw->m_notified ? 'y' : 'n', mw->m_blocking ? 'y' : 'n', - mw->children, 1 == mw->children ? "" : "ren", + PLURAL_CHILD(mw->children), elist_count(&mw->idle), elist_count(&mw->active)); if (w->notified) {
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/walloc.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/walloc.c
Changed
@@ -872,6 +872,7 @@ static void wmagazine_reset_all(void) { +#ifndef REMAP_ZALLOC size_t i; for (i = 0; i < WZONE_SIZE; i++) { @@ -883,6 +884,7 @@ tmalloc_reset(d); } } +#endif /* !REMAP_ZALLOC */ } /**
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/wd.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/wd.c
Changed
@@ -100,8 +100,10 @@ WD_UNLOCK(wd); if (!run) { - s_critical("%s(): watchdog \"%s\" was already running trigger, skipped", - G_STRFUNC, wd_name(wd)); + s_critical("%s(): " + "watchdog \"%s\" was already running trigger %s(%p) -- skipped", + G_STRFUNC, wd_name(wd), + stacktrace_function_name(wd->trigger), wd->arg); return; } @@ -260,7 +262,7 @@ /** * Put the watchdog to sleep. * - * @return TRUE if we stopped the watchdog, FALSE if it was already aslept. + * @return TRUE if we stopped the watchdog, FALSE if it was already asleep. */ bool wd_sleep(watchdog_t *wd) @@ -277,30 +279,36 @@ } /** - * Trigger callback and then put the watchdog to sleep, ignoring any desire - * from the callback to re-arm the watchdog. + * If the watchdog was awoken, trigger callback and then put the watchdog to sleep, + * ignoring any desire from the callback to re-arm the watchdog. * - * @return TRUE if we stopped the watchdog, FALSE if it was already aslept, + * Does nothing if the watchdog was already asleep. + * + * @return TRUE if we stopped the watchdog, FALSE if it was already asleep, * or trigger was concurrently run, in which case the trigger was not invoked. */ bool wd_expire(watchdog_t *wd) { - bool run = TRUE; + bool run = TRUE, ignore = FALSE; watchdog_check(wd); WD_LOCK(wd); if (wd->triggering) { run = FALSE; } else { - if (cq_cancel(&wd->ev)) + if (NULL == wd->ev) + ignore = TRUE; + else if (cq_cancel(&wd->ev)) run = FALSE; else wd->triggering = TRUE; } WD_UNLOCK(wd); - if (run) { + if (ignore) { + run = FALSE; /* Nothing to do, nothing run */ + } else if (run) { (*wd->trigger)(wd, wd->arg); WD_LOCK(wd); @@ -314,8 +322,10 @@ } WD_UNLOCK(wd); } else { - s_critical("%s(): watchdog \"%s\" was already running trigger, skipped", - G_STRFUNC, wd_name(wd)); + s_critical("%s(): " + "watchdog \"%s\" was already running trigger %s(%p) -- skipped", + G_STRFUNC, wd_name(wd), + stacktrace_function_name(wd->trigger), wd->arg); } return run;
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/xmalloc.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/xmalloc.c
Changed
@@ -91,6 +91,7 @@ #include "vmm.h" #include "win32dlp.h" #include "xsort.h" +#include "zalloc.h" /* For zalloc_is_closing() */ #include "override.h" /* Must be the last header included */ @@ -110,7 +111,9 @@ #define xmalloc_round(s) \ ((size_t) (((unsigned long) (s) + XMALLOC_MASK) & ~XMALLOC_MASK)) -#if 8 == XMALLOC_ALIGNBYTES +#if 4 == XMALLOC_ALIGNBYTES +#define XMALLOC_ALIGNSHIFT 2 +#elif 8 == XMALLOC_ALIGNBYTES #define XMALLOC_ALIGNSHIFT 3 #elif 16 == XMALLOC_ALIGNBYTES #define XMALLOC_ALIGNSHIFT 4 @@ -697,6 +700,9 @@ static void xpages_pool_init(void) { + if (zalloc_is_closing()) + return; /* Too late to create a page pool! */ + xpages_pool = pool_create("xmalloc thread chunks", xmalloc_pagesize, xpages_pool_alloc, xpages_pool_free, NULL); } @@ -1193,7 +1199,7 @@ static bool xmalloc_is_valid_pointer(const void *p, bool locked) { - if (xmalloc_round(p) != pointer_to_ulong(p)) + if (NULL == p || xmalloc_round(p) != pointer_to_ulong(p)) return FALSE; if G_UNLIKELY(xmalloc_no_freeing) @@ -1371,6 +1377,108 @@ return &xfreelistidx; } +#ifdef XMALLOC_SORT_SAFETY +/** + * Verify that the freelist bucket is both valid AND sorted. + * + * @param caller caller name + * @param fl the freelist bucket + * @param low first index expected to be sorted + * @param count amount of items to check + * @param fmt explaination message, printf()-like + * @param ... variable printf arguments for message + */ +static void G_PRINTF(5, 6) +assert_xfl_sorted(const char *caller, + const struct xfreelist *fl, size_t low, size_t count, + const char *fmt, ...) +{ + size_t i; + size_t high = size_saturate_add(low, count); + const char *prev; + + assert_mutex_is_owned(&fl->lock); + + g_assert_log(low <= fl->count, + "%s(): low=%zu, count=%zu, fl->count=%zu", + G_STRFUNC, low, count, fl->count); + + /* Ensure freelist is valid */ + + for (i = 0; i < fl->count; i++) { + const void *p = fl->pointersi; + const char *what = NULL; + + if (NULL == p) + what = "NULL"; + else if (0 != (pointer_to_ulong(p) & XMALLOC_MASK)) + what = "unaligned"; + else if (*(size_t *) p != fl->blocksize) + what = "corrupted"; + + if (what != NULL) { + s_warning("%s(): XM freelist #%zu (%zu-byte blocks) has " + "%s block %p at index %zu (cnt=%zu, cap=%zu)", + caller, xfl_index(fl), fl->blocksize, + what, p, i, + fl->count, fl->capacity); + goto corrupted; + } + } + + if G_UNLIKELY(0 == fl->capacity) { + g_assert(NULL == fl->pointers); + return; + } + + /* Ensure freelist is properly sorted from `low' to `count' */ + + for (prev = fl->pointerslow, i = low + 1; i < high; i++) { + const char *cur = fl->pointersi; + + if (xm_ptr_cmp(prev, cur) >= 0) { + s_warning("%s(): XM freelist #%zu (%zu/%zu sorted) " + "items %zu-%zu unsorted: " + "breaks at item %zu (prev=%p, cur=%p)", + caller, + xfl_index(fl), fl->sorted, fl->count, low, high - 1, i, + prev, cur); + + goto corrupted; + } + + prev = cur; + } + + return; + +corrupted: + { + va_list args; + char buf80; + + va_start(args, fmt); + str_vbprintf(ARYLEN(buf), fmt, args); + va_end(args); + + s_info("%s(): XM freelist #%zu (%zu-byte blocks) dump of %zu entr%s:", + G_STRFUNC, xfl_index(fl), fl->blocksize, PLURAL_Y(fl->count)); + + for (i = 0; i < fl->count; i++) { + s_info("%8zu: %p%s", + i, fl->pointersi, i < fl->sorted ? "" : " U"); + } + + s_error_from(_WHERE_, "%s(): freelist #%zu corrupted %s, " + "fl->pointers=%p (cap=%zu, cnt=%zu, sort=%zu)", + caller, xfl_index(fl), buf, + fl->pointers, fl->capacity, fl->count, fl->sorted); + } +} +#else +#define assert_xfl_sorted(...) +#endif /* XMALLOC_SORT_SAFETY */ + /** * Replace the buckets's array of pointers. * @@ -1411,6 +1519,8 @@ g_assert(fl->capacity >= fl->count); /* Still has room for all items */ + assert_xfl_sorted(G_STRFUNC, fl, 0, fl->sorted, "after replacement"); + /* * Freelist bucket is now in a coherent state, we can unconditionally * release the old bucket even if it ends up being put in the same bucket @@ -1462,6 +1572,8 @@ g_assert(size_is_non_negative(fl->count)); g_assert(fl->shrinking); + assert_xfl_sorted(G_STRFUNC, fl, 0, fl->sorted, "before"); + old_ptr = fl->pointers; old_size = sizeof(void *) * fl->capacity; old_used = sizeof(void *) * fl->count; @@ -1698,8 +1810,7 @@ assert_valid_freelist_pointer(const struct xfreelist *fl, const void *p) { (void) fl; - (void) p; - /* Disabled */ + g_assert(p != NULL); } #endif /* XMALLOC_PTR_SAFETY */ @@ -1715,6 +1826,8 @@ size_t i; assert_mutex_is_owned(&fl->lock); + assert_valid_freelist_pointer(fl, p); + assert_xfl_sorted(G_STRFUNC, fl, 0, fl->sorted, "before removal"); g_assert(size_is_positive(fl->count)); g_assert(fl->count >= fl->sorted); @@ -1740,6 +1853,8 @@ if (i < fl->sorted) fl->sorted--; + assert_xfl_sorted(G_STRFUNC, fl, 0, fl->sorted, "after removal"); + /* * Forbid any bucket shrinking as we could be in the middle of a bucket * allocation and that could cause harmful recursion. @@ -1887,6 +2002,7 @@ size_t old_size, old_used, new_size = 0, allocated_size; assert_mutex_is_owned(&fl->lock); + assert_xfl_sorted(G_STRFUNC, fl, 0, fl->sorted, "before"); g_assert(fl->extending);
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/xmalloc.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/xmalloc.h
Changed
@@ -59,6 +59,10 @@ #undef XMALLOC_IS_MALLOC #endif +#ifdef TRACK_MALLOC +#undef XMALLOC_IS_MALLOC +#endif + /** * Memory alignment constraints. * @@ -185,10 +189,9 @@ size_t xallocated(const void *p); size_t xpallocated(const void *p); -#ifdef TRACK_MALLOC bool xmalloc_block_info(const void *p, uint *tid, size_t *len); -#endif +#ifndef TRACK_MALLOC static inline void * G_MALLOC G_NON_NULL xcopy(const void *p, size_t size) { @@ -196,6 +199,7 @@ memcpy(cp, p, size); return cp; } +#endif /* !TRACK_MALLOC */ #define XCOPY(p) xcopy(p, sizeof *p)
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/zalloc.c -> gtk-gnutella-1.2.2.tar.xz/src/lib/zalloc.c
Changed
@@ -236,7 +236,9 @@ static hash_table_t *not_leaking; static hash_table_t *alloc_used_to_real; static hash_table_t *alloc_real_to_used; +#ifndef REMAP_ZALLOC static spinlock_t zleak_lock = SPINLOCK_INIT; +#endif #define ZLEAK_LOCK spinlock(&zleak_lock) #define ZLEAK_UNLOCK spinunlock(&zleak_lock) #endif @@ -245,7 +247,7 @@ #endif /* - * Optional additional overhead at the beginning of each block: + * Optional additional overhead at the beginning of each allocated block: * * +---------------------+ <---- OVH_ZONE_SAFE_OFFSET ^ * | BLOCK_USED magic | ZONE_SAFE | OVH_ZONE_SAFE_LEN @@ -407,6 +409,7 @@ return OVH_LENGTH; } +#ifndef REMAP_ZALLOC /** * @return static thread-private verbose description of zone, for debugging clues. */ @@ -437,6 +440,7 @@ return b; } +#endif /* !REMAP_ZALLOC */ /* Under REMAP_ZALLOC, map zalloc() and zfree() to g_malloc() and g_free() */ @@ -459,6 +463,9 @@ { (void) overloaded; } +#define zrange_clear(z) +#define zlock(zone) +#define zunlock(zone) #else /* !REMAP_ZALLOC */ static char **zn_extend(zone_t *); @@ -713,7 +720,12 @@ (void) zone; #ifdef ZONE_SAFE *blk++ = BLOCK_USED; - *blk++ = (char *) zone; + /* Blocks are tagged via zfmark() at cramming time */ + if G_UNLIKELY(*blk != (char *) zone) { + s_error("free block %p corrupted in %zu-byte zone %p (tag is %p)", + blk - 1, zone_size(zone), zone, *blk); + } + blk++; #endif #ifdef TRACK_ZALLOC blk = ptr_add_offset(blk, OVH_TRACK_LEN); @@ -1091,7 +1103,7 @@ * the wrong zone and that the block is indeed still allocated. * * @param zone the zone to which the pointer must belong - * @param ptr address of block + * @param ptr address of block (user pointer, past our overhead) * @param what what we are trying to do ("free block", "move block", ...) */ #ifdef ZONE_SAFE @@ -1125,6 +1137,28 @@ #endif /* ZONE_SAFE */ /** + * Mark that (free) block belongs to a given zone during zone cramming. + * + * @param zone the zone to which the pointer must belong + * @param ptr physical address of block (start of overhead) + * + * @return pointer to start of block as a convenience. + */ +#ifdef ZONE_SAFE +static inline void * +zfmark(const zone_t *zone, void *ptr) +{ + char **tmp = ptr; /* We're given the start of a physical block */ + + tmp1 = (char *) zone; + + return ptr; +} +#else /* !ZONE_SAFE */ +#define zfmark(z,p) cast_to_void_ptr(p) +#endif /* ZONE_SAFE */ + +/** * Return user pointer to (already locked) zone. */ static inline void @@ -1317,10 +1351,10 @@ while (ptr_cmp(&psize, last) <= 0) { blocks++; - next = cast_to_void_ptr(p); + next = zfmark(zone, p); p = *next = &psize; } - next = cast_to_void_ptr(p); + next = zfmark(zone, p); *next = NULL; return blocks; @@ -1876,8 +1910,10 @@ * zone is not really locked) */ +#ifndef REMAP_ZALLOC if (zone->private) zunlock(zone); +#endif spinlock_destroy(&zone->lock); @@ -1935,6 +1971,7 @@ return TRUE; } +#ifndef REMAP_ZALLOC /** * Get a zone suitable for allocating blocks of 'size' bytes. * `hint' represents the desired amount of blocks per subzone. @@ -2042,11 +2079,7 @@ if G_LIKELY(NULL == zone->zn_gc) return p; -#ifdef REMAP_ZALLOC - return p; -#else return zgc_zmove(zone, p); -#endif } /** @@ -2089,6 +2122,7 @@ return n; } +#endif /* !REMAP_ZALLOC */ /** * Iterator callback on hash table. @@ -2112,6 +2146,15 @@ } /** + * Is zalloc() closing? + */ +bool +zalloc_is_closing(void) +{ + return zalloc_closing; +} + +/** * Close the zone allocator, destroying all the remaining zones regardless * of their reference count. */ @@ -3621,6 +3664,7 @@ void G_COLD zalloc_memusage_init(void) { +#ifndef REMAP_ZALLOC zone_t **zones; size_t i, count; @@ -3654,6 +3698,7 @@ } xfree(zones); +#endif /* REMAP_ZALLOC */ } /** @@ -3966,6 +4011,10 @@ void G_COLD zalloc_dump_stats_log(logagent_t *la, unsigned options) { +#ifdef REMAP_ZALLOC + (void) options; + log_info(la, "ZALLOC zalloc() is remapped via REMAP_ZALLOC"); +#else /* !REMAP_ZALLOC */ struct zstats stats; bool groupped = booleanize(options & DUMP_OPT_PRETTY); @@ -4028,6 +4077,7 @@ #undef DUMP #undef DUMP64 +#endif /* REMAP_ZALLOC */ } /**
View file
gtk-gnutella-1.2.0.tar.xz/src/lib/zalloc.h -> gtk-gnutella-1.2.2.tar.xz/src/lib/zalloc.h
Changed
@@ -114,6 +114,7 @@ void zalloc_dump_zones_log(struct logagent *la); void zalloc_show_settings(void); void zalloc_show_settings_log(struct logagent *la); +bool zalloc_is_closing(void); void zone_info(const zone_t *, zone_info_t *); @@ -138,9 +139,7 @@ void zalloc_shift_pointer(const void *allocated, const void *used); #endif -#if defined(TRACK_MALLOC) && !defined(REMAP_ZALLOC) bool zalloc_zone_info(const void *p, size_t *size); -#endif #endif /* _zalloc_h_ */
View file
gtk-gnutella-1.2.0.tar.xz/src/main.c -> gtk-gnutella-1.2.2.tar.xz/src/main.c
Changed
@@ -257,6 +257,7 @@ main_arg_minimized, main_arg_no_build_version, main_arg_no_dbus, + main_arg_no_expire, main_arg_no_halloc, main_arg_no_restart, main_arg_no_supervise, @@ -323,6 +324,11 @@ #endif /* USE_TOPLESS */ OPTION(no_build_version,NONE, NULL), /* hidden option */ OPTION(no_dbus, NONE, "Disable D-BUS notifications."), +#ifdef USE_TOPLESS + OPTION(no_expire, NONE, NULL), /* accept but hide */ +#else + OPTION(no_expire, NONE, "Disable expired popup notifications."), +#endif #ifdef USE_HALLOC OPTION(no_halloc, NONE, "Disable malloc() replacement."), #else @@ -2135,7 +2141,7 @@ children++; aging_record(ag, ulong_to_pointer(children)); setproctitle("supervisor, %lu child%s launched", - children, 1 == children ? "" : "ren"); + PLURAL_CHILD(children)); s_info("launched child #%lu as PID %lu", children, (ulong) pid); @@ -2152,7 +2158,7 @@ if (0 == status) { s_info("supervisor exiting, launched %lu child%s over %s", - children, 1 == children ? "" : "ren", + PLURAL_CHILD(children), short_time_ascii(delta_time(end, progstart_time().tv_sec))); exit(EXIT_SUCCESS); } @@ -2164,7 +2170,7 @@ done: s_info("supervisor exiting on failure, launched %lu child%s over %s", - children, 1 == children ? "" : "ren", + PLURAL_CHILD(children), short_time_ascii(delta_time(tm_time_exact(), progstart_time().tv_sec))); exit(EXIT_FAILURE); @@ -2388,12 +2394,13 @@ * --daemonize switch is used. * * It can only be called after settings_early_init() since this - * is where the crash directory is initialized. + * is where the config directory is initialized. */ settings_early_init(); - crash_setdir(settings_crash_dir()); handle_arguments(); /* Returning from here means we're good to go */ + + crash_setdir(settings_crash_dir()); stacktrace_post_init(); /* And for possibly (hopefully) a long time */ /* @@ -2536,6 +2543,7 @@ if (!running_topless) { main_gui_early_init(argc, argv, OPT(no_xshm)); + main_gui_disable_ancient(OPT(no_expire)); } upload_stats_load_history(); /* Loads the upload statistics */
View file
gtk-gnutella-1.2.0.tar.xz/src/shell/horizon.c -> gtk-gnutella-1.2.2.tar.xz/src/shell/horizon.c
Changed
@@ -193,6 +193,8 @@ PSLIST_FOREACH(node_all_gnet_nodes(), sl) { const gnutella_node_t *n = sl->data; + node_check(n); + if ((!NODE_IS_ESTABLISHED(n)) || !(n->attrs & NODE_A_CAN_HSEP)) continue;
View file
gtk-gnutella-1.2.0.tar.xz/src/shell/nodes.c -> gtk-gnutella-1.2.2.tar.xz/src/shell/nodes.c
Changed
@@ -115,6 +115,7 @@ PSLIST_FOREACH(node_all_nodes(), sl) { const gnutella_node_t *n = sl->data; + node_check(n); print_node_info(sh, n); } shell_write(sh, ".\n"); /* Terminate message body */
View file
gtk-gnutella-1.2.0.tar.xz/src/shell/props.c -> gtk-gnutella-1.2.2.tar.xz/src/shell/props.c
Changed
@@ -48,12 +48,14 @@ enum shell_reply shell_exec_props(struct gnutella_shell *sh, int argc, const char *argv) { - const char *values; + const char *values, *exact, *ignore; const option_t options = { + { "e", &exact }, + { "i", &ignore }, { "v", &values }, }; int parsed; - pslist_t *props, *sl; + pslist_t *props = NULL, *sl; shell_check(sh); g_assert(argv); @@ -66,8 +68,31 @@ argv += parsed; /* args0 is first command argument */ argc -= parsed; /* counts only command arguments now */ - props = gnet_prop_get_by_regex(argc > 0 ? argv0 : ".", NULL); - if (!props) { + if (0 == argc) { + /* No argument: means all the properties, regardless of -e */ + props = gnet_prop_get_by_regex(".", NULL); + } else { + int i; + + for (i = 0; i < argc; i++) { + pslist_t *matching; + + if (exact) { + property_t id = gnet_prop_get_by_name(argvi); + + if (NO_PROP == id) + matching = NULL; + else + matching = pslist_append(NULL, uint_to_pointer(id)); + } else { + matching = gnet_prop_get_by_regex(argvi, NULL); + } + + props = pslist_concat(props, matching); + } + } + + if (NULL == props && !ignore) { shell_set_msg(sh, _("No matching property.")); return REPLY_ERROR; } @@ -103,9 +128,11 @@ g_assert(argv); g_assert(argc > 0); - return "props -v <regexp>\n" + return "props -eiv <regexp> <regexp_2> ... <regexp_n>\n" "Display all properties, or those matching\n" - "the regular expression supplied.\n" + "the regular expression (or string if -e) supplied.\n" + "-e: exact, treat arguments as property names\n" + "-i: ignore non-matching arguments silently\n" "-v: also display property values\n"; }
View file
gtk-gnutella-1.2.0.tar.xz/src/shell/status.c -> gtk-gnutella-1.2.2.tar.xz/src/shell/status.c
Changed
@@ -70,9 +70,10 @@ enum shell_reply shell_exec_status(struct gnutella_shell *sh, int argc, const char *argv) { - const char *cur; + const char *cur, *tot; const option_t options = { { "i", &cur }, + { "t", &tot }, }; int parsed; char buf2048; @@ -304,43 +305,68 @@ short_string_t gnet_in, http_in, leaf_in, gnet_out, http_out, leaf_out; short_string_t dht_in, dht_out; gnet_bw_stats_t bw_stats, bw2_stats; - const char *bwtype = cur ? "(cur)" : "(avg)"; - - gnet_get_bw_stats(BW_GNET_IN, &bw_stats); - gnet_get_bw_stats(BW_GNET_UDP_IN, &bw2_stats); - gnet_in = short_rate_get_string( - cur ? bw_stats.current + bw2_stats.current - : bw_stats.average + bw2_stats.average, metric); - - gnet_get_bw_stats(BW_GNET_OUT, &bw_stats); - gnet_get_bw_stats(BW_GNET_UDP_OUT, &bw2_stats); - gnet_out = short_rate_get_string( - cur ? bw_stats.current + bw2_stats.current - : bw_stats.average + bw2_stats.average, metric); - - gnet_get_bw_stats(BW_HTTP_IN, &bw_stats); - http_in = short_rate_get_string( - cur ? bw_stats.current : bw_stats.average, metric); - - gnet_get_bw_stats(BW_HTTP_OUT, &bw_stats); - http_out = short_rate_get_string( - cur ? bw_stats.current : bw_stats.average, metric); - - gnet_get_bw_stats(BW_LEAF_IN, &bw_stats); - leaf_in = short_rate_get_string( - cur ? bw_stats.current : bw_stats.average, metric); - - gnet_get_bw_stats(BW_LEAF_OUT, &bw_stats); - leaf_out = short_rate_get_string( - cur ? bw_stats.current : bw_stats.average, metric); - - gnet_get_bw_stats(BW_DHT_IN, &bw_stats); - dht_in = short_rate_get_string( - cur ? bw_stats.current : bw_stats.average, metric); - - gnet_get_bw_stats(BW_DHT_OUT, &bw_stats); - dht_out = short_rate_get_string( - cur ? bw_stats.current : bw_stats.average, metric); + const char *bwtype = tot ? "(sum)" : cur ? "(cur)" : "(avg)"; + + if (tot) { + gnet_in = long_value_get_string( + GNET_PROPERTY(bc_gnet_tcp_up_in) + + GNET_PROPERTY(bc_gnet_udp_in), metric); + + gnet_out = long_value_get_string( + GNET_PROPERTY(bc_gnet_tcp_up_out) + + GNET_PROPERTY(bc_gnet_udp_out), metric); + + http_in = + long_value_get_string(GNET_PROPERTY(bc_http_in), metric); + http_out = + long_value_get_string(GNET_PROPERTY(bc_http_out), metric); + + leaf_in = long_value_get_string( + GNET_PROPERTY(bc_gnet_tcp_leaf_in), metric); + leaf_out = long_value_get_string( + GNET_PROPERTY(bc_gnet_tcp_leaf_out), metric); + + dht_in = + long_value_get_string( GNET_PROPERTY(bc_dht_in), metric); + dht_out = + long_value_get_string(GNET_PROPERTY(bc_dht_out), metric); + } else { + gnet_get_bw_stats(BW_GNET_IN, &bw_stats); + gnet_get_bw_stats(BW_GNET_UDP_IN, &bw2_stats); + gnet_in = short_rate_get_string( + cur ? bw_stats.current + bw2_stats.current + : bw_stats.average + bw2_stats.average, metric); + + gnet_get_bw_stats(BW_GNET_OUT, &bw_stats); + gnet_get_bw_stats(BW_GNET_UDP_OUT, &bw2_stats); + gnet_out = short_rate_get_string( + cur ? bw_stats.current + bw2_stats.current + : bw_stats.average + bw2_stats.average, metric); + + gnet_get_bw_stats(BW_HTTP_IN, &bw_stats); + http_in = short_rate_get_string( + cur ? bw_stats.current : bw_stats.average, metric); + + gnet_get_bw_stats(BW_HTTP_OUT, &bw_stats); + http_out = short_rate_get_string( + cur ? bw_stats.current : bw_stats.average, metric); + + gnet_get_bw_stats(BW_LEAF_IN, &bw_stats); + leaf_in = short_rate_get_string( + cur ? bw_stats.current : bw_stats.average, metric); + + gnet_get_bw_stats(BW_LEAF_OUT, &bw_stats); + leaf_out = short_rate_get_string( + cur ? bw_stats.current : bw_stats.average, metric); + + gnet_get_bw_stats(BW_DHT_IN, &bw_stats); + dht_in = short_rate_get_string( + cur ? bw_stats.current : bw_stats.average, metric); + + gnet_get_bw_stats(BW_DHT_OUT, &bw_stats); + dht_out = short_rate_get_string( + cur ? bw_stats.current : bw_stats.average, metric); + } str_bprintf(ARYLEN(buf), "| %-70s|\n" @@ -395,9 +421,10 @@ g_assert(argv); g_assert(argc > 0); - return "status -i\n" + return "status -it\n" "Display status pane summary\n" "-i : display instantaneous bandwidth instead of average\n" + "-t : display total bandwidth used instead\n" "Upper-right corner flags mimic status icons in the GUI:\n" "(from left to right in lightening order)\n" " UMP port mapping configured via UPnP\n"
View file
gtk-gnutella-1.2.0.tar.xz/src/ui/gtk/gtk1/gtk-gnutella.glade -> gtk-gnutella-1.2.2.tar.xz/src/ui/gtk/gtk1/gtk-gnutella.glade
Changed
@@ -13653,7 +13653,7 @@ <widget> <class>GtkLabel</class> <name>label718</name> - <label>Meet us on #gtk-gnutella at irc.freenode.net.</label> + <label>Meet us on #gtk-gnutella at irc.libera.chat.</label> <justify>GTK_JUSTIFY_CENTER</justify> <wrap>False</wrap> <xalign>0.5</xalign>
View file
gtk-gnutella-1.2.0.tar.xz/src/ui/gtk/gtk1/interface-glade.c -> gtk-gnutella-1.2.2.tar.xz/src/ui/gtk/gtk1/interface-glade.c
Changed
@@ -10189,7 +10189,7 @@ gtk_widget_show (label717); gtk_box_pack_start (GTK_BOX (vbox133), label717, FALSE, FALSE, 0); - label718 = gtk_label_new (_("Meet us on #gtk-gnutella at irc.freenode.net.")); + label718 = gtk_label_new (_("Meet us on #gtk-gnutella at irc.libera.chat.")); gtk_widget_set_name (label718, "label718"); gtk_widget_ref (label718); gtk_object_set_data_full (GTK_OBJECT (dlg_about), "label718", label718,
View file
gtk-gnutella-1.2.0.tar.xz/src/ui/gtk/gtk1/interface-glade.t -> gtk-gnutella-1.2.2.tar.xz/src/ui/gtk/gtk1/interface-glade.t
Changed
@@ -298,7 +298,7 @@ N_("Maximum size\n" "allowed"); N_("Maximum"); N_("Measured HTTP latency:"); -N_("Meet us on #gtk-gnutella at irc.freenode.net."); +N_("Meet us on #gtk-gnutella at irc.libera.chat."); N_("Min/Max:"); N_("Minimum chunk size"); N_("Minimum file size");
View file
gtk-gnutella-1.2.0.tar.xz/src/ui/gtk/gtk2/gtk-gnutella.glade -> gtk-gnutella-1.2.2.tar.xz/src/ui/gtk/gtk2/gtk-gnutella.glade
Changed
@@ -2022,7 +2022,7 @@ <widget class="GtkLabel" id="label491"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Meet us on #gtk-gnutella at irc.freenode.net.</property> + <property name="label" translatable="yes">Meet us on #gtk-gnutella at libera.chat.</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
View file
gtk-gnutella-1.2.0.tar.xz/src/ui/gtk/gtk2/interface-glade.c -> gtk-gnutella-1.2.2.tar.xz/src/ui/gtk/gtk2/interface-glade.c
Changed
@@ -1253,7 +1253,7 @@ gtk_widget_show (label490); gtk_box_pack_start (GTK_BOX (vbox67), label490, FALSE, TRUE, 0); - label491 = gtk_label_new (_("Meet us on #gtk-gnutella at irc.freenode.net.")); + label491 = gtk_label_new (_("Meet us on #gtk-gnutella at libera.chat.")); gtk_widget_set_name (label491, "label491"); gtk_widget_show (label491); gtk_box_pack_start (GTK_BOX (vbox67), label491, FALSE, TRUE, 0);
View file
gtk-gnutella-1.2.0.tar.xz/src/ui/gtk/gui.h -> gtk-gnutella-1.2.2.tar.xz/src/ui/gtk/gui.h
Changed
@@ -32,6 +32,7 @@ #define settings_gui_shutdown() #define main_gui_early_init(argc, argv, disable_xshm) +#define main_gui_disable_ancient(v) #define main_gui_init() #define main_gui_run(a, b) #define main_gui_exit(x)
View file
gtk-gnutella-1.2.0.tar.xz/src/ui/gtk/main.c -> gtk-gnutella-1.2.2.tar.xz/src/ui/gtk/main.c
Changed
@@ -834,6 +834,20 @@ } #endif +static bool opt_ancien_is_disabled = FALSE; + +bool +main_gui_ancient_is_disabled(void) +{ + return opt_ancien_is_disabled; +} + +void +main_gui_disable_ancient(bool v) +{ + opt_ancien_is_disabled = v; +} + /** * Some setup of the gui side which I wanted out of main.c but must be done * before the backend can be initialized since the core code is not free of
View file
gtk-gnutella-1.2.0.tar.xz/src/ui/gtk/main.h -> gtk-gnutella-1.2.2.tar.xz/src/ui/gtk/main.h
Changed
@@ -59,6 +59,7 @@ #undef WIDGET void main_gui_early_init(gint argc, gchar **argv, gboolean disable_xshm); +void main_gui_disable_ancient(bool v); void main_gui_init(void); void main_gui_exit(int n); void main_gui_run(const gchar *geometry_spec, const gboolean minimized); @@ -68,6 +69,7 @@ void main_gui_show_prefences(void); gboolean main_gui_window_visible(void); +bool main_gui_ancient_is_disabled(void); typedef void (*main_gui_visibility_cb)(gboolean visible);
View file
gtk-gnutella-1.2.0.tar.xz/src/ui/gtk/settings.c -> gtk-gnutella-1.2.2.tar.xz/src/ui/gtk/settings.c
Changed
@@ -1414,13 +1414,15 @@ void ancient_version_dialog_show(void) { - ancient_version_dialog(TRUE); + if (!main_gui_ancient_is_disabled()) + ancient_version_dialog(TRUE); } void ancient_version_dialog_hide(void) { - ancient_version_dialog(FALSE); + if (!main_gui_ancient_is_disabled()) + ancient_version_dialog(FALSE); } static gboolean
View file
gtk-gnutella-1.2.0.tar.xz/src/ui/gtk/statusbar.c -> gtk-gnutella-1.2.2.tar.xz/src/ui/gtk/statusbar.c
Changed
@@ -49,6 +49,7 @@ #include "lib/override.h" /* Must be the last header included */ static const statusbar_msgid_t zero_msgid; +static bool statusbar_inited; /** * Timeout entry for statusbar messages. @@ -113,7 +114,8 @@ if (format != NULL) { switch (type) { case SB_WARNING: - gdk_beep(); + if (statusbar_inited) + gdk_beep(); /* FALL THRU */ case SB_MESSAGE: str_vbprintf(ARYLEN(buf), format, args); @@ -123,6 +125,18 @@ buf0 = '\0'; } + /* + * We must guard against early messages sent to the statusbar before + * the GUI is initialized. + * --RAM, 2020-07-30 + */ + + if G_UNLIKELY(!statusbar_inited) { + if (buf0 != '\0') + g_message("statusbar %s", buf); + return zero_msgid; + } + id.scid = scid; id.msgid = gtk_statusbar_push(statusbar_get(), scid, buf); @@ -330,11 +344,13 @@ statusbar_gui_push(SB_MESSAGE, scid_bottom, 0, "%s", statbar_botstr); main_gui_add_timer(statusbar_gui_clear_timeouts); + statusbar_inited = TRUE; } void statusbar_gui_shutdown(void) { + statusbar_inited = FALSE; statusbar_gui_free_timeout_list(); HFREE_NULL(statbar_botstr_new); HFREE_NULL(statbar_botstr);
View file
gtk-gnutella-1.2.0.tar.xz/src/xml/vxml.c -> gtk-gnutella-1.2.2.tar.xz/src/xml/vxml.c
Changed
@@ -260,13 +260,13 @@ const char *charset; /**< Document's charset (atom) */ pslist_t *input; /**< List of input buffers to parse */ plist_t *path; /**< Path (list of vxml_path_entry) */ - nv_table_t *tokens; /**< For element tokenization */ + nv_table_t *tokens; /**< For element tokenisation */ nv_table_t *entities; /**< Entities defined in document */ nv_table_t *pe_entities; /**< Entities defined in <!DOCTYPE...> */ xattr_table_t *attrs; /**< Current element attributes */ symtab_t *namespaces; /**< Symbol table for namespaces */ const char *element; /**< Current element (atom, NULL if none) */ - const char *namespace; /**< Element's namesapace (atom, or NULL) */ + const char *namespace; /**< Element's namespace (atom, or NULL) */ char *user_error; /**< User-defined error string */ struct vxml_output out; /**< Output parsing buffer (UTF-8) */ struct vxml_output entity; /**< Entity parsing buffer (UTF-8) */ @@ -582,7 +582,7 @@ /** * Get current element's name. * - * This can be used in tokenized callabacks for logging purposes. + * This can be used in tokenized callbacks for logging purposes. * * @return the current element's name. */ @@ -604,7 +604,7 @@ /** * Get the name of the element's parent. * - * This can be used in tokenized callabacks for logging purposes. + * This can be used in tokenized callbacks for logging purposes. * * @return the parent element's name, or NULL if the current element is * already the root element. @@ -631,7 +631,7 @@ * Get the name of the nth enclosing parent of the current element, n=1 * being the immediate parent, n=0 being the current element. * - * @return te n-th parent element's name (in a path from the current element + * @return the nth parent element's name (in a path from the current element * towards the root of the tree) or NULL if there are not enough parents * to move up. */ @@ -662,7 +662,7 @@ } /** - * Intialize parser location. + * Initialize parser location. */ static void vxml_location_init(struct vxml_location *vl) @@ -999,7 +999,7 @@ * * Coming here means we were unable to UTF-8 decode the input, and it * was from a buffer we initially successfully converted to UTF-8. - * That's an imposible situation which we flag. + * That's an impossible situation which we flag. */ g_carp("cannot read next character from UTF-8 converted buffer?"); @@ -1279,7 +1279,7 @@ * This supersedes any previously recorded tokens and is a global table * stored in the parser. * - * It is possible to also setup another tokenization table which can enrich + * It is possible to also setup another tokenisation table which can enrich * the global table locally during parsing, for instance to parse a given * XML section. The global table defined here acts as a fallback. * @@ -1572,7 +1572,7 @@ switch (vb->type) { case VXML_BUFFER_MEMORY: if (vb->u.m->entity) { - /* Unstacking an entity expansion buffer */ + /* Popping an entity expansion buffer */ g_assert(uint_is_positive(vp->expansions)); vp->expansions--; } @@ -1641,7 +1641,7 @@ vxml_parser_remove_buffer(vp, vb); /* - * Request cacheline pre-fill of next memory buffer. + * Request cache line pre-fill of next memory buffer. */ if (vp->input != NULL) { @@ -2131,7 +2131,7 @@ /* * Short buffer can only happen with file inputs, since we * arbitrarily read a fixed amount of bytes held in the - * synthetized memory buffer. + * synthesized memory buffer. * * If there is a next input buffer and it is a file, this memory * buffer comes from the file, so read more data from the file @@ -2351,7 +2351,7 @@ * @param vo the output buffer into which name is written. * @param c if non-zero, the character that has to be a NameStartChar * - * @return TRUE if we successfuly parsed the name, FALSE on error with + * @return TRUE if we successfully parsed the name, FALSE on error with * vp->error set. */ static bool @@ -2411,7 +2411,7 @@ * @param vp the XML parser * @param vo the output buffer into which name is written. * - * @return TRUE if we successfuly parsed the name, FALSE on error with + * @return TRUE if we successfully parsed the name, FALSE on error with * vp->error set. */ static bool @@ -2547,7 +2547,7 @@ } /** - * Tokenization of declaration keywords. + * Tokenisation of declaration keywords. * * @return VXT_UNKNOWN if unknown token. */ @@ -2558,7 +2558,7 @@ } /** - * Tokenization of miscellaneous keywords. + * Tokenisation of miscellaneous keywords. * * @return VXT_UNKNOWN if unknown token. */ @@ -2569,7 +2569,7 @@ } /** - * Tokenization of immediate keywords (introduced by a leading '#' character). + * Tokenisation of immediate keywords (introduced by a leading '#' character). * * @return VXT_UNKNOWN if unknown token. */ @@ -3130,7 +3130,7 @@ /** * Resolve the current namespace local prefix into an URI, considering that * a NULL local prefix means no explicit namespace and that means the default - * namespace for elements (there is no default namespace for unprefixed + * namespace for elements (there is no default namespace for non-prefixed * attributes). * * @return namespace URI if found, an empty string otherwise. @@ -3316,7 +3316,7 @@ } /** - * Attempt element tokenization. + * Attempt element tokenisation. * * @param vp the XML parser * @param tokens if non-NULL, additional tokens to consider for elements @@ -3843,7 +3843,7 @@ start = name; /* - * Stip name space in attribute names, unless we're running with + * Strip name space in attribute names, unless we're running with * no namespace support. */ @@ -3958,7 +3958,7 @@ } /** - * Warn that document-sepcified encoding is being ignored. + * Warn that document-specified encoding is being ignored. */ static void vxml_encoding_ignored(const vxml_parser_t *vp, const char *encoding) @@ -5405,7 +5405,7 @@ /* * Before invoking user-callbacks, if any, make sure tags nest properly. * - * This helps parsing callbacks because users are assurred that the ending + * This helps parsing callbacks because users are assured that the ending * callbacks invocation match the starting callbacks in a LIFO order. */ @@ -5955,7 +5955,7 @@ * * The specified callbacks are invoked when non-NULL, the tokenized form * being preferred if the element name can be tokenized. The supplied - * token vector is used for tokenization, before the global token table + * token vector is used for tokenisation, before the global token table * at the parser level, set via vxml_parser_set_tokens(). * * The parser is fully re-entrant by design, and another parsing method may @@ -6004,8 +6004,8 @@ * until the end of the document. * * The specified callbacks are invoked when non-NULL. If element tokens
View file
gtk-gnutella-1.2.0.tar.xz/src/xml/xattr.c -> gtk-gnutella-1.2.2.tar.xz/src/xml/xattr.c
Changed
@@ -212,7 +212,7 @@ * Insert an attribute to the table. * * If the attribute already existed, the value is replaced so that the - * older position is kept. Otherwsie, the new attribute is appended to the + * older position is kept. Otherwise, the new attribute is appended to the * list of existing attributes. * * @return TRUE when we create a new attribute, FALSE if we replaced the @@ -270,7 +270,7 @@ /** * Add an XML attribute value to the table. * - * If the value exisited in the table, the new value replaces the older one + * If the value existed in the table, the new value replaces the older one * which is then freed. * * Attributes are kept in the order in which they are inserted.
View file
gtk-gnutella-1.2.0.tar.xz/src/xml/xfmt.c -> gtk-gnutella-1.2.2.tar.xz/src/xml/xfmt.c
Changed
@@ -46,6 +46,7 @@ #include "lib/misc.h" /* For CONST_STRLEN() */ #include "lib/nv.h" #include "lib/ostream.h" +#include "lib/pmsg.h" #include "lib/pslist.h" #include "lib/stacktrace.h" #include "lib/symtab.h" @@ -123,7 +124,7 @@ * * The worst case complexity is O(d1 * d2) where d1 and d2 are the depths * of x1 and x2. However, in practice x2 is going to be part of x1's - * subtree or of that of its parent node so we do not always fall into the + * sub-tree or of that of its parent node so we do not always fall into the * worst case scenario where the common ancestor ends up being the root. */ @@ -374,7 +375,7 @@ * * @param text the text to scan (UTF-8) * @param amp whether '&' also needs to be escaped - * @param apos whether signle quotes also need to be escaped + * @param apos whether single quotes also need to be escaped * @param len if non-NULL, filled with the input string length * * @return the overhead (additional characters) that will be required to
View file
gtk-gnutella-1.2.0.tar.xz/version -> gtk-gnutella-1.2.2.tar.xz/version
Changed
@@ -1,1 +1,1 @@ -1.2.0 +1.2.2
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.