geomyidae

A small C-based gopherd. (gopher://bitreich.org/1/scm/geomyidae)
git clone git://r-36.net/geomyidae
Log | Files | Refs | README | LICENSE

commit 0c2fa66d5056ca6cdd6cf69aa7feb416b21a3ff0
parent 429ea45adba32c7ffa87b8b00528e26edc701e74
Author: Christoph Lohmann <20h@r-36.net>
Date:   Sun,  7 Jun 2020 21:43:26 +0200

Use write instead of send everywhere.

Sorry, Evil_Bob, had to garble your patch. Thanks for the hint!

Diffstat:
ind.c | 2+-
main.c | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ind.c b/ind.c @@ -123,7 +123,7 @@ xsendfile(int fd, int sock) while ((len = read(fd, sendb, bufsiz)) > 0) { sendi = sendb; while (len > 0) { - if ((sent = send(sock, sendi, len, 0)) < 0) { + if ((sent = write(sock, sendi, len)) < 0) { free(sendb); return -1; } diff --git a/main.c b/main.c @@ -170,7 +170,7 @@ handlerequest(int sock, char *req, int rlen, char *base, char *ohost, recvb + 4, recvb + 4, recvb + 4); if (len > sizeof(path)) len = sizeof(path); - send(sock, path, len, 0); + write(sock, path, len); if (loglvl & HTTP) logentry(clienth, clientp, recvc, "HTTP redirect"); return;