pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/net/gtk-gnutella



Module Name:    pkgsrc
Committed By:   wiz
Date:           Sun Dec 25 17:55:14 UTC 2022

Modified Files:
        pkgsrc/net/gtk-gnutella: Makefile PLIST distinfo options.mk
        pkgsrc/net/gtk-gnutella/patches: patch-src_lib_pow2.h
Added Files:
        pkgsrc/net/gtk-gnutella/patches: patch-scripts_nm-list
            patch-src_core_bogons.c patch-src_core_dmesh.c
            patch-src_core_downloads.c patch-src_core_fileinfo.c
            patch-src_core_g2_gwc.c patch-src_core_geo__ip.c
            patch-src_core_hcache.c patch-src_core_hostiles.c
            patch-src_core_huge.c patch-src_core_ignore.c
            patch-src_core_ipp__cache.c patch-src_core_parq.c
            patch-src_core_spam.c patch-src_core_spam__sha1.c
            patch-src_core_upload__stats.c patch-src_core_whitelist.c
            patch-src_dht_routing.c patch-src_lib_getgateway.c
            patch-src_lib_prop.c patch-src_lib_symbols.c patch-src_sdbm_tmp.c

Log Message:
gtk-gnutella: update to 1.2.2.

Fixes build.

# v 1.2.2  2022-02-25  [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.

Several cases of bad input (from network) causing assertion failures were
fixed.  In particular, bad DHT response after a security token lookup or
invalid G2 input streams were fatal.

There was also a critical bug, originating from a harmful code typo, which
led gtk-gnutella to serve unvailable file chunks from partial files, as if
they were available, resulting in unintended download corruption on the
remote end!

Thanks to Laurent Gil's efforts, it is now possible to run gtk-gnutella from a
Docker container.  See https://github.com/angegar/gtk-gnutella-docker.
Running within docker raised some issues about sbrk() and thread_self(),
which were fixed.

The computation of the build date was fixed, to avoid corner cases where
gtk-gnutella would complain it was "old" when freshely compiled from
up-to-date sources in a git tree whose "master" branch was only infrequently
updated.

The file selector was fixed, to avoid displaying grayed-out folders, a setup
wich did not allow one to actually select directories in the preferences.

Many improvements were done to allow smoother uploading for servents with
more bandwidth than the recipients.  Instead of drastically limiting upload
bandwidth (which was negatively impacting everyone), we are now monitoring
and adjusting our uploading speed to avoid congestion on the remote end.
When stalling happens, we also react quickly to reduce the available bandwidth
of the connection, not that of all connections to whom we are uploading.

We also no longer rely on MaxMind GeoIP for providing the IP -> country
mappings.  Their distribution mode now requires a specific licence which seems
totally incompatible with the gtk-gnutella's distribution mode.  Instead, we
are now using IP2Location, and the GEO_LICENCE file now lists the conditions
under which these data are re-distributed (gtk-gnutella transforms the data
into a form that it can digest, so we are distributing a modified, derived
work, not the original).

If you are still using a version of gtk-gnutella earlier than the 1.1.x
series, you are strongly encouraged to upgrade.  Starting from this release,
we are now considering these versions too old to connect to.

Improvements:
- Let --compile-info show which malloc() is used.
- It is now possible to run gtk-gnutella from a Docker container.
- Added details in the README file about required packages to compile.
- Use gradual bandwidth penalty when uploads are stalling.
- Added upload bandwidth capping.
- Forcefully reduce request chunk if b/w is limited.
- Emit a Retry-After header on 416 replies.
- On HTTP 416, emit a Last-Modified header.
- Switched to IP2Location for mapping IPs to countries, dropping MaxMind GeoIP.
- Upload tab now shows our own partial completion ratio, not just "(partial)".
- Detect abuse from HTTP clients not reading payloads.
- Enforce Retry-After softly.
- Ban them when they abuse of the browse-host feature.
- Smarter detection of duplicate incoming Gnutella connections.

Bug Fixes:
- [GTK2] Fixed file selector to avoid greyed-out folders.
- [GTK2] Guarantee updating of properties when refresh button is clicked.
- Added emergency path during startup should sbrk() fail.
- Fixed instructions following build.sh run.
- Fixed possible thread_self() instability at startup.
- Fixed backward portability issue with the BFD library.
- Fixed computation of build date.
- Fix 2 harmful typos, affecting serving of partial files.
- Regenrate Configure to fix gccversion usage bug.
- Restored compilation of a standalone local shell.
- Remove executable permissions on C source file!
- Rename our ARC4 interface on systems with native arc4random().
- Updated all files to fix obsolete FSF postal address.
- Avoid banning hosts issuing legitimate upload requests.
- Implement GNU extension malloc_usable_size() when using our malloc().
- UHC: when hardwired list is exhausted, reload it.
- Make Content-Range and Content-Length prioritary headers.
- ban_allow(): was never returning BAN_FORCE.
- download_reply(): reload available ranges after 416 if needed.
- download_stop_switch(): forgot to remove passive queue indication.
- gtk_gnutella_exit(): must close UPnP layer before HTTP.
- http_send_status(): reworked to avoid undue header truncation.
- node_g2_read(): fixed faulty assertion.
- pb_token_found(): be more robust against unexpected input.
- search_gui_close_search(): avoid crash when emptying search list twice.
- update_available_ranges(): revisited range processing logic.
- upload_416_extra(): was generating non-compliant headers.
- vmm_dump_pmap_log(): fixed deadlock.
- download_moved_with_bad_sha1(): always reset fileinfo.
- file_info_reset(): also discard previous TTH info.

