If the server returned less than we asked for we're at EOF
azez at ufomechanic.net
Thu Nov 29 10:36:41 GMT 2007
* David Collier-Brown wrote, On 28/11/07 18:29:
> Amin Azez wrote:
>> For my case (as a proxy) I'm trying to find out if returning a short
>> (non-zero) read because it's all I have right-now is dangerous because
>> the client would not be incorrect to act as if it were eof.
> Aha: yes, that is exactly right, a proxy needs to act just
> like the remote machine in this respect, and takes a risk
> if it has any differences in observable behavior. This
> is visible enough that it would probably cause at least
> Unix clients to make the wrong decisions and think the file was
> truncated (:-()
This seems clear. I'd just used read's of 0 to decide that, I guess
others do differently.
> Mind you, if the protocol has a "remaining" field, an
> you can find how actual Windows servers and clients use it uses it,
> you might be able to return short reads
> without the kind of risk you'd see on Unix...
Maybe this also relates to if the read request size is bigger than
max_xmit, in which case surely a short read will be required...
More information about the samba-technical