1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

Close the socket and set the file descriptor to -1 if there was a socket

error in cli_receive_smb() and cli_send_smb().
(This used to be commit bedd9c8215)
This commit is contained in:
Tim Potter 2001-11-14 05:58:51 +00:00
parent e1f24ab628
commit 641f3070ab

View File

@ -58,6 +58,13 @@ BOOL cli_receive_smb(struct cli_state *cli)
}
}
/* If the server is not responding, note that now */
if (!ret) {
close(cli->fd);
cli->fd = -1;
}
return ret;
}
@ -76,6 +83,8 @@ BOOL cli_send_smb(struct cli_state *cli)
while (nwritten < len) {
ret = write_socket(cli->fd,cli->outbuf+nwritten,len - nwritten);
if (ret <= 0) {
close(cli->fd);
cli->fd = -1;
DEBUG(0,("Error writing %d bytes to client. %d\n",
(int)len,(int)ret));
return False;