Under the Hood:
- Added temporary "xk" country code for Kosovo.
- Added vmm_type_pointer() to determine region type.
- Add lingering period for unreferenced file_descriptor objects.
- Add shell command "show files -d" to list currently used file_descriptor.
- Raise minimum b/w scheduling slot to 256 bytes per second.
- Fixed HashGenericCat() in Jmakefile, leading to wrong .c dependency.
- Fast assertions are a must for GTKG nowadays, always compile with them.
- Do not post multiple randomness generation messages.
- Split bit_generic routines into .ht and .ct.
- Reserve file_object_close() for user code.
- Made it possible to compile with TRACK_MALLOC again.
- Improved "thread elements" shell command to trace callback function names.
- Avoid VMM magazine allocation when running with TRACK_MALLOC.
- Enhanced TRACK_MALLOC to be able to trap xalloc() as well.
- Enhanced TRACK_MALLOC debugging power with MALLOC_CATCH_MALLOC.
- Extended bool_to_string() to display value if not 0 or 1.
- TEQ: optimize I/O events by posting them directly to I/O queue.
- VMM pmap logging shows allocated size per fragment type.
- Removed gone / probably gone logic for discovered threads.
- Ensure thread_atexit() callbacks run in discovered threads.
- Ensure walloc0() redirects to underlying zeroing routines, for statistics.
- Simplified shell I/O condition management and logging.
- Separate Gnutella and HTTP (upload) banning categories.
- STATIC_ASSERT: use a more compact version for less verbose errors.
- Made thread exit value read-only in thread_atexit() callbacks.
- Emit thread mask in crash logs upon detected deadlock.
- ADNS: the cache is now thread-safe and cached replies shuffled.
- ADNS: added expiring periodic callback for cached DNS entries.
- Added new "adns_debug" property for ADNS debugging.
- Avoid g_memmove() which has been deprecated.
- Added ripening_contains() and ripening_update() routines, not used yet.
- Optimize ripening table when no value is kept.
- Use aging table to track download mesh sending times.
- Use 429 instead of 550 for "Too Many Requests".
- Remind less often about banning status.
- Let emulated alloca() cleanup when thread exits.
- Ensure alloca_stack_direction_compute() is never inlined.
- Smarter detection of duplicate incoming Gnet connections.
- xmalloc: must "embed" xstrdup() and xstrndup().
- xmalloc: simplified allocation entry points.
- xmalloc: ensure stricter memory alignment when xmalloc() replaces malloc().
- ban_delay(): fixed to return remaining ban time.
- ban_force(): read incoming data before shutdown().
- ban_vendor(): GTKG earlier than version 1.1 deemed too old.
- bitcmp(): use memcmp() for byte comparison.
- bool_to_string(): added carp trace to help spot the culprit.
- cq_cancel(): fix logic to return TRUE if event was NULL.
- crash_deadlocked(): no longer dump stacks.
- crash_handler(): enter thread crash mode before signal cleanup.
- crash_time_internal(): use thread_safe_small_id() in raw mode.
- download_queue_delay_switch(): explicitly turn off queuing if switching.
- download_queue_v(): explicitely reset passive queuing info.
- download_reply(): Content-Length not necessary if Content-Range.
- download_send_push_request(): trace server GUID.
- erbtree_foreach(): added cheap safety assertion.
- evq_trampoline(): cleanup event if cannot signal thread.
- extract_retry_after(): ensure amount in seconds is the only value.
- fi_pick_rarest_chunk(): be smarter about selected chunk.
- fi_pick_rarest_chunk(): ensure first free chunk is available.
- hcache_fill_caught_array(): fix array fill logic.
- http_send_status(): ensure generated header has trailing CRLF.
- local_shell_mainloop(): must flag "writable" on POLLHUP.
- mingw_exception_log(): use static variables and be more careful.
- natpmp_handle_discovery_reply(): trace inconsistent replies.
- natpmp_handle_mapping_reply(): trace inconsistent replies.
- parq_upload_send_queue(): tie PARQ upload queue and upload.
- pcache_pong_received(): also validate changing ports.
- rand31: avoid race condition during intial seeding.
- random_pool_append(): ensure no endless recursion, ever!
- send_pproxy_error_v(): remove dead code.
- shell_handle_event(): always write() when having pending data.
- shell_handle_event(): on exception, setup EOF/shutdown.
- shell_write_data(): make sure to flush as much as possible.
- sig_compute_pc_index(): be paranoid about optimization.
- signal_name(): contort to avoid gcc-10 warning.
- signal_trap_with(): avoid kernel signal desynchronisation.
- signal_uncaught(): dump stack trace if harmful signal.
- sorted_array_lookup(): sort array if they forgot to do it!
- spinlock_deadlocked(): capture lock status early.
- stacktrace_atom_lookup_and_store(): trace race conditions.
- stacktrace_load_symbols(): do nothing if too early.
- thread_create_full(): keep async exit callback separated.
- thread_deadlock_check(): disable locks when deadlock is certain.
- thread_deadlock_check(): only dump stacks of involved threads.
- thread_stack_check_overflow(): also log used stack size.
- upload_remove_v(): create better logging message.
- vmm_malloc_inited(): now only called internally.
- xmalloc_show_settings_log(): trace chosen memory alignment.
- zgc_zalloc(): transformed some assertions into verbose ones.

# v 1.1.15  2019-07-14  [stable]

This release is a maintenance one fixing several minor bugs and two annoying
ones:

- The semi-reliable UDP layer could crash due to an assertion that started
  to trigger with the introduction of an explicit flush before the message
  times out for transmission.

- Due to an overseen condition, we were not able to serve seeded files when
  Partial File Sharing is enabled.  A seeded file is a completed file that
  still lies in the downloaded directory but is not part of the library
  directories.

The OOB banning code for hosts that never claim their OOB hits was also
revisited to prevent problems with hosts that query a popular file and then
get submerged by hits and thus refrain to claim the additional hits.  We are
now much more tolerant to avoid accidentally banning innocent hosts.

On Windows, the disassembling of machine instructions was enhanced to further
improve the ability to correctly issue symbolic stack traces when encountering
assertion failures or during crashes.

Finally, the Geo IP databases were refreshed.

Improvements:
- OOB: increased timeout for OOB hit delivery.
- OOB: switch to unreliable notification if semi-reliable UDP fails.
- OOB: raise the bar for banning after unclaimed OOB hits.
- Dynamic Hits: let us forward hits that bear a small amount of results.
- Count amount of banning we have to do for OOB querying hosts.

Bug Fixes:
- Rename statx struct to statistics to avoid name collision.
- browse_host_read_html(): fixed English typo.
- dl_util_query(): forgot to restore old signal handler.
- file_info_restrict_range(): was not serving seeded files!
- main(): do not let the supervisor process restart on crash!

Under the Hood:
- Added thread_stack_diff() to compare stack pointers.
- Added PLURAL() macros.
- Added clz64() to count leading zeroes on a 64-bit quantity.
- Added OP_CTZ() and OP_CLZ() to work on op_t quantities.
- Added pattern_memrchr() and pattern_strrchr() implementations.
- Jumbo patch to use vstrrchr() instead of strrchr().
- BIT_GENERIC_BIT() does not need the base argument.
- Factorized prefix-matching from sorted array.
- pattern.c: fix compiling with old gcc (version 4.4)
- pattern.c: forgot to include "endian.h".
- str: avoid "char" as parameter or return type, use "int".
- Windows: if not a "registered product", leave logs in current dir.
- Windows: enhanced stack unwinding.
- Windows: added option to debug backtraces "on crash" only.
- Windows: when backtracing, also parse another MOV instruction.
- Windows backtrace: also parse "add xx,%esp".
- compat_poll(): can now use poll() on Windows.
- evq_close(): warn when EVQ is not terminated after 2 seconds.
- file_info_moved(): no warning on file size if file still partial.
- main(): set a different product nickname for supervisor.
- mingw_analyze_prologue(): handle cases where no SP adjustment done.
- mingw_exception(): also log symbolic thread name if available.
- mingw_exception(): disable signals on stack overflow.
- mingw_exception(): interpret exception information differently.
- mingw_exception_log(): if PC looks invalid, try to intuit caller.
- mingw_file_rotate(): preserve extension during renaming.
- mingw_ftruncate(): it is OK if current offset is beyond truncation.
- mingw_get_return_address(): enhanced scanning for prologue.
- mingw_get_return_address(): validate next PC by checking CALL before.
- mingw_get_return_address(): validate stack pointer before access.
- mingw_thread_sig_deliver(): special-case signals for current thread.
- pattern_compile(): must use WALLOC0() for allocating!
- pattern_strstr_tiny(): fixed starting condition for aligned processing.
- rwlock_upgrade_from(): don't wait for readers in pass-through mode.
- rwlock_wait(): dump lock waiting queue when tracing sleeps.
- rwlock_wait(): trace summary when logging contention / sleeping.
- str_private(): declare non-leaking parts for TRACK_ZALLOC.
- teq_monitor(): trace pending events as well.
- thread-test: for interrupt tests, timeout if no interrupt received.
- thread_backtrace_capture(): avoid recursion and disable signals.
- thread_id_stack_used(): fixed for decreasing stacks.
- ut_frag_pmsg_free(): be more robust, avoid internal assertion.
- vmm_crashing_alloc(): better abort explicitly if no memory.
- wmove(): make sure it's a no-op with TRACK_ZALLOC.

