svn commit: samba r7025 - in branches/SAMBA_3_0/source: lib tdb

Jeremy Allison jra at
Fri May 27 19:43:16 GMT 2005

On Fri, May 27, 2005 at 03:31:45PM -0400, derrell at wrote:
> Jeremy Allison <jra at> writes:
> > Remember, sys_read doesn't return on EINTR (it already catches and
> > takes care of that case) so it's not generic signals we're worried
> > about here, it's only EAGAIN, which should be a very rare case - in
> > fact it should only happen on non-blocking sockets with no data.
> Yup, and that was likely what was occurring in the reporter's case.  But if
> that's when EAGAIN could occur, then basing this on a maximum number of
> iterations is the wrong way to do it because if the socket is non-blocking,
> every call to sys_read() will return immediately and we'll very quickly exceed
> the count.  In that case, it should really be time-based, not iteration-based.

Yes I know, but adding time-based calls into the code at this low
level will slow *everything* down. That's why we have read_socket_with_timeout()

As read_socket_data() is a static only called from read_smb_length_return_keepalive()
and receive_smb_raw() perhaps we should just change these calls to call
read_socket_with_timeout() if the timeout value is non-zero. That way only
the client calls that need a timeout pay this penalty, and the main smbd
server code that calls with timeout=0 doesn't.


More information about the samba-technical mailing list