mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 15:45:25 +00:00
work around HP-UX UDP connect behavior [RT #18202]
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: socket.c,v 1.284 2008/06/25 00:09:50 jinmei Exp $ */
|
/* $Id: socket.c,v 1.285 2008/06/25 22:56:33 jinmei Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@@ -4390,6 +4390,16 @@ isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr,
|
|||||||
sock->peer_address = *addr;
|
sock->peer_address = *addr;
|
||||||
cc = connect(sock->fd, &addr->type.sa, addr->length);
|
cc = connect(sock->fd, &addr->type.sa, addr->length);
|
||||||
if (cc < 0) {
|
if (cc < 0) {
|
||||||
|
/*
|
||||||
|
* HP-UX "fails" to connect a UDP socket and sets errno to
|
||||||
|
* EINPROGRESS if it's non-blocking. We'd rather regard this as
|
||||||
|
* a success and let the user detect it if it's really an error
|
||||||
|
* at the time of sending a packet on the socket.
|
||||||
|
*/
|
||||||
|
if (sock->type == isc_sockettype_udp && errno == EINPROGRESS) {
|
||||||
|
cc = 0;
|
||||||
|
goto success;
|
||||||
|
}
|
||||||
if (SOFT_ERROR(errno) || errno == EINPROGRESS)
|
if (SOFT_ERROR(errno) || errno == EINPROGRESS)
|
||||||
goto queue;
|
goto queue;
|
||||||
|
|
||||||
@@ -4431,6 +4441,7 @@ isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr,
|
|||||||
/*
|
/*
|
||||||
* If connect completed, fire off the done event.
|
* If connect completed, fire off the done event.
|
||||||
*/
|
*/
|
||||||
|
success:
|
||||||
if (cc == 0) {
|
if (cc == 0) {
|
||||||
sock->connected = 1;
|
sock->connected = 1;
|
||||||
sock->bound = 1;
|
sock->bound = 1;
|
||||||
|
Reference in New Issue
Block a user