# v 1.1.14  2018-10-04  [stable]

This release mostly improves the core routines and fixes a few important bugs.

Due to a bug in the usage of the RX buffers, we were not correctly parsing
data returned in "chunked" transfer-encoding by HTTP/1.1 servers.  This
affected the UPnP logic.

The UPnP port unmapping done when the program shuts down was also not being
able to complete successfully because we were preventing the HTTP connection
from going on during the shutdown.  Not critical because there is a lifetime
attached to all mappings, but always best to properly clean-up when leaving.

The algorithm used to pick random chunks to download was also revisited to
ensure a uniform selection within the whole file ranges that remain to be
fetched.

At startup time, the DHT code no longer expires keys when reloading data.
This could create crashes during the operation, with no other remedy than
to erase all the DHT database files manually to be able to recover!

The background task layer was also causing crashes (at exit time though)
because it was not recording whether it was running "user" code as opposed
to "kernel" code.

The SDBM code was also improved to allow concurrency and, in particular,
a "loose" iteration scheme which does not need to grab the database lock
during the whole iteration process.  It is also possible to perform a
concurrent database rebuilding.

The thread runtime now has an improved deadlock detection engine, based
on a topological sort, that can definitely tell whether we are deadlocked.
When the deadlock is detected, we can also have more information about
the threads participating in that deadlock condition, to assist debugging.

On Windows, a bug in our mingw_dlerror() emulation caused it to always
fail once an error had been recorded, leading to un-decorated subsequent
stack traces, which really do not help on that platform!

There was also a concurrency bug in the processing of network queries.
Every time the library was rescanned, it could trigger a crash due to
a memory zone being declared private and was in fact shared between
threads.  The crash occurred only when a query was received on the
Gnutella network whilst the library was rescanned.

The semi-reliable UDP layer TX side was revisited to maximize chances that
reliable messages get through completely.

The pattern matching code was revisited thoroughly.  A new algorithm (2-Way
String Matching) now complements the Quick Search algorithm and an initial
benchmarking is done to compare our own matching routines with native libc
versions of strstr(), strlen(), strchr() and memchr().  The fastest routine
is then selected, to ensure optimal performances.  There is also a unit-test
program ensuring proper semantics for the pattern search flags.

New Features:
- Added UDP scheduler message statistics by priority.

Improvements:
- [GTK2] Catch column resize events to persist widths quickly.
- Added "shutdown -x" to stop the program and continue session next time.
- Added --resume-session option to request explicit continuation.
- Improved pattern matching with new algorithm and runtime benchmarking.
- Persist current_peermode to restart in same mode after crash.
- Record compilation date and time for the crashlog.
- When running with no GUI, relax mem requirements to become ultra.
- Use minimum download chunk size to align requested download offsets.
- Added statistics for OOB hit notifications we process.
- Extensive improvements of the SDBM code to allow concurrency.
- Semi-reliable UDP TX layer now sends messages more aggressively.
- Reduce memory footprint of compiled patterns for short patterns.

Bug Fixes:
- No longer supply -lgthread-2.0 and -lresolv at link time.
- DHT: do not expire keys when reloading data at startup.
- Restored alphabetical listing of command options in the man page.
- The --use-poll argument was not mentioned in the manual page.
- UPnP: fixed XML logging.
- UPnP: was not correctly unmapping ports on servent shutdown.
- crash_time_internal(): protect against recursions in raw mode.
- file_info_retrieve(): must restore proper mtime for seeded files!
- filter_apply(): fixed suffix matching to allow whole match.
- http_data_ind(): could not process chunked data!
- iov_contiguous_size(): fixed destructive implementation.
- pslist_last_count(): fixed off-by-one error.
- recursive_scan_step_build_partial_table(): removed assertion.
- statx_opx(): use fabs() on double.
- word_vec_init(): zone cannot be private.
- zgc_subzone_defragment(): fixed improper assertion.

Under the Hood:
- Added hidden --no-build-version option.
- Added cstr_{b,f,l}cpy() routines to supplant g_strlcpy()
- Added strpcpy() which returns pointer to last copied trailing NUL.
- Added vmm_move() to move allocated VM regions to better places.
- Added G_FALL_THROUGH and fixed fall-through in switch cases.
- Added assertions in embedded lists for insertions / removals.
- Added new _mark_removed() and _link_mark_removed() for lists.
- Added is_ascii_ident() to check "\w" (word) in ASCII.
- Added ULONG_SWAP().
- Added op_roundup() and op_ptr_roundup() to round to upper aligned boundary.
- Added stats datapoint iterators and ability to remove outliers.
- Added G_FAST and G_NO_OPTIMIZE compilation directives.
- Added support for case-insensitive pattern matching.
- Added zone_info() to request zone allocation stats.
- Added p[s]list_shift_data() to remove head when NULL is valid data.
- Attempt relocation of hash tables arenas once in a while.
- Always capture and display the routine name in assertions.
- Disable parallel make execution in src/if.
- Fixed indentation for "if" and "else" leading to gcc 7.x warnings.
- Fixed logging fast assertion macros to allow just one string.
- Declare property choices[] array static and const!
- Optimize h_strnjoinv() with new strpcpy().
- Optimize memory for the gnet property init_list[].
- Optimized ctz64() to make it more obvious.
- Protect events and subscribers with magic tags.
- Removed http_buffer_t, completely obsoleted by pmsg_t.
- Show zalloc settings at startup and in "memory show options".
- Simplify code for read-lock upgrading and releasing.
- Strings now hold persistent "truncated" flags, for formatting.
- The watcher layer now auto-initializes.
- Use the Mersenne Twister as an additional random source.
- Use s_carp() instead of s_warning() for reporting "deep" important warnings.
- Use new vstrstr(), vstrlen(), vmemchr() and vstrchr() for optimized runtime.
- Windows: added ftruncate() emulation.
- Windows: fixed stat() and fstat(), with proper st_dev and st_ino fields.
- enamed hash_table_size() as hash_table_count() for consistency.
- When log messages are truncated, signal it visually with trailing "+++".
- VMM: use smarter core allocation under long-term strategy.
- anti_window_shift_hack(): hide normal output if not debugging.
- compat_longjmp(): record usage location and trace duplicate use.
- crash_invoke_inspector(): do not hardwire parent stdout / stderr.
- crash_restart(): always log the given message.
- crash_setcctime(): avoid using "time" as parameter name.
- crash_vmea_usage(): trace calling routine.
- entropy_seed(): also initialize random "previous entropy".
- fi_pick_chunk(): fixed selection of first chunk.
- fi_pick_chunk(): revisited random chunk selection algorithm.
- file_object_find(): loudly warn on file mismatch.
- get_iconv_charset_alias(): do not copy trailing ' ' in charset name.
- halloc_dump_stats_log(): was not logging realloc_via_xprealloc.
- hrealloc(): use vmm_move() and attempt to optimize VM space.
- log_handler(): emit stacktrace for glib, GTK or Pango warnings.
- mingw_dladdr(): use win32 DLP layer to check for new libraries.
- mingw_dlerror(): fixed to follow POSIX semantics.
- mingw_fix_stat(): trap ERROR_NOT_READY errors correctly.
- node_timer(): periodically try to move QRT arenas in VM space.
- parse.h: remove NON_NULL_PARAM() on function with assertions.
- rwlock_upgrade_from(): must only count read-locks from current thread.
- s_logv(): default log message max length raised to 3500 bytes.
- search_oob_pending_results(): randomly discard hits if too many.
- search_request_preprocess(): warn if TCP query contains a "QK".
- sequence_backward_iterator(): fixed case of one-way lists.
- stacktrace_pretty_filepath(): move to latest /src/.
- str_chr(): optimized to use vstrchr() if we can NUL-terminate.
- str_destroy(): ensure we do not call on a thread-private string.
- str_s2c(), str_2c(), str_dup(): handle already NUL-terminated strings.
- str_s2c(): ensure we do not call on a thread-private string.
- thread_suspend_others(): skip threads not marked as "valid".
- timestamp: be paranoid and protect against invalid time_t inputs.
- vmea_capacity(): changed semantics to report initial capacity.
- vmm_mmap_anonymous(): identify foreign regions more quickly.
- word_vec_make(): simplified code a bit.
- wrealloc(): if size does not change, attempt a wmove().
- xallocate(): be more aggressive when forcing VMM allocation.
- xmalloc: allocate via standalone VMM regions if possible.
- xmalloc: revisited plain VMM block allocation and freeing.
- xmalloc: use checksums to validate chunk headers.
- xreallocate(): ensure VMM space improves when reallocating.
- zcreate(): flag created zones as "user" ones.
- zgc(): only run for long-lived processes.

