summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-11-14 04:15:36 +0000
committerJeremy Allison <jra@samba.org>2001-11-14 04:15:36 +0000
commit742dc2313c951f85ff66f0a8121790d0e291a19c (patch)
treeb5d31c319a20929def968187ca1ba80b7ff7eac8 /source3/libsmb
parent4e71905d85a10fac91d0c7429f5ca6026188cc3f (diff)
downloadsamba-742dc2313c951f85ff66f0a8121790d0e291a19c.tar.gz
samba-742dc2313c951f85ff66f0a8121790d0e291a19c.tar.bz2
samba-742dc2313c951f85ff66f0a8121790d0e291a19c.zip
Removed the "reestablish" code. Tridge - scream if this was needed....
Jeremy. (This used to be commit e6afe40f85d7dbe79322c82dac735d901e7e71df)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cliconnect.c51
-rw-r--r--source3/libsmb/clientgen.c11
2 files changed, 2 insertions, 60 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 096d8cb24a..a6632803b2 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/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/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index d509924a26..d3623ad94e 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/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));