Remove another use of global_loadparm.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 2 Nov 2008 17:27:24 +0000 (18:27 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 2 Nov 2008 17:27:24 +0000 (18:27 +0100)
libcli/nbt/libnbt.h
libcli/nbt/nbtsocket.c
libcli/nbt/pynbt.c
libcli/nbt/tools/nmblookup.c

index 4ef4e9d60d15766dad3eaacba24b30d1ef523ccc..e03352d7cf5944c3375a84c34c0404d39d9f74d1 100644 (file)
@@ -122,6 +122,8 @@ struct nbt_name_socket {
                                struct socket_address *);
                void *private_data;
        } unexpected;
+
+       uint32_t wack_timeout;
 };
 
 
index dbbdc1b02a4eeac334edbd0d7366f9dfc9b27753..65ed8725331c7ed70e4e46a082fc3361fbcf48b7 100644 (file)
@@ -247,7 +247,7 @@ static void nbt_name_socket_recv(struct nbt_name_socket *nbtsock)
                req->received_wack = true;
                /* although there can be a timeout in the packet, w2k3 screws it up,
                   so better to set it ourselves */
-               req->timeout = lp_parm_int(global_loadparm, NULL, "nbt", "wack_timeout", 30);
+               req->timeout = nbtsock->wack_timeout;
                req->te = event_add_timed(req->nbtsock->event_ctx, req,
                                          timeval_current_ofs(req->timeout, 0),
                                          nbt_name_socket_timeout, req);
@@ -334,6 +334,7 @@ _PUBLIC_ struct nbt_name_socket *nbt_name_socket_init(TALLOC_CTX *mem_ctx,
 
        nbtsock->send_queue = NULL;
        nbtsock->num_pending = 0;
+       nbtsock->wack_timeout = 30;
        nbtsock->incoming.handler = NULL;
        nbtsock->unexpected.handler = NULL;
        nbtsock->iconv_convenience = iconv_convenience;
index 9179245e88777bfaf3641fcf3227daa74159e4c6..6750ad7b4e622624d947a493791658aae593a588 100644 (file)
@@ -48,7 +48,8 @@ static PyObject *py_nbt_node_init(PyTypeObject *self, PyObject *args, PyObject *
                return NULL;
 
        ev = s4_event_context_init(ret->mem_ctx);
-       ret->socket = nbt_name_socket_init(ret->mem_ctx, ev, py_iconv_convenience(ret->mem_ctx));
+       ret->socket = nbt_name_socket_init(ret->mem_ctx, ev, 
+                                                                          py_iconv_convenience(ret->mem_ctx));
        return (PyObject *)ret;
 }
 
index 0d98cb99de4f6247112d40cd638124074e11bd65..94768f7cb621038a1b3049d88621f6fff849694c 100644 (file)
@@ -212,7 +212,9 @@ static bool process_one(struct loadparm_context *lp_ctx, struct event_context *e
                node_name = talloc_strdup(tmp_ctx, name);
        }
 
-       nbtsock = nbt_name_socket_init(tmp_ctx, ev, lp_iconv_convenience(lp_ctx));
+       nbtsock = nbt_name_socket_init(tmp_ctx, ev, lp_iconv_convenience(lp_ctx),
+                                                                  lp_parm_int(lp_ctx, NULL, "nbt", "wack_timeout", 30)
+                                                                  );
        
        if (options.root_port) {
                all_zero_addr = socket_address_from_strings(tmp_ctx, nbtsock->sock->backend_name,