# v 1.1.13  2017-10-22  [stable]

This release primarily addresses issues that were left-over in 1.1.12.
Do not use that previous release, migrate from 1.1.11 to 1.1.13 directly!

The main issue was that of Partial File Sharing.  Numerous bugs, dating from
7 years or more, were lurking because my local configuration had switched PFS
off for testing, and it had never been turned back on!  In particular,
completed files were not properly shared, it was not possible to upload their
THEX since it was not recomputed, and the files were not properly indexed in
the Query Routing Table due to bugs in the background task layer.

In case of a crash, we now dump the value of all the Gnutella properties to
be able to spot configurations that deviate from the norm.  Too many bugs
were reported and ignored because they could not be reproduced, often due
to not having the same setup when attempting to debug!

Another nasty bug was fixed: it was not possible to change the IP support
configuration without causing an immediate crash.  The reason is due to a
change that was integrated in 1.1.12 to allow IPv6 UDP traffic from G2 nodes.
The problem was that this created an extra client stack on top of the
low-level UDP traffic scheduler and it was not properly cleaned-up when
switching IP configurations, leading to an assertion failure!

New Features:

Improvements:
- Append all Gnutella properties to the crashlog file.
- At startup, do not needlessly request TTH if we have it cached already.
- Optimized requests for library scan / QRP rebuild, avoiding multiple events.
- Allow TTH computation for seeded files.
- Obsolete and stale entries are now removed from the SHA1 cache.
- [GTK] Added GUI events on more fileinfo changes.
- [GTK] Show information about recomputed TTH for seeded files.
- Prune unshared entries from SHA1 cache at startup.
- Persist information about seeded files in the ASCII fileinfo database.
- Remove unneeded libraries from the default GTK2 ldflags.

Bug Fixes:
- Was not able to properly seed completed files; fixed shared_file_path().
- Was not always updating QRP on the UP side after a library change.
- Could have background tasks stuck after cancelling a multi-ref'ed one.
- Dynamic querying timeout was not properly computed (made too small).
- Changing from "IPv6 & IPv4" to "IPv4 only" mode caused a crash.
- Restored ability for "shutdown -r" to work.

Under the Hood:
- Added prop_to_typed_string().
- Added s_where() to log a stacktrace on stderr only.
- Added tt_slice_size() to compute slice length per leaf in the TTH.
- New crash_dumper_add() to register crash dumper callbacks.
- No panicing when thread cannot block but was actually suspended.
- Was unduly offsetting stacktrace by one extra level.
- bg_sched_sleep(): don't reduce runcount on exiting task!
- bg_sched_timer(): added run count consistency check.
- bg_sched_timer(): fixed logging of task's run time.
- bg_task_cancel(): log task address as well, not just the task name.
- bg_task_wakeup(): must clear user sleeping flag.
- crash_restart_notify(): use smarter crash_exit().
- crash_try_reexec(): suspend other threads as a precaution.
- deflate_flushed(): suppressed soft assertion.
- dq_results_expired(): fixed improper timeout computation.
- fi_free(): cut any pending reference by uploads!
- fi_tigertree_check(): more verbose in case of errors.
- file_info_moved(): must update fi->modified as well.
- file_info_remove_source(): removed unused discard parameter.
- file_info_retrieve(): also validate that DONE is consistent.
- file_info_shared_sha1(): do not share bad files.
- get_file_to_upload_from_urn(): factorized code.
- huge_update_hashes(): enforce one sync of SHA1 cache every minute.
- huge_verify_callback(): use shared_file_indexed().
- node_udp_disable(): was not disabling the G2 UDP IPv6 node.
- parse_and_append_cache_entry(): discard obsolete / stale entries.
- qrt_compressed(): fixed outdated comments.
- qrt_diff_1(): was never considering change.
- request_sha1(): don't request TTH if we have it cached.
- shared_file_fileinfo_unref(): clear fileinfo pointer.
- shared_file_from_fileinfo(): copy TTH atom as well, if any.
- shared_file_is_shareable(): be stricter for partial files.
- shared_file_path(): must process sf->fi correctly!
- upload_file_present(): loudly warn when completed file changed on disk.
- upload_file_present(): loudly warn when file not shareable.
- verify_update(): loudly warn when "progress" callback stops processing.

# v 1.1.12  2017-09-20  [stable]

This release fixes a very critical bug that was only manifesting when Partial
File Sharing was turned on, and which caused possible memory corruption (leading
to a sure crash later) when enqueuing new files for downloading.

New Features:
- Throttle browsing requests to one per hour from a given IP.
- Limit uploads to stalling hosts to 1, regardless of user settings.
- [GTK2] Show proper average data speed on completed uploads.

Improvements:
- Added "WSHR" vendor code for WireShare.
- Added "ENVY" vendor code for Envy.
- Do not attempt costly operations after a crash / auto-restart.
- Updated FAQ  -Uploads and Sharing-
- Use 64-bit variables for bandwidth computations.
- Make sure early stalling is not always reported for the same IP.
- Use even HTTP outgoing bandwidth as the last measure when stalling.

Bug Fixes:
- Allow IPv6 UDP traffic from G2 nodes.
- Be sure to use destructive list iteration with tmalloc_free_magazine().
- Critical upload HTTP statuses are now fully sent.
- Must give plain (untranslated) strings to send_upload_error().
- bg_task_finished(): now calls safer bg_task_dead().
- file_object_open_from(): also catch EROFS when opening file.
- node_bye_v(): do not call node_remove_v() for G2 nodes.
- vendor_code_get_name(): fixed validation of unknown code tokens.
- verify_next_file(): fixed wrong argument order in log message.

