diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-08-04 20:08:35 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:29:17 -0500 |
commit | c847b2afe7f4c979499c20869563439e25f0cb7e (patch) | |
tree | 7cc705a9c65eee219b83073a2d21da5d18eecc2c /source3/libsmb | |
parent | 87165a81d9a9be0b3476c130cb772a8a578f4f94 (diff) | |
download | samba-c847b2afe7f4c979499c20869563439e25f0cb7e.tar.gz samba-c847b2afe7f4c979499c20869563439e25f0cb7e.tar.bz2 samba-c847b2afe7f4c979499c20869563439e25f0cb7e.zip |
r24223: Convert reply_echo to the new API
(This used to be commit 4863ff2899419e791ed0e340821072d004fb1d17)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clientgen.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index 29d4d9c334..a23e0184d7 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -680,9 +680,11 @@ BOOL cli_send_keepalive(struct cli_state *cli) Send/receive a SMBecho command: ping the server ****************************************************************************/ -BOOL cli_echo(struct cli_state *cli, unsigned char *data, size_t length) +BOOL cli_echo(struct cli_state *cli, uint16 num_echos, + unsigned char *data, size_t length) { char *p; + int i; SMB_ASSERT(length < 1024); @@ -690,7 +692,7 @@ BOOL cli_echo(struct cli_state *cli, unsigned char *data, size_t length) set_message(NULL,cli->outbuf,1,length,True); SCVAL(cli->outbuf,smb_com,SMBecho); SSVAL(cli->outbuf,smb_tid,65535); - SSVAL(cli->outbuf,smb_vwv0,1); + SSVAL(cli->outbuf,smb_vwv0,num_echos); cli_setup_packet(cli); p = smb_buf(cli->outbuf); memcpy(p, data, length); @@ -699,12 +701,16 @@ BOOL cli_echo(struct cli_state *cli, unsigned char *data, size_t length) cli_setup_bcc(cli, p); cli_send_smb(cli); - if (!cli_receive_smb(cli)) { - return False; - } - if (cli_is_error(cli)) { - return False; + for (i=0; i<num_echos; i++) { + if (!cli_receive_smb(cli)) { + return False; + } + + if (cli_is_error(cli)) { + return False; + } } + return True; } |