lib: Remove unused getaddinfo_send/recv
authorVolker Lendecke <vl@samba.org>
Wed, 18 Oct 2017 15:13:04 +0000 (17:13 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 20 Oct 2017 18:03:13 +0000 (20:03 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/include/proto.h
source3/lib/util_sock.c

index b2c3a03a1933475cb565832c8a1febc284bc8a89..1a27996a21bafbeacc15e42f28dc9e59cfddc6c1 100644 (file)
@@ -569,13 +569,6 @@ int create_pipe_sock(const char *socket_dir,
 int create_tcpip_socket(const struct sockaddr_storage *ifss, uint16_t *port);
 const char *get_mydnsfullname(void);
 bool is_myname_or_ipaddr(const char *s);
-struct tevent_req *getaddrinfo_send(TALLOC_CTX *mem_ctx,
-                                   struct tevent_context *ev,
-                                   struct fncall_context *ctx,
-                                   const char *node,
-                                   const char *service,
-                                   const struct addrinfo *hints);
-int getaddrinfo_recv(struct tevent_req *req, struct addrinfo **res);
 int poll_one_fd(int fd, int events, int timeout, int *revents);
 int poll_intr_one_fd(int fd, int events, int timeout, int *revents);
 
index 0e1a66c827381d7f2fe4a0a336b82e8f81cc6bdd..c74fcd9138dc1c7ee32d25de6f08b19dfc79057f 100644 (file)
@@ -1346,88 +1346,6 @@ bool is_myname_or_ipaddr(const char *s)
        return false;
 }
 
-struct getaddrinfo_state {
-       const char *node;
-       const char *service;
-       const struct addrinfo *hints;
-       struct addrinfo *res;
-       int ret;
-};
-
-static void getaddrinfo_do(void *private_data);
-static void getaddrinfo_done(struct tevent_req *subreq);
-
-struct tevent_req *getaddrinfo_send(TALLOC_CTX *mem_ctx,
-                                   struct tevent_context *ev,
-                                   struct fncall_context *ctx,
-                                   const char *node,
-                                   const char *service,
-                                   const struct addrinfo *hints)
-{
-       struct tevent_req *req, *subreq;
-       struct getaddrinfo_state *state;
-
-       req = tevent_req_create(mem_ctx, &state, struct getaddrinfo_state);
-       if (req == NULL) {
-               return NULL;
-       }
-
-       state->node = node;
-       state->service = service;
-       state->hints = hints;
-
-       subreq = fncall_send(state, ev, ctx, getaddrinfo_do, state);
-       if (tevent_req_nomem(subreq, req)) {
-               return tevent_req_post(req, ev);
-       }
-       tevent_req_set_callback(subreq, getaddrinfo_done, req);
-       return req;
-}
-
-static void getaddrinfo_do(void *private_data)
-{
-       struct getaddrinfo_state *state =
-               talloc_get_type_abort(private_data, struct getaddrinfo_state);
-
-       state->ret = getaddrinfo(state->node, state->service, state->hints,
-                                &state->res);
-}
-
-static void getaddrinfo_done(struct tevent_req *subreq)
-{
-       struct tevent_req *req = tevent_req_callback_data(
-               subreq, struct tevent_req);
-       int ret, err;
-
-       ret = fncall_recv(subreq, &err);
-       TALLOC_FREE(subreq);
-       if (ret == -1) {
-               tevent_req_error(req, err);
-               return;
-       }
-       tevent_req_done(req);
-}
-
-int getaddrinfo_recv(struct tevent_req *req, struct addrinfo **res)
-{
-       struct getaddrinfo_state *state = tevent_req_data(
-               req, struct getaddrinfo_state);
-       int err;
-
-       if (tevent_req_is_unix_error(req, &err)) {
-               switch(err) {
-               case ENOMEM:
-                       return EAI_MEMORY;
-               default:
-                       return EAI_FAIL;
-               }
-       }
-       if (state->ret == 0) {
-               *res = state->res;
-       }
-       return state->ret;
-}
-
 int poll_one_fd(int fd, int events, int timeout, int *revents)
 {
        struct pollfd pfd;