Minor bugfixes

This commit is contained in:
Nate Choe
2022-01-30 18:02:25 -06:00
parent 1888bb9518
commit ffd41ceab7
2 changed files with 4 additions and 2 deletions

View File

@@ -13,9 +13,9 @@ work/%.o: src/%.c $(wildcard src/include/*.h)
$(CC) $(CFLAGS) $< -c -o $@ $(CC) $(CFLAGS) $< -c -o $@
install: build/$(OUT) install: build/$(OUT)
useradd -M swebs
cp build/$(OUT) $(INSTALLDIR)/$(OUT) cp build/$(OUT) $(INSTALLDIR)/$(OUT)
useradd -M swebs
uninstall: $(INSTALLDIR)/$(OUT) uninstall: $(INSTALLDIR)/$(OUT)
userdel swebs
rm $(INSTALLDIR)/$(OUT) rm $(INSTALLDIR)/$(OUT)
userdel swebs

View File

@@ -205,6 +205,8 @@ static int processChar(Connection *conn, char c, Sitefile *site) {
size_t readLen = read(conn->fd, buffer, sizeof(buffer)); size_t readLen = read(conn->fd, buffer, sizeof(buffer));
if (readLen == 0) if (readLen == 0)
break; break;
if (readLen < 0)
return 1;
size_t writeLen = sendStream(conn->stream, size_t writeLen = sendStream(conn->stream,
buffer, readLen); buffer, readLen);
if (writeLen < readLen) if (writeLen < readLen)