diff --git a/Makefile b/Makefile index 191680b..d3eb60f 100644 --- a/Makefile +++ b/Makefile @@ -13,9 +13,9 @@ work/%.o: src/%.c $(wildcard src/include/*.h) $(CC) $(CFLAGS) $< -c -o $@ install: build/$(OUT) - useradd -M swebs cp build/$(OUT) $(INSTALLDIR)/$(OUT) + useradd -M swebs uninstall: $(INSTALLDIR)/$(OUT) - userdel swebs rm $(INSTALLDIR)/$(OUT) + userdel swebs diff --git a/src/connections.c b/src/connections.c index 65aabaf..29ab843 100644 --- a/src/connections.c +++ b/src/connections.c @@ -205,6 +205,8 @@ static int processChar(Connection *conn, char c, Sitefile *site) { size_t readLen = read(conn->fd, buffer, sizeof(buffer)); if (readLen == 0) break; + if (readLen < 0) + return 1; size_t writeLen = sendStream(conn->stream, buffer, readLen); if (writeLen < readLen)