fixed use_oplocks and the timeout in smbtorture startup
authorAndrew Tridgell <tridge@samba.org>
Mon, 10 Mar 2003 02:51:30 +0000 (02:51 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 10 Mar 2003 02:51:30 +0000 (02:51 +0000)
(This used to be commit cec1ef09e5009cdac22e6c9ca101a49c5ef36b1a)

source3/torture/torture.c

index ca4dbed1d8d23ae72a3f6d28a586e9d244d3c167..090f08c1604eac43325342c15e6d5a72fe48e723 100644 (file)
@@ -150,15 +150,25 @@ BOOL torture_open_connection(struct cli_state **c)
 {
        BOOL retry;
        int flags = 0;
+       NTSTATUS status;
+
        if (use_kerberos)
                flags |= CLI_FULL_CONNECTION_USE_KERBEROS;
        
-       return (NT_STATUS_IS_OK(
-                       cli_full_connection(c, myname,
-                                           host, NULL, port_to_use, 
-                                           share, "?????", 
-                                           username, workgroup, 
-                                           password, flags, &retry)));
+       status = cli_full_connection(c, myname,
+                                    host, NULL, port_to_use, 
+                                    share, "?????", 
+                                    username, workgroup, 
+                                    password, flags, &retry);
+       if (!NT_STATUS_IS_OK(status)) {
+               return False;
+       }
+
+       if (use_oplocks) (*c)->use_oplocks = True;
+       if (use_level_II_oplocks) (*c)->use_level_II_oplocks = True;
+       (*c)->timeout = 120000; /* set a really long timeout (2 minutes) */
+
+       return True;
 }