s3:libsmb: move cli->max_mux to cli->conn.smb1.server.max_mux
authorStefan Metzmacher <metze@samba.org>
Tue, 13 Sep 2011 14:31:58 +0000 (16:31 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 15 Sep 2011 10:12:24 +0000 (12:12 +0200)
metze

source3/include/client.h
source3/libsmb/cliconnect.c
source3/libsmb/clientgen.c

index 3701aec554f50defcf8839572b88bb8ab67e4ccf..1e3ab5094912286c8454ef242d743c81bee1d3f5 100644 (file)
@@ -70,7 +70,6 @@ struct cli_state {
        int readbraw_supported;
        int writebraw_supported;
        int timeout; /* in milliseconds. */
-       size_t max_mux;
        int initialised;
        int win95;
        bool is_guestlogin;
@@ -135,6 +134,7 @@ struct cli_state {
                        struct {
                                uint32_t capabilities;
                                uint32_t max_xmit;
+                               uint16_t max_mux;
                        } server;
 
                        uint32_t capabilities;
index 1abd76018a5942d001f186d6610ae7f6b5cd0226..50014f57f7af6c45364b08e5c9981c1a9171e30f 100644 (file)
@@ -2614,6 +2614,7 @@ static void cli_negprot_done(struct tevent_req *subreq)
        uint32_t client_max_xmit = cli->conn.smb1.client.max_xmit;
        uint32_t server_max_xmit = 0;
        uint32_t max_xmit;
+       uint32_t server_max_mux = 0;
        enum protocol_types protocol;
 
        status = cli_smb_recv(subreq, state, &inbuf, 1, &wct, &vwv,
@@ -2656,7 +2657,7 @@ static void cli_negprot_done(struct tevent_req *subreq)
 
                /* NT protocol */
                cli->sec_mode = CVAL(vwv + 1, 0);
-               cli->max_mux = SVAL(vwv + 1, 1);
+               server_max_mux = SVAL(vwv + 1, 1);
                server_max_xmit = IVAL(vwv + 3, 1);
                cli->sesskey = IVAL(vwv + 7, 1);
                cli->serverzone = SVALS(vwv + 15, 1);
@@ -2719,7 +2720,7 @@ static void cli_negprot_done(struct tevent_req *subreq)
 
                cli->sec_mode = SVAL(vwv + 1, 0);
                server_max_xmit = SVAL(vwv + 2, 0);
-               cli->max_mux = SVAL(vwv + 3, 0);
+               server_max_mux = SVAL(vwv + 3, 0);
                cli->sesskey = IVAL(vwv + 6, 0);
                cli->serverzone = SVALS(vwv + 10, 0);
                cli->serverzone *= 60;
@@ -2734,7 +2735,7 @@ static void cli_negprot_done(struct tevent_req *subreq)
                cli->sec_mode = 0;
                cli->serverzone = get_time_zone(time(NULL));
                server_max_xmit = 1024;
-               cli->max_mux = 1;
+               server_max_mux = 1;
        }
 
        if (server_max_xmit < 1024) {
@@ -2742,7 +2743,7 @@ static void cli_negprot_done(struct tevent_req *subreq)
                return;
        }
 
-       if (cli->max_mux < 1) {
+       if (server_max_mux < 1) {
                tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
                return;
        }
@@ -2769,6 +2770,8 @@ static void cli_negprot_done(struct tevent_req *subreq)
        cli->conn.smb1.server.max_xmit = server_max_xmit;
        cli->conn.smb1.max_xmit = max_xmit;
 
+       cli->conn.smb1.server.max_mux = server_max_mux;
+
        tevent_req_done(req);
 }
 
index 9091ad38d8f330a00d259dd7847ec088d75d1276..aef31b5aa0a1983f2caa1b58999ba009b38449dd 100644 (file)
@@ -563,7 +563,7 @@ uint32_t cli_state_available_size(struct cli_state *cli, uint32_t ofs)
 
 uint16_t cli_state_max_requests(struct cli_state *cli)
 {
-       return cli->max_mux;
+       return cli->conn.smb1.server.max_mux;
 }
 
 uint16_t cli_state_security_mode(struct cli_state *cli)