Previously isc_nm_read() required references on the handle to be at
least 2, under the assumption that it would only ever be called from a
connect or accept callback. however, it can also be called from a read
callback, in which case the reference count might be only 1.
isc_nm_read(isc_nmhandle_t *handle, isc_nm_recv_cb_t cb, void *cbarg) {
REQUIRE(VALID_NMHANDLE(handle));
- /*
- * This is always called via callback (from accept or connect), and
- * caller must attach to the handle, so the references always need to be
- * at least 2.
- */
- REQUIRE(isc_refcount_current(&handle->references) >= 2);
-
switch (handle->sock->type) {
case isc_nm_udpsocket:
isc__nm_udp_read(handle, cb, cbarg);