#include <isc/os.h>
#include <isc/platform.h>
#include <isc/print.h>
+#include <isc/refcount.h>
#include <isc/region.h>
#include <isc/socket.h>
#include <isc/stats.h>
printf("\n\t\tSock Dump\n");
printf("\t\tfd: %Iu\n", sock->fd);
printf("\t\treferences: %" PRIuFAST32 "\n",
- isc_refcount_current(sock->references));
+ isc_refcount_current(&sock->references));
printf("\t\tpending_accept: %u\n", sock->pending_accept);
printf("\t\tconnecting: %u\n", sock->pending_connect);
printf("\t\tconnected: %u\n", sock->connected);
|| sock->pending_recv > 0
|| sock->pending_send > 0
|| sock->pending_accept > 0
- || isc_refcount_current(sock->references) > 0
+ || isc_refcount_current(&sock->references) > 0
|| sock->pending_connect == 1
|| !ISC_LIST_EMPTY(sock->recv_list)
|| !ISC_LIST_EMPTY(sock->send_list)
"con_reset_fix_failed",
sock->pending_recv,
sock->pending_send,
- isc_refcount_current(sock->references));
+ isc_refcount_current(&sock->references));
closesocket(sock->fd);
_set_state(sock, SOCK_CLOSED);
sock->fd = INVALID_SOCKET;
socket_log(__LINE__, sock, NULL, EVENT,
"closed %d %d %" PRIuFAST32 " make_nonblock_failed",
sock->pending_recv, sock->pending_send,
- isc_refcount_current(sock->references));
+ isc_refcount_current(&sock->references));
closesocket(sock->fd);
sock->fd = INVALID_SOCKET;
free_socket(&sock, __LINE__);
void
isc_socket_detach(isc_socket_t **socketp) {
isc_socket_t *sock;
- uint32_t refs;
+ uint32_t references;
REQUIRE(socketp != NULL);
sock = *socketp;
LOCK(&sock->lock);
CONSISTENT(sock);
- references = isc_refcount_decrement(&socket->references);
+ references = isc_refcount_decrement(&sock->references);
socket_log(__LINE__, sock, NULL, EVENT,
"detach_socket %d %d %" PRIuFAST32,
sock->pending_recv, sock->pending_send,
- isc_refcount_current(sock->references));
+ isc_refcount_current(&sock->references));
if (references == 1 && sock->fd != INVALID_SOCKET) {
closesocket(sock->fd);
unsigned int maxsocks, int nthreads)
{
isc_socketmgr_t *manager;
- isc_result_t result;
REQUIRE(managerp != NULL && *managerp == NULL);
TRY0(xmlTextWriterStartElement(writer,
ISC_XMLCHAR "references"));
TRY0(xmlTextWriterWriteFormatString(writer, "%" PRIuFAST32,
- isc_refcount_current(sock->references)));
+ isc_refcount_current(&sock->references)));
TRY0(xmlTextWriterEndElement(writer));
TRY0(xmlTextWriterWriteElement(writer, ISC_XMLCHAR "type",