From: Miek Gieben Date: Thu, 26 Jan 2006 13:02:31 +0000 (+0000) Subject: removed ldns_udp_server_connect() X-Git-Tag: release-1.1.0~378 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ac2adb18bc70fec7dbfa330603984a85610b855;p=thirdparty%2Fldns.git removed ldns_udp_server_connect() --- diff --git a/Changelog b/Changelog index c4bdae7d..f237368d 100644 --- a/Changelog +++ b/Changelog @@ -45,7 +45,10 @@ * ldns_zone_sort: Sort a zone * ldns_bgsend(): background send, returns a socket. Removed: - * ldns_resolver_bgsend(): was not used in 1.0.0. + * ldns_resolver_bgsend(): was not used in 1.0.0 and is not used + now + * ldns_udp_server_connect(): was faulty and isn't really part of + the core ldns idea any how. 18 Oct 2005: 1.0.0: ldns-team diff --git a/TODO b/TODO index 5b08dfe2..eb536ec5 100644 --- a/TODO +++ b/TODO @@ -23,7 +23,6 @@ Post 1.0 Stuff: 1.1.0: ---- - o server stuff yes/no o sorting/sorting ord - removed ord - need to check current sort order o secure tracing drill diff --git a/ldns/net.h b/ldns/net.h index 0b1007eb..de35bb1f 100644 --- a/ldns/net.h +++ b/ldns/net.h @@ -101,16 +101,7 @@ int ldns_tcp_connect(const struct sockaddr_storage *to, socklen_t tolen, struct int ldns_udp_connect(const struct sockaddr_storage *to, struct timeval timeout); /** - * Create a udp socket to the specified address and bind it too (making it - * a server socket) - * \param[in] to ip and family - * \param[in] timeout timeout for the socket - * \return a socket descriptor - */ -int ldns_udp_server_connect(const struct sockaddr_storage *to, struct timeval timeout); - -/** - * send a query via tcp to a server. Don;t want for the answer + * send a query via tcp to a server. Don't want for the answer * * \param[in] qbin the buffer to send * \param[in] sockfd the socket to use diff --git a/net.c b/net.c index 53f9c886..50b4a47f 100644 --- a/net.c +++ b/net.c @@ -238,33 +238,6 @@ ldns_udp_bgsend(ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t return sockfd; } -/* - * ldns_tcp_server_connect - */ -int -ldns_udp_server_connect(const struct sockaddr_storage *to, struct timeval timeout) -{ - int sockfd; - - if ((sockfd = socket((int)((struct sockaddr*)to)->sa_family, SOCK_DGRAM, IPPROTO_UDP)) - == -1) { - return 0; - } - if (setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &timeout, - (socklen_t) sizeof(timeout))) { - perror("setsockopt"); - close(sockfd); - return 0; - } - - if (bind(sockfd, (struct sockaddr*)to, (socklen_t)sizeof(*to)) == -1) { - perror("bind"); - close(sockfd); - return 0; - } - return sockfd; -} - int ldns_udp_connect(const struct sockaddr_storage *to, struct timeval timeout) { @@ -502,10 +475,6 @@ ldns_tcp_bgsend(ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t return sockfd; } -/* Move other function that use sockaddr to here, so that - * all networking code is contained in one file - */ - /* code from rdata.c */ struct sockaddr_storage * ldns_rdf2native_sockaddr_storage(const ldns_rdf *rd, uint16_t port, size_t *size)