forked from lda/telodendria
Don't buffer in IoWrite(), indicate that fwrite() returns size_t, not ssize_t.
This commit is contained in:
parent
6ee1857f5f
commit
e0a3760a37
2 changed files with 10 additions and 3 deletions
4
TODO.txt
4
TODO.txt
|
@ -14,8 +14,8 @@ Milestone: v0.3.0
|
||||||
[~] Stream API
|
[~] Stream API
|
||||||
[~] Implementation
|
[~] Implementation
|
||||||
[ ] Convert all code that deals with I/O
|
[ ] Convert all code that deals with I/O
|
||||||
[ ] Multi-output (proof of concept)
|
[!] Multi-output (proof of concept)
|
||||||
[ ] Memory streams (proof of concept)
|
[!] Memory streams (proof of concept)
|
||||||
[ ] TLS
|
[ ] TLS
|
||||||
[ ] SOCKS
|
[ ] SOCKS
|
||||||
[x] Move/convert UtilStreamCopy()
|
[x] Move/convert UtilStreamCopy()
|
||||||
|
|
|
@ -37,8 +37,15 @@ static ssize_t
|
||||||
IoWriteFile(void *cookie, void *buf, size_t nBytes)
|
IoWriteFile(void *cookie, void *buf, size_t nBytes)
|
||||||
{
|
{
|
||||||
FILE *fp = cookie;
|
FILE *fp = cookie;
|
||||||
|
size_t res = fwrite(buf, 1, nBytes, fp);
|
||||||
|
|
||||||
return fwrite(buf, 1, nBytes, fp);
|
/*
|
||||||
|
* fwrite() may be buffered on some platforms, but at this low level,
|
||||||
|
* it should not be; buffering happens in Stream, not Io.
|
||||||
|
*/
|
||||||
|
fflush(fp);
|
||||||
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static off_t
|
static off_t
|
||||||
|
|
Loading…
Reference in a new issue