Fix various problems with adding and removing module DCC bindings

Change remove_all_dcc_binds() so that it only removes DCC binds for the module supplied, as it's supposed to.

get_dcc_type() should ignore the first entry in dcc_types[] ("<none>") otherwise the client will try to
respond to DCC requests with that name.

Explicitly track the number of entries in the dcc_types[] array rather than using a NULL terminator.  This
allows us to change dcc_types[] to use NULL entries to mark unused slots in the array, rather than pointers
to entries with a NULL .name element.  Together, this means that the dcc_types[] array is only resized when it
actually needs to be grown and removal works correctly (without eg. prematurely marking the end of the array).

Make add_dcc_bind() fail if the requested DCC type has already been bound by a module (this still allows one
module at a time to rebind a built-in DCC type).  Previously the behaviour was ill-defined in this case.
This commit is contained in:
Kevin Easton
2018-02-20 23:27:32 +11:00
parent 5ae42802ec
commit 9e7fc85ae1
4 changed files with 84 additions and 42 deletions

View File

@@ -1,5 +1,10 @@
[Changes 1.2.2]
* Fix various problems with adding and removing module DCC bindings. The
same DCC type cannot be bound by more than one module simultaneously. The
remove_all_dcc_binds() function now only removes all DCC bindings for the
given module. (caf)
* Fix crash when unloading the arcfour module. (caf)
* Change add_dcc_bind() to collect all function pointer arguments into a