should not be used for isc_sockettype_fdwatch sockets.
[RT #18521]
+2419. [cleanup] Document that isc_socket_create() and isc_socket_open()
+ should not be used for isc_sockettype_fdwatch sockets.
+ [RT #18521]
+
2418. [bug] AXFR request on a DLZ could trigger a REQUIRE failure
[RT #18430]
2406. [bug] Sockets could be closed too early, leading to
inconsistent states in the socket module. [RT #18298]
+xxxx. [bug] Connecting UDP sockets for outgoing queries could
+ unexpectedly fail with an 'address already in use'
+ error.
+
2405. [cleanup] The default value for dnssec-validation was changed to
"yes" in 9.5.0-P1 and all subsequent releases; this
was inadvertently omitted from CHANGES at the time.
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: socket.h,v 1.81 2008/07/23 23:47:07 tbox Exp $ */
+/* $Id: socket.h,v 1.82 2008/08/20 06:16:05 marka Exp $ */
#ifndef ISC_SOCKET_H
#define ISC_SOCKET_H 1
/*%<
* Create a new 'type' socket managed by 'manager'.
*
+ * For isc_sockettype_fdwatch sockets you should use isc_socket_fdwatchcreate()
+ * rather than isc_socket_create().
+ *
* Note:
*
*\li 'pf' is the desired protocol family, e.g. PF_INET or PF_INET6.
*
*\li 'socketp' is a valid pointer, and *socketp == NULL
*
+ *\li 'type' is not isc_sockettype_fdwatch
+ *
* Ensures:
*
* '*socketp' is attached to the newly created socket
* one. This optimization may not be available for some systems, in which
* case this function will return ISC_R_NOTIMPLEMENTED and must not be used.
*
+ * isc_socket_open() should not be called on sockets created by
+ * isc_socket_fdwatchcreate().
+ *
* Requires:
*
* \li there must be no other reference to this socket.
*
* \li 'socket' is a valid and previously closed by isc_socket_close()
*
+ * \li 'sock->type' is not isc_sockettype_fdwatch
+ *
* Returns:
* Same as isc_socket_create().
* \li ISC_R_NOTIMPLEMENTED
* systems, in which case this function will return ISC_R_NOTIMPLEMENTED and
* must not be used.
*
+ * isc_socket_close() should not be called on sockets created by
+ * isc_socket_fdwatchcreate().
+ *
* Requires:
*
* \li The socket must have a valid descriptor.
*
* \li There must be no pending I/O requests.
*
+ * \li 'sock->type' is not isc_sockettype_fdwatch
+ *
* Returns:
* \li #ISC_R_NOTIMPLEMENTED
*/
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: socket.c,v 1.299 2008/08/13 23:44:18 jinmei Exp $ */
+/* $Id: socket.c,v 1.300 2008/08/20 06:16:05 marka Exp $ */
/*! \file */
sock->fd = socket(sock->pf, SOCK_STREAM, 0);
break;
case isc_sockettype_fdwatch:
- INSIST(sock->type != isc_sockettype_fdwatch);
+ /*
+ * We should not be called for isc_sockettype_fdwatch sockets.
+ */
+ INSIST(0);
break;
}
if (sock->fd == -1 && errno == EINTR && tries++ < 42)
REQUIRE(VALID_MANAGER(manager));
REQUIRE(socketp != NULL && *socketp == NULL);
+ REQUIRE(type != isc_sockettype_fdwatch);
result = allocate_socket(manager, type, &sock);
if (result != ISC_R_SUCCESS)
LOCK(&sock->lock);
REQUIRE(sock->references == 1);
+ REQUIRE(sock->type != isc_sockettype_fdwatch);
UNLOCK(&sock->lock);
/*
* We don't need to retain the lock hereafter, since no one else has
LOCK(&sock->lock);
REQUIRE(sock->references == 1);
+ REQUIRE(sock->type != isc_sockettype_fdwatch);
UNLOCK(&sock->lock);
/*
* We don't need to retain the lock hereafter, since no one else has
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: socket.c,v 1.64 2008/08/08 06:28:59 tbox Exp $ */
+/* $Id: socket.c,v 1.65 2008/08/20 06:16:05 marka Exp $ */
/* This code has been rewritten to take advantage of Windows Sockets
* I/O Completion Ports and Events. I/O Completion Ports is ONLY
REQUIRE(VALID_MANAGER(manager));
REQUIRE(socketp != NULL && *socketp == NULL);
+ REQUIRE(type != isc_sockettype_fdwatch);
result = allocate_socket(manager, type, &sock);
if (result != ISC_R_SUCCESS)
isc_result_t
isc_socket_open(isc_socket_t *sock) {
REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(sock->type != isc_sockettype_fdwatch);
return (ISC_R_NOTIMPLEMENTED);
}
isc_result_t
isc_socket_close(isc_socket_t *sock) {
REQUIRE(VALID_SOCKET(sock));
+ REQUIRE(sock->type != isc_sockettype_fdwatch);
return (ISC_R_NOTIMPLEMENTED);
}