When the keep-alive packet sent out,rfc1002 says different things!!

Christopher R. Hertel crh at ubiqx.mn.org
Mon Mar 31 18:06:41 GMT 2003


On Mon, Mar 31, 2003 at 08:07:16PM +1000, Andrew Bartlett wrote:
> On Mon, 2003-03-31 at 19:42, Aladdin_Cai at asus.com.cn wrote:
> > Hello everyone, When I am programming a samba client in freeDOS,using
> > wattcp, I found a strange thing, which is not the same as rfc1002 claims.
> > In rfc 1002,see below:
> 
> > So,during I write data or read data to server, it seems that server will 
> > not send me any keep-alive packet because he will reset the timer.But
> > in fact,during I raw write a very large piece data to server(not
> > matter windows or linux),it will send me a keep-alive
> > occasionally,leading my defendless code crash.
> > I REALLY don't understand why they don't obey the rules, or do I 
> > mistake rfc1002?
> >  
> > Urgently hope for your kindly help,thank you!!!!
> 
> See www.ubiqx.org/cifs for a description of this horrid protocol...
> 
> Also, make sure you understand - the standard is what Microsoft does,
> not what what any RFC says.

Also note that you may have trouble with ReadRaw and WriteRaw.  Microsoft
published documentation regarding these SMBs a long time ago and never
suggested that there might be licensing issues.  Just about a year ago,
however, they coughed up some patents which may or may not apply to
implementations of ReadRaw and WriteRaw.  See:  
http://us3.samba.org/samba/ms_license.html

That said, the problem you are experiencing, if I understand correctly, is 
that the server is sending keep-alives during a WriteRaw from your client 
because the server-side keep-alive timer is not reset.
Two solutions:
1) Send an SMB ECHO just before doing the WriteRaw.  That will reset the
   timer.
2) Handle the keep-alive.

For case #2, the keep-alive will contain the bytes { 0x85, 0, 0, 0 } and 
that's it.  You should be able to recognize those and simply discard them.

Chris -)-----

-- 
Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org


More information about the samba-technical mailing list