From 8e73b3c1151fc5a9b9e52444c89e0298e3432c59 Mon Sep 17 00:00:00 2001 From: corvid Date: Sun, 10 Jul 2011 02:38:29 +0000 Subject: MSG giving HTTP status if page was empty Sometimes a server will send, say, 500 Internal Server Error with a Content-Length of 0, and Dillo just happily shows the empty page instead of the document that you thought you were going to get, and it's confusing. --- src/cache.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/cache.c b/src/cache.c index d26ae610..5ea45511 100644 --- a/src/cache.c +++ b/src/cache.c @@ -893,6 +893,16 @@ void a_Cache_process_dbuf(int Op, const char *buf, size_t buf_size, MSG("entry->ExpectedSize = %d, entry->TransferSize = %d\n", entry->ExpectedSize, entry->TransferSize); } + if (!entry->TransferSize && !(entry->Flags & CA_Redirect) && + (entry->Flags & WEB_RootUrl)) { + char *eol = strchr(entry->Header->str, '\n'); + if (eol) { + char *status_line = dStrndup(entry->Header->str, + eol - entry->Header->str); + MSG_HTTP("Body was empty. Server sent status: %s\n", status_line); + dFree(status_line); + } + } entry->Flags |= CA_GotData; entry->Flags &= ~CA_Stopped; /* it may catch up! */ if (entry->TransferDecoder) { -- cgit v1.2.3