If the server returned less than we asked for we're at EOF

David Collier-Brown davecb at sun.com
Wed Nov 28 13:47:37 GMT 2007


  Unix systems return less than asked on EOF, and after reaching
EOF on an unchanging file will return 0 bytes and feof(fp) will
returns non-zero.

--dave

Amin Azez wrote:
> libcli/clireadwrite.c/smbcli_read
> 
> says: If the server returned less than we asked for we're at EOF
> 
> I'm aware that if it returns 0 bytes we're at EOF, is it strictly true
> that less-than-asked-for also means EOF?
> 
> My caching code returns smaller-than-asked-for reads if the full amount
> isn't in the cache, and so far no clients have interpreted this as EOF,
> but kept from where the previous read left off.
> 
> Am I supposed to make use of the "remaining" field here?
> 
> Sam
> 

-- 
David Collier-Brown            | Always do right. This will gratify
Sun Microsystems, Toronto      | some people and astonish the rest
davecb at sun.com                 |                      -- Mark Twain
(800) 555-9786 x56583 cell: (647) 833-9377 home off: (416) 223-5943 


More information about the samba-technical mailing list