mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
debug info display (netbios layer).
(This used to be commit 5c974cc4a4
)
This commit is contained in:
parent
07d8c3dba2
commit
f221bfa4ac
@ -526,6 +526,7 @@ BOOL receive_smb(int fd,char *buffer, unsigned int timeout)
|
||||
BOOL client_receive_smb(int fd,char *buffer, unsigned int timeout)
|
||||
{
|
||||
BOOL ret;
|
||||
uint8 msg_type;
|
||||
|
||||
for(;;)
|
||||
{
|
||||
@ -539,9 +540,18 @@ BOOL client_receive_smb(int fd,char *buffer, unsigned int timeout)
|
||||
}
|
||||
|
||||
/* Ignore session keepalive packets. */
|
||||
if(CVAL(buffer,0) != 0x85)
|
||||
msg_type = CVAL(buffer,0);
|
||||
if (msg_type != 0x85)
|
||||
break;
|
||||
}
|
||||
if (msg_type == 0)
|
||||
{
|
||||
show_msg(buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
dump_data(10, buffer, smb_len(buffer) + 4);
|
||||
}
|
||||
show_msg(buffer);
|
||||
return ret;
|
||||
}
|
||||
|
@ -60,13 +60,21 @@ static BOOL cli_send_smb(struct cli_state *cli, BOOL show)
|
||||
ssize_t ret;
|
||||
BOOL reestablished=False;
|
||||
|
||||
len = smb_len(cli->outbuf) + 4;
|
||||
|
||||
if (show)
|
||||
{
|
||||
show_msg(cli->outbuf);
|
||||
uint8 msg_type = CVAL(cli->outbuf, 0);
|
||||
if (msg_type == 0)
|
||||
{
|
||||
show_msg(cli->outbuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
dump_data(10, cli->outbuf, len);
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
@ -2465,7 +2473,7 @@ BOOL cli_session_request(struct cli_state *cli,
|
||||
retry:
|
||||
#endif /* WITH_SSL */
|
||||
|
||||
cli_send_smb(cli, False);
|
||||
cli_send_smb(cli, True);
|
||||
DEBUG(5,("Sent session request\n"));
|
||||
|
||||
if (!cli_receive_smb(cli))
|
||||
|
Loading…
Reference in New Issue
Block a user