More logging
This commit is contained in:
@@ -386,13 +386,17 @@ int updateConnection(Connection *conn, Sitefile *site) {
|
|||||||
unsigned long i;
|
unsigned long i;
|
||||||
struct timespec currentTime;
|
struct timespec currentTime;
|
||||||
const Port *port = site->ports + conn->portind;
|
const Port *port = site->ports + conn->portind;
|
||||||
if (clock_gettime(CLOCK_MONOTONIC, ¤tTime) < 0)
|
if (clock_gettime(CLOCK_MONOTONIC, ¤tTime) < 0) {
|
||||||
return 1;
|
createLog("Error getting current time");
|
||||||
if (port->timeout > 0 &&
|
|
||||||
diff(&conn->lastdata, ¤tTime) > port->timeout) {
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
received = recvStream(conn->stream, buff, sizeof(buff));
|
if (port->timeout > 0 &&
|
||||||
|
diff(&conn->lastdata, ¤tTime) > port->timeout) {
|
||||||
|
createLog("Connection timed out");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
createFormatLog("Attempting to receive %ld bytes", sizeof buff);
|
||||||
|
received = recvStream(conn->stream, buff, sizeof buff);
|
||||||
createFormatLog("Received %ld bytes", received);
|
createFormatLog("Received %ld bytes", received);
|
||||||
if (received < 0)
|
if (received < 0)
|
||||||
return errno != EAGAIN && totalReceived <= 0;
|
return errno != EAGAIN && totalReceived <= 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user