RE: [milter-greylist] Sync operation failing with 'Unexpected rep ly "200" from peer ...'
2004-06-17 by attila.bruncsak@itu.int
Hello, >> If a stream is open for update operation between read and write operation >> flush operation has to be executed. >> "man fdopen" on Tru64 UNIX says among others: >> >> "Also, an input operation cannot be directly followed by >> an output operation without an intervening flush or file positioning >> opera- >> tion, unless the input operation encounters the end of the file." > >To sum up, we need to fflush after each time data is readen from the >file descriptor, that's it? If there are two consecutive reads without write operation between them the fflush() is not needed by the documentation. To be on the safe side it is better always call the fflush() after the read and after the write. In the code I found two fgets operation for the client side MX handling and one fgets for the server side. I put fflush() after each one (except the case of error handling branch but there the stream will be closed anyhow). I verified that after each fprintf there is an fflush(). My baseline for the patch is sync.c from the V1.4 distribution. Probably it is the same for the Solaris 8 problem. I may have overlooked some I/O operation so it is better if you verify as well. Bests, Attila