Under the Hood:
- bfd_util: reworked mutex grabbing in an attempt to avoid deadlocks.
- binary_hash(): disperse bits in initial hash value.
- check_for_events(): optimize path if timeout is 0 or we collect events.
- cq_event_called(): only zero variable holding event when asked!
- cq_zero(): now always nullify the event, as the name suggests.
- crash_setmain(): avoid spurious warnings with recent gcc.
- english_strerror() and symbolic_errno() made thread-safe.
- inputevt_timer(): factorized common code into new inputevt_handle().
- socket_udp_flush_queue(): do not process anything if we cannot devote time.
- stack_sym_trylock(): avoid deadly recursions through stack lock dumping!
- thread_sig_handle(): use atomic exchange operation to clear pending set.
- u32_ptr_hash(): discard lower bits of the multiplication as well.
- upload_timer(): clear the stall flag when it is over.
- Added aging_record() to simplify code for plain keys.
- Added cq_event() to acknowledge reception of events we do not track.
- Added "inputevt_trace" property for tracing dispatched I/O callbacks.
- Added english_strerror() to guarantee English messages.
- Added thread_signal_has_pending() and thread_signal_process().
- Added "lock_sleep_trace" and "lock_contention_trace" properties.
- AJE: changed pool #0 filling policy and reseeding checks.
- Ensure misc_init() is called before using lookup tables.
- Simplify is_ascii_*() by performing table lookup.
- Thread runtime now allows a signal handler to run within another one.
- Updated UHC list, fixed obsolete port numbers.
- Use new cq_event() in thread callout events to avoid possible leaks.
- Watchdog: revisited logic to do more under lock protection.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 pkgsrc/net/gtk-gnutella/Makefile
cvs rdiff -u -r1.17 -r1.18 pkgsrc/net/gtk-gnutella/PLIST
cvs rdiff -u -r1.35 -r1.36 pkgsrc/net/gtk-gnutella/distinfo
cvs rdiff -u -r1.4 -r1.5 pkgsrc/net/gtk-gnutella/options.mk
cvs rdiff -u -r0 -r1.1 pkgsrc/net/gtk-gnutella/patches/patch-scripts_nm-list \
    pkgsrc/net/gtk-gnutella/patches/patch-src_core_bogons.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_core_dmesh.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_core_downloads.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_core_fileinfo.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_core_g2_gwc.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_core_geo__ip.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_core_hcache.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_core_hostiles.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_core_huge.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_core_ignore.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_core_ipp__cache.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_core_parq.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_core_spam.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_core_spam__sha1.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_core_upload__stats.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_core_whitelist.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_dht_routing.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_lib_getgateway.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_lib_prop.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_lib_symbols.c \
    pkgsrc/net/gtk-gnutella/patches/patch-src_sdbm_tmp.c
cvs rdiff -u -r1.1 -r1.2 pkgsrc/net/gtk-gnutella/patches/patch-src_lib_pow2.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/net/gtk-gnutella/Makefile
diff -u pkgsrc/net/gtk-gnutella/Makefile:1.118 pkgsrc/net/gtk-gnutella/Makefile:1.119
--- pkgsrc/net/gtk-gnutella/Makefile:1.118      Wed Nov 23 16:20:51 2022
+++ pkgsrc/net/gtk-gnutella/Makefile    Sun Dec 25 17:55:14 2022
@@ -1,10 +1,9 @@
-# $NetBSD: Makefile,v 1.118 2022/11/23 16:20:51 adam Exp $
+# $NetBSD: Makefile,v 1.119 2022/12/25 17:55:14 wiz Exp $
 
-DISTNAME=      gtk-gnutella-1.1.11
-PKGREVISION=   20
+DISTNAME=      gtk-gnutella-1.2.2
 CATEGORIES=    net
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=gtk-gnutella/}
-EXTRACT_SUFX=  .tar.bz2
+EXTRACT_SUFX=  .tar.xz
 
 MAINTAINER=    adam%NetBSD.org@localhost
 HOMEPAGE=      http://gtk-gnutella.sourceforge.net/

Index: pkgsrc/net/gtk-gnutella/PLIST
diff -u pkgsrc/net/gtk-gnutella/PLIST:1.17 pkgsrc/net/gtk-gnutella/PLIST:1.18
--- pkgsrc/net/gtk-gnutella/PLIST:1.17  Sun Feb 26 12:58:28 2017
+++ pkgsrc/net/gtk-gnutella/PLIST       Sun Dec 25 17:55:14 2022
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.17 2017/02/26 12:58:28 adam Exp $
+@comment $NetBSD: PLIST,v 1.18 2022/12/25 17:55:14 wiz Exp $
 bin/gtk-gnutella
 lib/gtk-gnutella/gtk-gnutella.nm
 share/appdata/gtk-gnutella.appdata.xml
@@ -9,10 +9,13 @@ share/gtk-gnutella/en/FAQ
 share/gtk-gnutella/en/glossary
 share/gtk-gnutella/favicon.png
 share/gtk-gnutella/fr/FAQ
+share/gtk-gnutella/fr/glossary
 share/gtk-gnutella/geo-ip.txt
 share/gtk-gnutella/geo-ipv6.txt
 share/gtk-gnutella/gwcache.boot
 share/gtk-gnutella/hostiles.txt
+share/gtk-gnutella/it/FAQ
+share/gtk-gnutella/it/glossary
 share/gtk-gnutella/ja/FAQ
 share/gtk-gnutella/pixmaps/arrow_down.xpm
 share/gtk-gnutella/pixmaps/arrow_up.xpm
@@ -70,6 +73,7 @@ share/gtk-gnutella/robots.txt
 share/gtk-gnutella/spam.txt
 share/gtk-gnutella/spam_sha1.txt
 share/gtk-gnutella/tr/FAQ
+share/gtk-gnutella/tr/glossary
 share/locale/de/LC_MESSAGES/gtk-gnutella.mo
 share/locale/el/LC_MESSAGES/gtk-gnutella.mo
 share/locale/es/LC_MESSAGES/gtk-gnutella.mo

Index: pkgsrc/net/gtk-gnutella/distinfo
diff -u pkgsrc/net/gtk-gnutella/distinfo:1.35 pkgsrc/net/gtk-gnutella/distinfo:1.36
--- pkgsrc/net/gtk-gnutella/distinfo:1.35       Sun Sep 18 20:04:30 2022
+++ pkgsrc/net/gtk-gnutella/distinfo    Sun Dec 25 17:55:14 2022
@@ -1,9 +1,31 @@
-$NetBSD: distinfo,v 1.35 2022/09/18 20:04:30 he Exp $
+$NetBSD: distinfo,v 1.36 2022/12/25 17:55:14 wiz Exp $
 
-BLAKE2s (gtk-gnutella-1.1.11.tar.bz2) = c8df89d48086fdcdab21c7e2f8a87fe27c51ca10f6dbbd612bc14cdf02a3acb3
-SHA512 (gtk-gnutella-1.1.11.tar.bz2) = 87d2d66b555180c0db7c360106377133b9e1f8ad8d28fc0f9a38498f3b4502a817650f9683cf92919b7d3a1b3602f7136143d2f1c920e10727576c703e233d07
-Size (gtk-gnutella-1.1.11.tar.bz2) = 19966423 bytes
+BLAKE2s (gtk-gnutella-1.2.2.tar.xz) = 53058fd39e1b9e85f5f0c576fe20ce30d195e7482a54ef867ae221afa8268839
+SHA512 (gtk-gnutella-1.2.2.tar.xz) = 5d8692f4075c2188f22f68011148dd25e6a05453374b1baf1f66599a129b6f3c9e887330e38d270c4a83b8e40cfd4315845ec0d0e1f8cc82f7dcdf4a0217c78b
+Size (gtk-gnutella-1.2.2.tar.xz) = 21313212 bytes
 SHA1 (patch-Configure) = 926736a79a7bc469810f4887b5d0cecfedbac201
 SHA1 (patch-config__h.SH) = 2ed9d100cc044e10f2633a614cfc4100edc4cc02
