HTTP error logging fixes

This commit is contained in:
Henrik Rydgård committed 2025-08-15 18:08:41 +02:00
1 parent 6c4ff15fce
commit f31a8f08ec
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -387,6 +387,11 @@ int Client::ReadResponseHeaders(net::Buffer *readbuf, std::vector<std::string> &
return -1;
}
if (readbuf->empty()) {
ERROR_LOG(Log::HTTP, "Empty HTTP header read buffer :(");
return -1;
}
// Grab the first header line that contains the http code.
std::string line;
+1 -1
View File
@@ -46,7 +46,7 @@ bool Buffer::FlushSocket(uintptr_t sock, double timeout, bool *cancelled) {
int sent = send(sock, &data[pos], end - pos, MSG_NOSIGNAL);
// TODO: Do we need some retry logic here, instead of just giving up?
if (sent < 0) {
ERROR_LOG(Log::IO, "FlushSocket failed to send: %d", errno);
ERROR_LOG(Log::IO, "FlushSocket failed to send: errno=%d", errno);
return false;
}
pos += sent;