r3354: honor "max xmit" and "max mux" from smb.conf in our client code. This
authorAndrew Tridgell <tridge@samba.org>
Fri, 29 Oct 2004 06:01:00 +0000 (06:01 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:05:00 +0000 (13:05 -0500)
is important as it allows the test suite to exercise the multiple
reply logic in smbd for trans2 search replies.

source/include/cli_context.h
source/libcli/raw/clisession.c
source/libcli/raw/clitransport.c
source/libcli/raw/rawnegotiate.c

index bdf90018d5bd379084361270d91d2731e5bebc56..1b20985fd8dbdae90ab1cd39a16be8712d92af87 100644 (file)
@@ -91,6 +91,8 @@ struct smbcli_options {
        uint_t use_oplocks:1;
        uint_t use_level2_oplocks:1;
        uint_t use_spnego:1;
+       uint32_t max_xmit;
+       uint16_t max_mux;
 };
 
 /* this is the context for the client transport layer */
index 431d2250210fd1e365255f214aef7f1c25fe4226..5d769f9e32a2d960dde9c1731371de917ad6ae78 100644 (file)
@@ -263,8 +263,8 @@ static NTSTATUS smb_raw_session_setup_generic_old(struct smbcli_session *session
 
        /* use the old interface */
        s2.generic.level = RAW_SESSSETUP_OLD;
-       s2.old.in.bufsize = ~0;
-       s2.old.in.mpx_max = 50;
+       s2.old.in.bufsize = session->transport->options.max_xmit;
+       s2.old.in.mpx_max = session->transport->options.max_mux;
        s2.old.in.vc_num = 1;
        s2.old.in.sesskey = parms->generic.in.sesskey;
        s2.old.in.domain = parms->generic.in.domain;
@@ -311,8 +311,8 @@ static NTSTATUS smb_raw_session_setup_generic_nt1(struct smbcli_session *session
        union smb_sesssetup s2;
 
        s2.generic.level = RAW_SESSSETUP_NT1;
-       s2.nt1.in.bufsize = ~0;
-       s2.nt1.in.mpx_max = 50;
+       s2.nt1.in.bufsize = session->transport->options.max_xmit;
+       s2.nt1.in.mpx_max = session->transport->options.max_mux;
        s2.nt1.in.vc_num = 1;
        s2.nt1.in.sesskey = parms->generic.in.sesskey;
        s2.nt1.in.capabilities = parms->generic.in.capabilities;
@@ -371,8 +371,8 @@ static NTSTATUS smb_raw_session_setup_generic_spnego(struct smbcli_session *sess
        const char *chosen_oid;
 
        s2.generic.level = RAW_SESSSETUP_SPNEGO;
-       s2.spnego.in.bufsize = ~0;
-       s2.spnego.in.mpx_max = 50;
+       s2.spnego.in.bufsize = session->transport->options.max_xmit;
+       s2.spnego.in.mpx_max = session->transport->options.max_mux;
        s2.spnego.in.vc_num = 1;
        s2.spnego.in.sesskey = parms->generic.in.sesskey;
        s2.spnego.in.capabilities = parms->generic.in.capabilities;
index 3335f557e55557bd20f72082838c8ff7a0dd3cf4..c0ec5d70fed26ccec7464cb98c81a04a4bd94030 100644 (file)
@@ -76,7 +76,10 @@ struct smbcli_transport *smbcli_transport_init(struct smbcli_socket *sock)
        transport->socket = talloc_reference(transport, sock);
        transport->negotiate.protocol = PROTOCOL_NT1;
        transport->options.use_spnego = lp_use_spnego();
-       transport->negotiate.max_xmit = ~0;
+       transport->options.max_xmit = lp_max_xmit();
+       transport->options.max_mux = lp_maxmux();
+
+       transport->negotiate.max_xmit = transport->options.max_xmit;
        
        smbcli_init_signing(transport);
 
index fdc1d0eb604c19105358874dd48dc236e7b99405..f99b9741f4d2890cc5dd837f89ccbd4d06c7c754 100644 (file)
@@ -169,7 +169,7 @@ NTSTATUS smb_raw_negotiate(struct smbcli_transport *transport)
                /* the old core protocol */
                transport->negotiate.sec_mode = 0;
                transport->negotiate.server_time = time(NULL);
-               transport->negotiate.max_xmit = ~0;
+               transport->negotiate.max_xmit = transport->options.max_xmit;
                transport->negotiate.server_zone = get_time_zone(transport->negotiate.server_time);
        }