diff options
author | corvid <corvid@lavabit.com> | 2011-07-10 02:38:29 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2011-07-10 02:38:29 +0000 |
commit | 8e73b3c1151fc5a9b9e52444c89e0298e3432c59 (patch) | |
tree | ef8b7a6b4c4b3cdcff9c37b057aedd84d172b629 | |
parent | 1c47f8754de28766c17611ca27d872585d5d0222 (diff) |
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.
-rw-r--r-- | src/cache.c | 10 |
1 files changed, 10 insertions, 0 deletions
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) { |