Add fixes performance and static web server

This commit is contained in:
Justine Tunney 2020-10-05 23:11:49 -07:00
parent b6793d42d5
commit c45e46f871
108 changed files with 2927 additions and 819 deletions

View file

@ -37,6 +37,7 @@ int fwritebuf(FILE *f) {
unsigned bytes;
bytes = (f->beg < f->end ? f->end : f->size) - f->beg;
if ((put = write(f->fd, &f->buf[f->beg], bytes)) == -1) {
if (errno == EINTR) return 0;
return (int)fseterrno(f);
}
f->beg = (unsigned)((f->beg + put) & (f->size - 1));