Wrong description of "end of data stream" (SANE_NET_START)
The description of the network protocol (https://sane-project.gitlab.io/standard/1.06/net.html#sane-net-start) says,
The special length value of 0xffffffff is used to indicate the end of the data stream. That is, after receiving a record length of 0xffffffff, the network client should close the data connection and stop reading data.
This is not fully correct (or implemented faulty in the net backend implementation). The standard SANE net backend implementation expects another byte to follow, which is then used as the return value of the read()
function. See https://gitlab.com/sane-project/backends/-/blob/e79adde8b2d713448f3022632f410d4a9de0fb91/backend/net.c#L2216
Either the default implementation has to be adjusted (which could cause compatibility issues), or the documentation has to be amended here.
If server implementations do not send this status byte, the read()
function never returns, as it waits for this status byte.
Personal comment: It is a very strange "design decision" to use a single byte here to indicate the status, where everywhere else in the network protocol, a four-byte word is used for the status.