Author: metze
Date: 2007-05-15 10:50:25 +0000 (Tue, 15 May 2007)
New Revision: 22894

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22894

Log:
don't send a 2nd request before the last one returned (at least with
STATUS_PENDING) otherwise longhorn beta3 just drops the connection

metze
Modified:
   branches/SAMBA_4_0/source/torture/smb2/notify.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/smb2/notify.c
===================================================================
--- branches/SAMBA_4_0/source/torture/smb2/notify.c     2007-05-15 10:47:40 UTC 
(rev 22893)
+++ branches/SAMBA_4_0/source/torture/smb2/notify.c     2007-05-15 10:50:25 UTC 
(rev 22894)
@@ -27,6 +27,9 @@
 #include "torture/torture.h"
 #include "torture/smb2/proto.h"
 
+#include "libcli/raw/libcliraw.h"
+#include "lib/events/events.h"
+
 #define CHECK_STATUS(status, correct) do { \
        if (!NT_STATUS_EQUAL(status, correct)) { \
                printf("(%s) Incorrect status %s - should be %s\n", \
@@ -71,6 +74,12 @@
        n.in.unknown            = 0x00000000;
        req = smb2_notify_send(tree, &n);
 
+       while (!req->cancel.can_cancel && req->state <= SMB2_REQUEST_RECV) {
+               if (event_loop_once(req->transport->socket->event.ctx) != 0) {
+                       break;
+               }
+       }
+
        status = torture_setup_complex_file(tree, FNAME);
        CHECK_STATUS(status, NT_STATUS_OK);
 
@@ -87,6 +96,12 @@
        n.in.buffer_size        = 0x00000000;
        req = smb2_notify_send(tree, &n);
 
+       while (!req->cancel.can_cancel && req->state <= SMB2_REQUEST_RECV) {
+               if (event_loop_once(req->transport->socket->event.ctx) != 0) {
+                       break;
+               }
+       }
+
        status = torture_setup_complex_file(tree, FNAME);
        CHECK_STATUS(status, NT_STATUS_OK);
 
@@ -100,6 +115,12 @@
        n.in.buffer_size        = 0x00080000;
        req = smb2_notify_send(tree, &n);
 
+       while (!req->cancel.can_cancel && req->state <= SMB2_REQUEST_RECV) {
+               if (event_loop_once(req->transport->socket->event.ctx) != 0) {
+                       break;
+               }
+       }
+
        status = torture_setup_complex_file(tree, FNAME);
        CHECK_STATUS(status, NT_STATUS_OK);
 
@@ -126,6 +147,12 @@
        n.in.unknown            = 0x00000000;
        req = smb2_notify_send(tree, &n);
 
+       while (!req->cancel.can_cancel && req->state <= SMB2_REQUEST_RECV) {
+               if (event_loop_once(req->transport->socket->event.ctx) != 0) {
+                       break;
+               }
+       }
+
        status = torture_setup_complex_file(tree, FNAME);
        CHECK_STATUS(status, NT_STATUS_OK);
 
@@ -134,6 +161,11 @@
 
        n.in.buffer_size        = 0x00080000;
        req = smb2_notify_send(tree, &n);
+       while (!req->cancel.can_cancel && req->state <= SMB2_REQUEST_RECV) {
+               if (event_loop_once(req->transport->socket->event.ctx) != 0) {
+                       break;
+               }
+       }
 
        status = torture_setup_complex_file(tree, FNAME);
        CHECK_STATUS(status, NT_STATUS_OK);

Reply via email to