diff options
author | Jeremy Allison <jra@samba.org> | 2001-11-14 04:15:36 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-11-14 04:15:36 +0000 |
commit | e6afe40f85d7dbe79322c82dac735d901e7e71df (patch) | |
tree | 116b23752c57511f530669b9b72dc792aa5f1c29 | |
parent | 7d8610c4fed555bf478dad793c84fbaf5b3c86ff (diff) | |
download | samba-e6afe40f85d7dbe79322c82dac735d901e7e71df.tar.gz samba-e6afe40f85d7dbe79322c82dac735d901e7e71df.tar.xz samba-e6afe40f85d7dbe79322c82dac735d901e7e71df.zip |
Removed the "reestablish" code. Tridge - scream if this was needed....
Jeremy.
-rw-r--r-- | source/libsmb/cliconnect.c | 51 | ||||
-rw-r--r-- | source/libsmb/clientgen.c | 11 |
2 files changed, 2 insertions, 60 deletions
diff --git a/source/libsmb/cliconnect.c b/source/libsmb/cliconnect.c index 096d8cb24a7..a6632803b2f 100644 --- a/source/libsmb/cliconnect.c +++ b/source/libsmb/cliconnect.c @@ -1019,57 +1019,6 @@ BOOL cli_connect(struct cli_state *cli, const char *host, struct in_addr *ip) } /**************************************************************************** -re-establishes a connection -****************************************************************************/ -BOOL cli_reestablish_connection(struct cli_state *cli) -{ - struct nmb_name calling; - struct nmb_name called; - fstring dest_host; - fstring share; - fstring dev; - BOOL do_tcon = False; - int oldfd = cli->fd; - - if (!cli->initialised || cli->fd == -1) - { - DEBUG(3,("cli_reestablish_connection: not connected\n")); - return False; - } - - /* copy the parameters necessary to re-establish the connection */ - - if (cli->cnum != 0) - { - fstrcpy(share, cli->share); - fstrcpy(dev , cli->dev); - do_tcon = True; - } - - memcpy(&called , &(cli->called ), sizeof(called )); - memcpy(&calling, &(cli->calling), sizeof(calling)); - fstrcpy(dest_host, cli->full_dest_host_name); - - DEBUG(5,("cli_reestablish_connection: %s connecting to %s (ip %s) - %s [%s]\n", - nmb_namestr(&calling), nmb_namestr(&called), - inet_ntoa(cli->dest_ip), - cli->user_name, cli->domain)); - - cli->fd = -1; - - if (cli_establish_connection(cli, - dest_host, &cli->dest_ip, - &calling, &called, - share, dev, False, do_tcon)) { - if ((cli->fd != oldfd) && (oldfd != -1)) { - close( oldfd ); - } - return True; - } - return False; -} - -/**************************************************************************** establishes a connection right up to doing tconX, reading in a password. ****************************************************************************/ BOOL cli_establish_connection(struct cli_state *cli, diff --git a/source/libsmb/clientgen.c b/source/libsmb/clientgen.c index d509924a26f..d3623ad94e5 100644 --- a/source/libsmb/clientgen.c +++ b/source/libsmb/clientgen.c @@ -62,26 +62,19 @@ BOOL cli_receive_smb(struct cli_state *cli) } /**************************************************************************** - send an smb to a fd and re-establish if necessary + send an smb to a fd. ****************************************************************************/ + BOOL cli_send_smb(struct cli_state *cli) { size_t len; size_t nwritten=0; ssize_t ret; - BOOL reestablished=False; len = smb_len(cli->outbuf) + 4; while (nwritten < len) { ret = write_socket(cli->fd,cli->outbuf+nwritten,len - nwritten); - if (ret <= 0 && errno == EPIPE && !reestablished) { - if (cli_reestablish_connection(cli)) { - reestablished = True; - nwritten=0; - continue; - } - } if (ret <= 0) { DEBUG(0,("Error writing %d bytes to client. %d\n", (int)len,(int)ret)); |