Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
BIND
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
579
Issues
579
List
Boards
Labels
Service Desk
Milestones
Merge Requests
109
Merge Requests
109
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
BIND
Commits
467e6fd1
Commit
467e6fd1
authored
Sep 16, 2008
by
Michael Graff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make the same change to win32/socket.c here as was made on v9_5 to fix connected UDP sockets
parent
896f8836
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
66 deletions
+35
-66
CHANGES
CHANGES
+5
-0
lib/isc/win32/socket.c
lib/isc/win32/socket.c
+30
-66
No files found.
CHANGES
View file @
467e6fd1
2443. [bug] win32: UDP connect() would not generate an event,
and so connected UDP sockets would never clean up.
Fix this by doing an immediate WSAConnect() rather
than an io completion port type for UDP.
2442. [bug] A lock could be destroyed twice. [RT# 18626]
2442. [bug] A lock could be destroyed twice. [RT# 18626]
2441. [bug] isc_radix_insert() could copy radix tree nodes
2441. [bug] isc_radix_insert() could copy radix tree nodes
...
...
lib/isc/win32/socket.c
View file @
467e6fd1
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
* PERFORMANCE OF THIS SOFTWARE.
*/
*/
/* $Id: socket.c,v 1.
69 2008/09/12 04:46:25 marka
Exp $ */
/* $Id: socket.c,v 1.
70 2008/09/16 17:19:01 explorer
Exp $ */
/* This code uses functions which are only available on Server 2003 and
/* This code uses functions which are only available on Server 2003 and
* higher, and Windows XP and higher.
* higher, and Windows XP and higher.
...
@@ -86,14 +86,6 @@ LPFN_CONNECTEX ISCConnectEx;
...
@@ -86,14 +86,6 @@ LPFN_CONNECTEX ISCConnectEx;
LPFN_ACCEPTEX
ISCAcceptEx
;
LPFN_ACCEPTEX
ISCAcceptEx
;
LPFN_GETACCEPTEXSOCKADDRS
ISCGetAcceptExSockaddrs
;
LPFN_GETACCEPTEXSOCKADDRS
ISCGetAcceptExSockaddrs
;
/*
* 0 = no debugging, 1 = write to file "socket.log" in working directory.
*/
#define XXXMLG_DEBUG 0
#if XXXMLG_DEBUG
FILE
*
logfile
=
NULL
;
#endif
/*
/*
* Run expensive internal consistancy checks.
* Run expensive internal consistancy checks.
*/
*/
...
@@ -823,20 +815,10 @@ socket_log(int lineno, isc_socket_t *sock, isc_sockaddr_t *address,
...
@@ -823,20 +815,10 @@ socket_log(int lineno, isc_socket_t *sock, isc_sockaddr_t *address,
char
msgbuf
[
2048
];
char
msgbuf
[
2048
];
char
peerbuf
[
256
];
char
peerbuf
[
256
];
va_list
ap
;
va_list
ap
;
#if XXXMLG_DEBUG
char
timebuf
[
128
];
isc_time_t
now
;
#endif
#if XXXMLG_DEBUG
isc_time_now
(
&
now
);
isc_time_formattimestamp
(
&
now
,
timebuf
,
sizeof
timebuf
);
#endif
#if XXXMLG_DEBUG == 0
if
(
!
isc_log_wouldlog
(
isc_lctx
,
level
))
if
(
!
isc_log_wouldlog
(
isc_lctx
,
level
))
return
;
return
;
#endif
va_start
(
ap
,
fmt
);
va_start
(
ap
,
fmt
);
vsnprintf
(
msgbuf
,
sizeof
(
msgbuf
),
fmt
,
ap
);
vsnprintf
(
msgbuf
,
sizeof
(
msgbuf
),
fmt
,
ap
);
...
@@ -846,28 +828,14 @@ socket_log(int lineno, isc_socket_t *sock, isc_sockaddr_t *address,
...
@@ -846,28 +828,14 @@ socket_log(int lineno, isc_socket_t *sock, isc_sockaddr_t *address,
isc_log_iwrite
(
isc_lctx
,
category
,
module
,
level
,
isc_log_iwrite
(
isc_lctx
,
category
,
module
,
level
,
msgcat
,
msgset
,
message
,
msgcat
,
msgset
,
message
,
"socket %p line %d: %s"
,
sock
,
lineno
,
msgbuf
);
"socket %p line %d: %s"
,
sock
,
lineno
,
msgbuf
);
#if XXXMLG_DEBUG
if
(
logfile
)
fprintf
(
logfile
,
"%s socket %p line %d: %s:
\n
"
,
timebuf
,
sock
,
lineno
,
msgbuf
);
#endif
}
else
{
}
else
{
isc_sockaddr_format
(
address
,
peerbuf
,
sizeof
(
peerbuf
));
isc_sockaddr_format
(
address
,
peerbuf
,
sizeof
(
peerbuf
));
isc_log_iwrite
(
isc_lctx
,
category
,
module
,
level
,
isc_log_iwrite
(
isc_lctx
,
category
,
module
,
level
,
msgcat
,
msgset
,
message
,
msgcat
,
msgset
,
message
,
"socket %p line %d peer %s: %s"
,
sock
,
lineno
,
"socket %p line %d peer %s: %s"
,
sock
,
lineno
,
peerbuf
,
msgbuf
);
peerbuf
,
msgbuf
);
#if XXXMLG_DEBUG
if
(
logfile
)
fprintf
(
logfile
,
"%s socket %p line %d: %s: %s
\n
"
,
timebuf
,
sock
,
lineno
,
peerbuf
,
msgbuf
);
#endif
}
}
#if XXXMLG_DEBUG
if
(
logfile
)
fflush
(
logfile
);
#endif
}
}
/*
/*
...
@@ -2479,10 +2447,6 @@ isc_socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp,
...
@@ -2479,10 +2447,6 @@ isc_socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp,
if
(
maxsocks
!=
0
)
if
(
maxsocks
!=
0
)
return
(
ISC_R_NOTIMPLEMENTED
);
return
(
ISC_R_NOTIMPLEMENTED
);
#if XXXMLG_DEBUG
logfile
=
fopen
(
"socket.log"
,
"w"
);
#endif
manager
=
isc_mem_get
(
mctx
,
sizeof
(
*
manager
));
manager
=
isc_mem_get
(
mctx
,
sizeof
(
*
manager
));
if
(
manager
==
NULL
)
if
(
manager
==
NULL
)
return
(
ISC_R_NOMEMORY
);
return
(
ISC_R_NOMEMORY
);
...
@@ -2534,11 +2498,6 @@ isc_socketmgr_destroy(isc_socketmgr_t **managerp) {
...
@@ -2534,11 +2498,6 @@ isc_socketmgr_destroy(isc_socketmgr_t **managerp) {
int
i
;
int
i
;
isc_mem_t
*
mctx
;
isc_mem_t
*
mctx
;
#if XXXMLG_DEBUG
if
(
logfile
)
fclose
(
logfile
);
#endif
/*
/*
* Destroy a socket manager.
* Destroy a socket manager.
*/
*/
...
@@ -3345,34 +3304,39 @@ isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr,
...
@@ -3345,34 +3304,39 @@ isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr,
}
}
ISC_LINK_INIT
(
cdev
,
ev_link
);
ISC_LINK_INIT
(
cdev
,
ev_link
);
/*
if
(
sock
->
type
==
isc_sockettype_tcp
)
{
* Queue io completion for an accept().
/*
*/
* Queue io completion for an accept().
lpo
=
(
IoCompletionInfo
*
)
HeapAlloc
(
hHeapHandle
,
*/
HEAP_ZERO_MEMORY
,
lpo
=
(
IoCompletionInfo
*
)
HeapAlloc
(
hHeapHandle
,
sizeof
(
IoCompletionInfo
));
HEAP_ZERO_MEMORY
,
lpo
->
cdev
=
cdev
;
sizeof
(
IoCompletionInfo
));
lpo
->
request_type
=
SOCKET_CONNECT
;
lpo
->
cdev
=
cdev
;
lpo
->
request_type
=
SOCKET_CONNECT
;
sock
->
address
=
*
addr
;
ISCConnectEx
(
sock
->
fd
,
&
addr
->
type
.
sa
,
addr
->
length
,
NULL
,
0
,
NULL
,
(
LPOVERLAPPED
)
lpo
);
/*
sock
->
address
=
*
addr
;
* Attach to task.
ISCConnectEx
(
sock
->
fd
,
&
addr
->
type
.
sa
,
addr
->
length
,
*/
NULL
,
0
,
NULL
,
(
LPOVERLAPPED
)
lpo
);
isc_task_attach
(
task
,
&
ntask
);
cdev
->
ev_sender
=
ntask
;
sock
->
pending_connect
=
1
;
/*
_set_state
(
sock
,
SOCK_CONNECT
);
* Attach to task.
*/
isc_task_attach
(
task
,
&
ntask
);
cdev
->
ev_sender
=
ntask
;
/*
sock
->
pending_connect
=
1
;
* Enqueue the request.
_set_state
(
sock
,
SOCK_CONNECT
);
*/
sock
->
connect_ev
=
cdev
;
sock
->
pending_iocp
++
;
/*
* Enqueue the request.
*/
sock
->
connect_ev
=
cdev
;
sock
->
pending_iocp
++
;
}
else
{
WSAConnect
(
sock
->
fd
,
&
addr
->
type
.
sa
,
addr
->
length
,
NULL
,
NULL
,
NULL
,
NULL
);
cdev
->
result
=
ISC_R_SUCCESS
;
isc_task_send
(
task
,
(
isc_event_t
**
)
&
cdev
);
}
CONSISTENT
(
sock
);
CONSISTENT
(
sock
);
UNLOCK
(
&
sock
->
lock
);
UNLOCK
(
&
sock
->
lock
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment