summaryrefslogtreecommitdiff
path: root/source3/smbd/trans2.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-06-10 05:16:19 +0000
committerAndrew Tridgell <tridge@samba.org>1996-06-10 05:16:19 +0000
commita521fe8a274c8a043cf77641dd4160fdef803533 (patch)
tree67bbb5bb827896e10f7e611d02a8e5710a9045fe /source3/smbd/trans2.c
parent7e3b4a1c0df1434eb3d02f93c736ce065f9898d8 (diff)
downloadsamba-a521fe8a274c8a043cf77641dd4160fdef803533.tar.gz
samba-a521fe8a274c8a043cf77641dd4160fdef803533.tar.bz2
samba-a521fe8a274c8a043cf77641dd4160fdef803533.zip
a cleanup of the receive_smb() usage, adding timeouts in some places
also added paranoid code in the main process() loop of smbd to detect when smbd is looping uselessly. This should stop the "smbd is chewing lots of cpu" reports (This used to be commit 8e9dce34d50d673cb50531f0c4c7672ce2522cef)
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r--source3/smbd/trans2.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 0b113a2ed0..321dabc72c 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1554,10 +1554,8 @@ int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize)
while( num_data_sofar < total_data || num_params_sofar < total_params)
{
- receive_smb(Client,inbuf, 0);
-
- /* Ensure this is still a trans2 packet (sanity check) */
- if(CVAL(inbuf, smb_com) != SMBtranss2)
+ if(!receive_smb(Client,inbuf, SMB_SECONDARY_WAIT*1000) ||
+ CVAL(inbuf, smb_com) != SMBtranss2)
{
outsize = set_message(outbuf,0,0,True);
DEBUG(2,("Invalid secondary trans2 packet\n"));