+SHA1 (patch-scripts_nm-list) = 817c11388563e76b26406e0621e97c95c896fec9
+SHA1 (patch-src_core_bogons.c) = 053e80660df4acc43c17fb2c4c9a5056f54e80f9
+SHA1 (patch-src_core_dmesh.c) = bcf16b86c356a0948fbe4e69cc84a29d480a0734
+SHA1 (patch-src_core_downloads.c) = 64157159910733e52cde1fa6225ffaa3168b2e12
+SHA1 (patch-src_core_fileinfo.c) = f86c0f4b290db4212008fc0006e77882dd51f1c8
+SHA1 (patch-src_core_g2_gwc.c) = 34c3a39adfb81c90cb1578f3a7d911c19b4276c2
+SHA1 (patch-src_core_geo__ip.c) = 116d14dccd967b54302c30f3d2969bd68b099abd
+SHA1 (patch-src_core_hcache.c) = 1fbd40ee5f3d56106892e7072f53dda5e2488344
+SHA1 (patch-src_core_hostiles.c) = abdf92f86239db4d94ea4e20f97bd968764a5257
+SHA1 (patch-src_core_huge.c) = fc0914e9300b5062548fd72ceb446a9ad949087a
+SHA1 (patch-src_core_ignore.c) = 6500dce34759388194bf786f57d3ad1185d27f55
+SHA1 (patch-src_core_ipp__cache.c) = 41a11369587d0653ff39dbe5ffd4c38743dd6043
+SHA1 (patch-src_core_parq.c) = efb84612b2427bdebfca10044e3e8d9b00bac370
+SHA1 (patch-src_core_spam.c) = ae5aec41432d997c4c4b270229c382477b0bd40a
+SHA1 (patch-src_core_spam__sha1.c) = 13ba40e9189a037b8b699f10084f63d64906ea7f
+SHA1 (patch-src_core_upload__stats.c) = 7d9a60b57b3fe450ababab8a7633878232eac0e2
+SHA1 (patch-src_core_whitelist.c) = 99457d24986a8541182bc0de23b2e5ff5593fb89
+SHA1 (patch-src_dht_routing.c) = f33827c96da71ca9d405ab91eb0cb8a702c2aa53
+SHA1 (patch-src_lib_getgateway.c) = def0b5da6557b73e90d03f0b3ef2dce6bc70c7c3
 SHA1 (patch-src_lib_memusage.c) = db65ae1b7d43326f8b8eacdc95705deba0a94b5d
-SHA1 (patch-src_lib_pow2.h) = f8a36d58f84ef782535e363df6144bbfc766013e
+SHA1 (patch-src_lib_pow2.h) = 7a4553eb6278a707302485800d65d39d2e35fbf0
+SHA1 (patch-src_lib_prop.c) = ad709a46d00d7609ab7ec321b3935d13add1c379
+SHA1 (patch-src_lib_symbols.c) = cbc7bc84498d7ba6ce247dfad82a43126d163be9
+SHA1 (patch-src_sdbm_tmp.c) = 8ab56bba8825adcddbdfc8578a0f27b01b3f0cca

Index: pkgsrc/net/gtk-gnutella/options.mk
diff -u pkgsrc/net/gtk-gnutella/options.mk:1.4 pkgsrc/net/gtk-gnutella/options.mk:1.5
--- pkgsrc/net/gtk-gnutella/options.mk:1.4      Sun Feb 26 12:58:28 2017
+++ pkgsrc/net/gtk-gnutella/options.mk  Sun Dec 25 17:55:14 2022
@@ -1,18 +1,13 @@
-# $NetBSD: options.mk,v 1.4 2017/02/26 12:58:28 adam Exp $
+# $NetBSD: options.mk,v 1.5 2022/12/25 17:55:14 wiz Exp $
 
 PKG_OPTIONS_VAR=               PKG_OPTIONS.gtk-gnutella
 PKG_SUPPORTED_OPTIONS=         # empty
 PKG_OPTIONS_OPTIONAL_GROUPS=   gui
-PKG_OPTIONS_GROUP.gui=         gtk1 gtk2 headless
+PKG_OPTIONS_GROUP.gui=         gtk2 headless
 PKG_SUGGESTED_OPTIONS=         gtk2
 
 .include "../../mk/bsd.options.mk"
 
-.if !empty(PKG_OPTIONS:Mgtk1)
-CONFIGURE_ARGS+=       --gtk1
-.  include "../../x11/gtk/buildlink3.mk"
-.endif
-
 .if !empty(PKG_OPTIONS:Mgtk2)
 CONFIGURE_ARGS+=       --gtk2
 .  include "../../x11/gtk2/buildlink3.mk"

Index: pkgsrc/net/gtk-gnutella/patches/patch-src_lib_pow2.h
diff -u pkgsrc/net/gtk-gnutella/patches/patch-src_lib_pow2.h:1.1 pkgsrc/net/gtk-gnutella/patches/patch-src_lib_pow2.h:1.2
--- pkgsrc/net/gtk-gnutella/patches/patch-src_lib_pow2.h:1.1    Sun Feb 26 12:58:28 2017
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_lib_pow2.h        Sun Dec 25 17:55:14 2022
@@ -1,10 +1,10 @@
-$NetBSD: patch-src_lib_pow2.h,v 1.1 2017/02/26 12:58:28 adam Exp $
+$NetBSD: patch-src_lib_pow2.h,v 1.2 2022/12/25 17:55:14 wiz Exp $
 
 Don't define popcount() if it exists in system.
 
---- src/lib/pow2.h.orig        2017-02-26 12:17:53.469638084 +0000
+--- src/lib/pow2.h.orig        2022-02-25 16:06:22.000000000 +0000
 +++ src/lib/pow2.h
-@@ -66,6 +66,7 @@ is_pow2(uint32 value)
+@@ -67,6 +67,7 @@ is_pow2(uint32 value)
   *
   * @return number of 1 bits in a 32-bit integer.
   */
@@ -12,8 +12,8 @@ Don't define popcount() if it exists in 
  static inline ALWAYS_INLINE G_CONST int
  popcount(uint32 x)
  #ifdef HAS_BUILTIN_POPCOUNT
