Author: vlendec
Date: 2007-05-16 09:53:41 +0000 (Wed, 16 May 2007)
New Revision: 22929

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

Log:
Attempt to fix some build farm failures: On port 139 the first
successful packet gives len==0 from the server, so the = in 

        if (len <= 0) {

in line 136 of clientgen.c throws a failure.

Jeremy, please fix this properly, I'm not merging this to 3_0_26 so that
you can filter it when you merge.

Volker


Modified:
   branches/SAMBA_3_0/source/libsmb/cliconnect.c
   branches/SAMBA_3_0/source/libsmb/clientgen.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/cliconnect.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/cliconnect.c       2007-05-16 09:42:29 UTC 
(rev 22928)
+++ branches/SAMBA_3_0/source/libsmb/cliconnect.c       2007-05-16 09:53:41 UTC 
(rev 22929)
@@ -1347,7 +1347,7 @@
        cli_send_smb(cli);
        DEBUG(5,("Sent session request\n"));
 
-       if (!cli_receive_smb(cli))
+       if (!cli_receive_sessionreply(cli))
                return False;
 
        if (CVAL(cli->inbuf,0) == 0x84) {

Modified: branches/SAMBA_3_0/source/libsmb/clientgen.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/clientgen.c        2007-05-16 09:42:29 UTC 
(rev 22928)
+++ branches/SAMBA_3_0/source/libsmb/clientgen.c        2007-05-16 09:53:41 UTC 
(rev 22929)
@@ -191,6 +191,32 @@
 }
 
 /****************************************************************************
+ Recv an smb session reply
+****************************************************************************/
+
+BOOL cli_receive_sessionreply(struct cli_state *cli)
+{
+       ssize_t len;
+
+       /* fd == -1 causes segfaults -- Tom ([EMAIL PROTECTED]) */
+       if (cli->fd == -1)
+               return False; 
+
+       len = client_receive_smb(cli, False, 0);
+
+       /* If the server is not responding, note that now */
+       if (len < 0) {
+                DEBUG(0, ("Receiving SMB: Server stopped responding\n"));
+               cli->smb_rw_error = smb_read_error;
+               close(cli->fd);
+               cli->fd = -1;
+               return False;
+       }
+
+       return True;
+}
+
+/****************************************************************************
  Read the data portion of a readX smb.
  The timeout is in milliseconds
 ****************************************************************************/

Reply via email to