From: Nick Mathewson Date: Thu, 22 Jul 2010 12:38:08 +0000 (+0200) Subject: Replace (unused,always 0) is_tcp argument to evdns_add_server_port*() with flags X-Git-Tag: release-2.0.6-rc~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e1c1167cbe7c3c7e60267abe242a2fa91f4c2dfe;p=libevent Replace (unused,always 0) is_tcp argument to evdns_add_server_port*() with flags Since we weren't using it for anything, and we always failed if it was set, we're allowed to change the future semantics of setting it. --- diff --git a/evdns.c b/evdns.c index c9670fc5..1f575c3c 100644 --- a/evdns.c +++ b/evdns.c @@ -1597,11 +1597,11 @@ evdns_request_data_build(const char *const name, const int name_len, /* exported function */ struct evdns_server_port * -evdns_add_server_port_with_base(struct event_base *base, evutil_socket_t socket, int is_tcp, evdns_request_callback_fn_type cb, void *user_data) +evdns_add_server_port_with_base(struct event_base *base, evutil_socket_t socket, int flags, evdns_request_callback_fn_type cb, void *user_data) { struct evdns_server_port *port; - if (is_tcp) - return NULL; /* TCP sockets not yet implemented */ + if (flags) + return NULL; /* flags not yet implemented */ if (!(port = mm_malloc(sizeof(struct evdns_server_port)))) return NULL; memset(port, 0, sizeof(struct evdns_server_port)); @@ -1628,9 +1628,9 @@ evdns_add_server_port_with_base(struct event_base *base, evutil_socket_t socket, } struct evdns_server_port * -evdns_add_server_port(evutil_socket_t socket, int is_tcp, evdns_request_callback_fn_type cb, void *user_data) +evdns_add_server_port(evutil_socket_t socket, int flags, evdns_request_callback_fn_type cb, void *user_data) { - return evdns_add_server_port_with_base(NULL, socket, is_tcp, cb, user_data); + return evdns_add_server_port_with_base(NULL, socket, flags, cb, user_data); } /* exported function */ diff --git a/include/event2/dns.h b/include/event2/dns.h index a954066f..fa54381e 100644 --- a/include/event2/dns.h +++ b/include/event2/dns.h @@ -554,13 +554,13 @@ typedef void (*evdns_request_callback_fn_type)(struct evdns_server_request *, vo @param base The event base to handle events for the server port. @param socket A UDP socket to accept DNS requests. - @param is_tcp Always 0 for now. + @param flags Always 0 for now. @param callback A function to invoke whenever we get a DNS request on the socket. @param user_data Data to pass to the callback. @return an evdns_server_port structure for this server port. */ -struct evdns_server_port *evdns_add_server_port_with_base(struct event_base *base, evutil_socket_t socket, int is_tcp, evdns_request_callback_fn_type callback, void *user_data); +struct evdns_server_port *evdns_add_server_port_with_base(struct event_base *base, evutil_socket_t socket, int flags, evdns_request_callback_fn_type callback, void *user_data); /** Close down a DNS server port, and free associated structures. */ void evdns_close_server_port(struct evdns_server_port *port); diff --git a/include/event2/dns_compat.h b/include/event2/dns_compat.h index 3c207feb..cd7946cf 100644 --- a/include/event2/dns_compat.h +++ b/include/event2/dns_compat.h @@ -321,7 +321,7 @@ void evdns_search_ndots_set(const int ndots); function is evdns_add_server_port_with_base(). */ -struct evdns_server_port *evdns_add_server_port(evutil_socket_t socket, int is_tcp, evdns_request_callback_fn_type callback, void *user_data); +struct evdns_server_port *evdns_add_server_port(evutil_socket_t socket, int flags, evdns_request_callback_fn_type callback, void *user_data); #ifdef WIN32 int evdns_config_windows_nameservers(void);