winbind: Speed up wbinfo -p
authorVolker Lendecke <vl@samba.org>
Wed, 18 Apr 2018 15:29:51 +0000 (17:29 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 24 Apr 2018 15:18:23 +0000 (17:18 +0200)
This was (possibly) used as an example in the early days of the async winbind
code we have today. It's not necessary to send this through a full tevent_req
round.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Apr 24 17:18:23 CEST 2018 on sn-devel-144

source3/winbindd/wb_ping.c [deleted file]
source3/winbindd/winbindd.c
source3/winbindd/winbindd_misc.c
source3/winbindd/winbindd_proto.h
source3/winbindd/wscript_build

diff --git a/source3/winbindd/wb_ping.c b/source3/winbindd/wb_ping.c
deleted file mode 100644 (file)
index bfba3c1..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-   Unix SMB/CIFS implementation.
-   async implementation of WINBINDD_PING
-   Copyright (C) Volker Lendecke 2009
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "winbindd.h"
-
-struct wb_ping_state {
-       uint8_t dummy;
-};
-
-struct tevent_req *wb_ping_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
-                               struct winbindd_cli_state *cli,
-                               struct winbindd_request *request)
-{
-       struct tevent_req *req;
-       struct wb_ping_state *state;
-
-       req = tevent_req_create(mem_ctx, &state, struct wb_ping_state);
-       if (req == NULL) {
-               return NULL;
-       }
-       tevent_req_done(req);
-       tevent_req_post(req, ev);
-       return req;
-}
-
-NTSTATUS wb_ping_recv(struct tevent_req *req, struct winbindd_response *presp)
-{
-       return NT_STATUS_OK;
-}
index b908d91e206447975003031a9e6471b654f2ca13..76d644b1ba60302ab6acf1820f729b71e73d105b 100644 (file)
@@ -535,6 +535,7 @@ static struct winbindd_dispatch_table {
        /* Miscellaneous */
 
        { WINBINDD_INFO, winbindd_info, "INFO" },
+       { WINBINDD_PING, winbindd_ping, "PING" },
        { WINBINDD_INTERFACE_VERSION, winbindd_interface_version,
          "INTERFACE_VERSION" },
        { WINBINDD_DOMAIN_NAME, winbindd_domain_name, "DOMAIN_NAME" },
@@ -565,8 +566,6 @@ struct winbindd_async_dispatch_table {
 };
 
 static struct winbindd_async_dispatch_table async_nonpriv_table[] = {
-       { WINBINDD_PING, "PING",
-         wb_ping_send, wb_ping_recv },
        { WINBINDD_LOOKUPSID, "LOOKUPSID",
          winbindd_lookupsid_send, winbindd_lookupsid_recv },
        { WINBINDD_LOOKUPSIDS, "LOOKUPSIDS",
index 964190e7c62fdb41877f843a6cf230d10bac165d..c101269e93afcb8f9ed500b359803d4f87b2ee85 100644 (file)
@@ -502,6 +502,12 @@ void winbindd_dc_info(struct winbindd_cli_state *cli)
        request_ok(cli);
 }
 
+void winbindd_ping(struct winbindd_cli_state *state)
+{
+       DEBUG(3, ("[%5lu]: ping\n", (unsigned long)state->pid));
+       request_ok(state);
+}
+
 /* List various tidbits of information */
 
 void winbindd_info(struct winbindd_cli_state *state)
index 6a63b151720601d15b08eae8123f977f5ad3889a..bbc6841e0043999a6ad3696592538f5414c0c7b2 100644 (file)
@@ -529,12 +529,6 @@ bool parse_xidlist(TALLOC_CTX *mem_ctx, const char *xidstr,
 
 void winbindd_wins_byname(struct winbindd_cli_state *state);
 
-struct tevent_req *wb_ping_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
-                               struct winbindd_cli_state *cli,
-                               struct winbindd_request *request);
-NTSTATUS wb_ping_recv(struct tevent_req *req,
-                     struct winbindd_response *resp);
-
 enum winbindd_result winbindd_dual_ping(struct winbindd_domain *domain,
                                        struct winbindd_cli_state *state);
 
index 48250ea565e3b4ff1906d4e49344b4f3bb354a79..0adbe9cbba1bc1a6b802d7b998b243138ea0269e 100644 (file)
@@ -198,7 +198,6 @@ bld.SAMBA3_BINARY('winbindd',
                  winbindd_idmap.c
                  winbindd_locator.c
                  winbindd_ndr.c
-                 wb_ping.c
                  wb_lookupsid.c
                  wb_lookupsids.c
                  wb_lookupname.c