-@@ -84,6 +85,7 @@ popcount(uint32 x)
-       return ((x + (x >> 4) & 0xf0f0f0f) * 0x1010101) >> 24;
+@@ -85,6 +86,7 @@ popcount(uint32 x)
+       return (((x + (x >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24;
  }
  #endif        /* HAS_BUILTIN_POPCOUNT */
 +#endif        /* HAS_POPCOUNT */

Added files:

Index: pkgsrc/net/gtk-gnutella/patches/patch-scripts_nm-list
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-scripts_nm-list:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-scripts_nm-list       Sun Dec 25 17:55:14 2022
@@ -0,0 +1,41 @@
+$NetBSD: patch-scripts_nm-list,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Use sha1(1) where available.
+
+--- scripts/nm-list.orig       2022-02-25 16:06:18.000000000 +0000
++++ scripts/nm-list
+@@ -48,11 +48,17 @@ fi
+ 
+ # See whether their native sha1sum executable will work, if present at all
+ SHA1SUM=sha1sum
++FIELD=1
+ empty=`$SHA1SUM /dev/null 2>/dev/null | cut -f1 -d' '`
++empty2=`sha1 /dev/null | cut -f4 -d' '`
+ case "$empty" in
+ da39a3ee5e6b4b0d3255bfef95601890afd80709) ;;
+ *) SHA1SUM=$TOP/src/bin/sha1sum ;;
+ esac
++case "$empty2" in
++da39a3ee5e6b4b0d3255bfef95601890afd80709) FIELD=4; SHA1SUM=sha1;;
++*);;
++esac
+ 
+ if
+       date=`date --utc \
+@@ -62,14 +68,14 @@ then
+ else
+       date=`date -jr ${SOURCE_DATE_EPOCH:-$(date +%s)}`
+ fi
+-sha1=`$SHA1SUM $file 2>/dev/null | cut -f1 -d' '`
++sha1=`$SHA1SUM $file 2>/dev/null | cut -f$FIELD -d' '`
+ case "$sha1" in
+ '')   echo "Failed to compute SHA1 of $file" >&2; exit 1;;
+ esac
+ 
+ cp $file $TMP
+ if strip $TMP 2>/dev/null; then
+-      stripped_sha1=`$SHA1SUM $TMP 2>/dev/null | cut -f1 -d' '`
++      stripped_sha1=`$SHA1SUM $TMP 2>/dev/null | cut -f$FIELD -d' '`
+ fi
+ rm -f $TMP
+ 
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_core_bogons.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_core_bogons.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_core_bogons.c     Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_core_bogons.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/core/bogons.c.orig     2022-02-25 16:06:19.000000000 +0000
++++ src/core/bogons.c
+@@ -81,7 +81,7 @@ bogons_load(FILE *f)
+               bogons_mtime = buf.st_mtime;
+       }
+ 
+-      while (fgets(ARYLEN(line), f)) {
++      while (fgets(line, sizeof(line), f)) {
+               linenum++;
+ 
+               /*
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_core_dmesh.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_core_dmesh.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_core_dmesh.c      Sun Dec 25 17:55:14 2022
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_core_dmesh.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/core/dmesh.c.orig      2022-02-25 16:06:19.000000000 +0000
++++ src/core/dmesh.c
+@@ -3372,7 +3372,7 @@ dmesh_retrieve(void)
+        * blank line are attached sources for this SHA1.
+        */
+ 
+-      while (fgets(ARYLEN(tmp), f)) {
++      while (fgets(tmp, sizeof(tmp), f)) {
+               if (!file_line_chomp_tail(ARYLEN(tmp), NULL)) {
+                       truncated = TRUE;
+                       continue;
+@@ -3486,7 +3486,7 @@ dmesh_ban_retrieve(void)
+        * Lines starting with a # are skipped.
+        */
+ 
+-      while (fgets(ARYLEN(tmp), in)) {
++      while (fgets(tmp, sizeof(tmp), in)) {
+               line++;
+ 
+               if (!file_line_chomp_tail(ARYLEN(tmp), NULL)) {
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_core_downloads.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_core_downloads.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_core_downloads.c  Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_core_downloads.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/core/downloads.c.orig  2022-02-25 16:06:19.000000000 +0000
++++ src/core/downloads.c
+@@ -15067,7 +15067,7 @@ download_retrieve_old(FILE *f)
+       d_name = NULL;
+       flags = 0;
+ 
+-      while (fgets(ARYLEN(dl_tmp), f)) {
++      while (fgets(dl_tmp, sizeof(dl_tmp), f)) {
+               line++;
+ 
+               if (!file_line_chomp_tail(ARYLEN(dl_tmp), NULL)) {
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_core_fileinfo.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_core_fileinfo.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_core_fileinfo.c   Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_core_fileinfo.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/core/fileinfo.c.orig   2022-02-25 16:06:19.000000000 +0000
++++ src/core/fileinfo.c
+@@ -3206,7 +3206,7 @@ file_info_retrieve(void)
+       if (!f)
+               return;
+ 
+-      while (fgets(ARYLEN(line), f)) {
++      while (fgets(line, sizeof(line), f)) {
+               int error;
+               bool truncated = FALSE, damaged;
+               const char *ep;
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_core_g2_gwc.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_core_g2_gwc.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_core_g2_gwc.c     Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_core_g2_gwc.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/core/g2/gwc.c.orig     2022-02-25 16:06:19.000000000 +0000
++++ src/core/g2/gwc.c
+@@ -324,7 +324,7 @@ retry:
+       line = 0;
+       added = 0;
+ 
+-      while (fgets(ARYLEN(tmp), in)) {
++      while (fgets(tmp, sizeof(tmp), in)) {
+               line++;
+ 
+               if (tmp[0] == '#')              /* Skip comments */
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_core_geo__ip.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_core_geo__ip.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_core_geo__ip.c    Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_core_geo__ip.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/core/geo_ip.c.orig     2022-02-25 16:06:19.000000000 +0000
++++ src/core/geo_ip.c
+@@ -435,7 +435,7 @@ gip_load(FILE *f, unsigned idx, const ch
+               gip_source[idx].mtime = buf.st_mtime;
+       }
+ 
+-      while (fgets(ARYLEN(line), f)) {
++      while (fgets(line, sizeof(line), f)) {
+               linenum++;
+ 
+               /*
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_core_hcache.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_core_hcache.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_core_hcache.c     Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_core_hcache.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/core/hcache.c.orig     2022-02-25 16:06:19.000000000 +0000
++++ src/core/hcache.c
+@@ -1878,7 +1878,7 @@ hcache_load_file(hostcache_t *hc, FILE *
+       g_return_if_fail(f);
+ 
+       now = tm_time();
+-      while (fgets(ARYLEN(buffer), f)) {
++      while (fgets(buffer, sizeof(buffer), f)) {
+               const char *endptr;
+               host_addr_t addr;
+               uint16 port;
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_core_hostiles.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_core_hostiles.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_core_hostiles.c   Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_core_hostiles.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/core/hostiles.c.orig   2022-02-25 16:06:19.000000000 +0000
++++ src/core/hostiles.c
+@@ -294,7 +294,7 @@ hostiles_load(FILE *f, hostiles_t which)
+ 
+       hostile_db[which] = iprange_new();
+ 
+-      while (fgets(ARYLEN(line), f)) {
++      while (fgets(line, sizeof(line), f)) {
+               linenum++;
+ 
+               /*
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_core_huge.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_core_huge.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_core_huge.c       Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_core_huge.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/core/huge.c.orig       2022-02-25 16:06:19.000000000 +0000
++++ src/core/huge.c
+@@ -402,7 +402,7 @@ sha1_read_cache(void)
+               for (;;) {
+                       char buffer[4096];
+ 
+-                      if (NULL == fgets(ARYLEN(buffer), f))
++                      if (NULL == fgets(buffer, sizeof(buffer), f))
+                               break;
+ 
+                       if (!file_line_chomp_tail(ARYLEN(buffer), NULL)) {
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_core_ignore.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_core_ignore.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_core_ignore.c     Sun Dec 25 17:55:14 2022
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_core_ignore.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/core/ignore.c.orig     2022-02-25 16:06:19.000000000 +0000
++++ src/core/ignore.c
+@@ -165,7 +165,7 @@ sha1_parse(FILE *f, const char *file)
+ 
+       g_assert(f);
+ 
+-      while (fgets(ARYLEN(ign_tmp), f)) {
++      while (fgets(ign_tmp, sizeof(ign_tmp), f)) {
+               line++;
+ 
+               if (!file_line_chomp_tail(ARYLEN(ign_tmp), &len)) {
+@@ -241,7 +241,7 @@ namesize_parse(FILE *f, const char *file
+ 
+       g_assert(f);
+ 
+-      while (fgets(ARYLEN(ign_tmp), f)) {
++      while (fgets(ign_tmp, sizeof(ign_tmp), f)) {
+               line++;
+ 
+               if (!file_line_chomp_tail(ARYLEN(ign_tmp), NULL)) {
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_core_ipp__cache.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_core_ipp__cache.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_core_ipp__cache.c Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_core_ipp__cache.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/core/ipp_cache.c.orig  2022-02-25 16:06:19.000000000 +0000
++++ src/core/ipp_cache.c
+@@ -452,7 +452,7 @@ ipp_cache_parse(ipp_cache_t *ic, FILE *f
+       bit_array_init(tag_used, NUM_IPP_CACHE_TAGS);
+       bit_array_clear_range(tag_used, 0, NUM_IPP_CACHE_TAGS - 1U);
+ 
+-      while (fgets(ARYLEN(line), f)) {
++      while (fgets(line, sizeof(line), f)) {
+               const char *tag_name, *value;
+               char *sp;
+               bool damaged;
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_core_parq.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_core_parq.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_core_parq.c       Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_core_parq.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/core/parq.c.orig       2022-02-25 16:06:19.000000000 +0000
++++ src/core/parq.c
+@@ -5208,7 +5208,7 @@ parq_upload_load_queue(void)
+       entry = zero_entry;
+       bit_array_init(tag_used, NUM_PARQ_TAGS);
+ 
+-      while (fgets(ARYLEN(line), f)) {
++      while (fgets(line, sizeof(line), f)) {
+               const char *tag_name, *value;
+               char *colon;
+               bool damaged;
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_core_spam.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_core_spam.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_core_spam.c       Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_core_spam.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/core/spam.c.orig       2022-02-25 16:06:19.000000000 +0000
++++ src/core/spam.c
+@@ -221,7 +221,7 @@ spam_load(FILE *f)
+       item = zero_item;
+       bit_array_init(tag_used, NUM_SPAM_TAGS);
+ 
+-      while (fgets(ARYLEN(line), f)) {
++      while (fgets(line, sizeof(line), f)) {
+               const char *tag_name, *value;
+               char *sp;
+               spam_tag_t tag;
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_core_spam__sha1.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_core_spam__sha1.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_core_spam__sha1.c Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_core_spam__sha1.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/core/spam_sha1.c.orig  2022-02-25 16:06:19.000000000 +0000
++++ src/core/spam_sha1.c
+@@ -199,7 +199,7 @@ spam_sha1_load(FILE *f)
+       spam_lut_create();
+       sha1_lut.state = SPAM_LOADING;
+ 
+-      while (fgets(ARYLEN(line), f)) {
++      while (fgets(line, sizeof(line), f)) {
+               const struct sha1 *sha1;
+               size_t len;
+ 
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_core_upload__stats.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_core_upload__stats.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_core_upload__stats.c      Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_core_upload__stats.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/core/upload_stats.c.orig       2022-02-25 16:06:19.000000000 +0000
++++ src/core/upload_stats.c
+@@ -223,7 +223,7 @@ upload_stats_load_history(void)
+               goto done;
+ 
+       /* parse, insert names into ul_stats_clist */
+-      while (fgets(ARYLEN(line), upload_stats_file)) {
++      while (fgets(line, sizeof(line), upload_stats_file)) {
+               static const struct ul_stats zero_item;
+               struct ul_stats item;
+               struct sha1 sha1_buf;
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_core_whitelist.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_core_whitelist.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_core_whitelist.c  Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_core_whitelist.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/core/whitelist.c.orig  2022-02-25 16:06:20.000000000 +0000
++++ src/core/whitelist.c
+@@ -339,7 +339,7 @@ whitelist_retrieve(void)
+               return;
+       }
+ 
+-    while (fgets(ARYLEN(line), f)) {
++    while (fgets(line, sizeof(line), f)) {
+               pslist_t *sl_addr, *sl;
+               const char *endptr, *start;
+               host_addr_t addr;
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_dht_routing.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_dht_routing.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_dht_routing.c     Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_dht_routing.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/dht/routing.c.orig     2022-02-25 16:06:20.000000000 +0000
++++ src/dht/routing.c
+@@ -5376,7 +5376,7 @@ dht_route_parse(FILE *f)
+       bit_array_init(tag_used, NUM_DHT_ROUTE_TAGS);
+       nodes = patricia_create(KUID_RAW_BITSIZE);
+ 
+-      while (fgets(ARYLEN(line), f)) {
++      while (fgets(line, sizeof(line), f)) {
+               const char *tag_name, *value;
+               char *sp;
+               dht_route_tag_t tag;
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_lib_getgateway.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_lib_getgateway.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_lib_getgateway.c  Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_lib_getgateway.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/lib/getgateway.c.orig  2022-02-25 16:06:21.000000000 +0000
++++ src/lib/getgateway.c
+@@ -101,7 +101,7 @@ parse_netstat(host_addr_t *addrp)
+        * output is "default" for the default route.
+        */
+ 
+-      while (fgets(ARYLEN(tmp), f)) {
++      while (fgets(tmp, sizeof(tmp), f)) {
+               char *p;
+               uint32 ip;
+ 
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_lib_prop.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_lib_prop.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_lib_prop.c        Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_lib_prop.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/lib/prop.c.orig        2022-02-25 16:06:22.000000000 +0000
++++ src/lib/prop.c
+@@ -2382,7 +2382,7 @@ prop_load_from_file(prop_set_t *ps, cons
+        * ([[:blank:]]*)(("[^"]*")|([^[:space:]]*))
+        *
+        */
+-      while (fgets(ARYLEN(prop_tmp), config)) {
++      while (fgets(prop_tmp, sizeof(prop_tmp), config)) {
+               char *s, *k, *v;
+               int c;
+               property_t prop;
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_lib_symbols.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_lib_symbols.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_lib_symbols.c     Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_lib_symbols.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/lib/symbols.c.orig     2022-02-25 16:06:22.000000000 +0000
++++ src/lib/symbols.c
+@@ -1553,7 +1553,7 @@ symbols_load_from(symbols_t *st, const c
+ #endif        /* MINGW32 */
+ 
+ retry:
+-      while (fgets(ARYLEN(tmp), f)) {
++      while (fgets(tmp, sizeof(tmp), f)) {
+               symbols_parse_nm(st, tmp);
+       }
+ 
Index: pkgsrc/net/gtk-gnutella/patches/patch-src_sdbm_tmp.c
diff -u /dev/null pkgsrc/net/gtk-gnutella/patches/patch-src_sdbm_tmp.c:1.1
--- /dev/null   Sun Dec 25 17:55:14 2022
+++ pkgsrc/net/gtk-gnutella/patches/patch-src_sdbm_tmp.c        Sun Dec 25 17:55:14 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_sdbm_tmp.c,v 1.1 2022/12/25 17:55:14 wiz Exp $
+
+Fix build on NetBSD with SSP.
+
+--- src/sdbm/tmp.c.orig        2022-02-25 16:06:22.000000000 +0000
++++ src/sdbm/tmp.c
+@@ -219,7 +219,7 @@ tmp_clean_entries(int *fd, const char *e
+       eslist_init(&items, offsetof(struct tmp_entry, next));
+       s = str_new(32);
+ 
+-      while (fgets(ARYLEN(line), f)) {
++      while (fgets(line, sizeof(line), f)) {
+               char *extension;
+               pid_t pid;
+               struct tmp_entry *item;



Home | Main Index | Thread Index | Old Index