2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 23:25:38 +00:00

Merge branch '1139-1952-breaks-windows-build' into 'master'

Resolve "!1952 Breaks Windows Build"

Closes #1139

See merge request isc-projects/bind9!2145
This commit is contained in:
Witold Krecicki
2019-07-10 09:18:23 -04:00

View File

@@ -55,6 +55,7 @@
#include <isc/os.h> #include <isc/os.h>
#include <isc/platform.h> #include <isc/platform.h>
#include <isc/print.h> #include <isc/print.h>
#include <isc/refcount.h>
#include <isc/region.h> #include <isc/region.h>
#include <isc/socket.h> #include <isc/socket.h>
#include <isc/stats.h> #include <isc/stats.h>
@@ -393,7 +394,7 @@ sock_dump(isc_socket_t *sock) {
printf("\n\t\tSock Dump\n"); printf("\n\t\tSock Dump\n");
printf("\t\tfd: %Iu\n", sock->fd); printf("\t\tfd: %Iu\n", sock->fd);
printf("\t\treferences: %" PRIuFAST32 "\n", 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\tpending_accept: %u\n", sock->pending_accept);
printf("\t\tconnecting: %u\n", sock->pending_connect); printf("\t\tconnecting: %u\n", sock->pending_connect);
printf("\t\tconnected: %u\n", sock->connected); printf("\t\tconnected: %u\n", sock->connected);
@@ -1450,7 +1451,7 @@ maybe_free_socket(isc_socket_t **socketp, int lineno) {
|| sock->pending_recv > 0 || sock->pending_recv > 0
|| sock->pending_send > 0 || sock->pending_send > 0
|| sock->pending_accept > 0 || sock->pending_accept > 0
|| isc_refcount_current(sock->references) > 0 || isc_refcount_current(&sock->references) > 0
|| sock->pending_connect == 1 || sock->pending_connect == 1
|| !ISC_LIST_EMPTY(sock->recv_list) || !ISC_LIST_EMPTY(sock->recv_list)
|| !ISC_LIST_EMPTY(sock->send_list) || !ISC_LIST_EMPTY(sock->send_list)
@@ -1543,7 +1544,7 @@ socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
"con_reset_fix_failed", "con_reset_fix_failed",
sock->pending_recv, sock->pending_recv,
sock->pending_send, sock->pending_send,
isc_refcount_current(sock->references)); isc_refcount_current(&sock->references));
closesocket(sock->fd); closesocket(sock->fd);
_set_state(sock, SOCK_CLOSED); _set_state(sock, SOCK_CLOSED);
sock->fd = INVALID_SOCKET; sock->fd = INVALID_SOCKET;
@@ -1595,7 +1596,7 @@ socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
socket_log(__LINE__, sock, NULL, EVENT, socket_log(__LINE__, sock, NULL, EVENT,
"closed %d %d %" PRIuFAST32 " make_nonblock_failed", "closed %d %d %" PRIuFAST32 " make_nonblock_failed",
sock->pending_recv, sock->pending_send, sock->pending_recv, sock->pending_send,
isc_refcount_current(sock->references)); isc_refcount_current(&sock->references));
closesocket(sock->fd); closesocket(sock->fd);
sock->fd = INVALID_SOCKET; sock->fd = INVALID_SOCKET;
free_socket(&sock, __LINE__); free_socket(&sock, __LINE__);
@@ -1739,7 +1740,7 @@ isc_socket_attach(isc_socket_t *sock, isc_socket_t **socketp) {
void void
isc_socket_detach(isc_socket_t **socketp) { isc_socket_detach(isc_socket_t **socketp) {
isc_socket_t *sock; isc_socket_t *sock;
uint32_t refs; uint32_t references;
REQUIRE(socketp != NULL); REQUIRE(socketp != NULL);
sock = *socketp; sock = *socketp;
@@ -1748,12 +1749,12 @@ isc_socket_detach(isc_socket_t **socketp) {
LOCK(&sock->lock); LOCK(&sock->lock);
CONSISTENT(sock); CONSISTENT(sock);
references = isc_refcount_decrement(&socket->references); references = isc_refcount_decrement(&sock->references);
socket_log(__LINE__, sock, NULL, EVENT, socket_log(__LINE__, sock, NULL, EVENT,
"detach_socket %d %d %" PRIuFAST32, "detach_socket %d %d %" PRIuFAST32,
sock->pending_recv, sock->pending_send, sock->pending_recv, sock->pending_send,
isc_refcount_current(sock->references)); isc_refcount_current(&sock->references));
if (references == 1 && sock->fd != INVALID_SOCKET) { if (references == 1 && sock->fd != INVALID_SOCKET) {
closesocket(sock->fd); closesocket(sock->fd);
@@ -2488,7 +2489,6 @@ isc_socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp,
unsigned int maxsocks, int nthreads) unsigned int maxsocks, int nthreads)
{ {
isc_socketmgr_t *manager; isc_socketmgr_t *manager;
isc_result_t result;
REQUIRE(managerp != NULL && *managerp == NULL); REQUIRE(managerp != NULL && *managerp == NULL);
@@ -3675,7 +3675,7 @@ isc_socketmgr_renderxml(isc_socketmgr_t *mgr, void *writer0)
TRY0(xmlTextWriterStartElement(writer, TRY0(xmlTextWriterStartElement(writer,
ISC_XMLCHAR "references")); ISC_XMLCHAR "references"));
TRY0(xmlTextWriterWriteFormatString(writer, "%" PRIuFAST32, TRY0(xmlTextWriterWriteFormatString(writer, "%" PRIuFAST32,
isc_refcount_current(sock->references))); isc_refcount_current(&sock->references)));
TRY0(xmlTextWriterEndElement(writer)); TRY0(xmlTextWriterEndElement(writer));
TRY0(xmlTextWriterWriteElement(writer, ISC_XMLCHAR "type", TRY0(xmlTextWriterWriteElement(writer, ISC_XMLCHAR "type",