diff options
author | thlo <t.lohmar@gmx.de> | 2013-05-01 17:55:14 +0200 |
---|---|---|
committer | thlo <t.lohmar@gmx.de> | 2013-05-01 17:55:14 +0200 |
commit | d9ca8bd72350526bf92334c77ea90a8475f36014 (patch) | |
tree | f3aafa00df57a6947649adc68b111741a975d821 | |
parent | 46e8fb5d5016b10bc578cd4d3b931538bb400f62 (diff) | |
download | vdr-plugin-smarttvweb-d9ca8bd72350526bf92334c77ea90a8475f36014.tar.gz vdr-plugin-smarttvweb-d9ca8bd72350526bf92334c77ea90a8475f36014.tar.bz2 |
cleanups
-rw-r--r-- | responsebase.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/responsebase.c b/responsebase.c index 77bca0a..633b922 100644 --- a/responsebase.c +++ b/responsebase.c @@ -75,6 +75,7 @@ void cResponseBase::sendError(int status, const char *title, const char *extra, void cResponseBase::sendHeaders(int status, const char *title, const char *extra, const char *mime, long long int length, time_t date) { + time_t now; char timebuf[128]; char f[400]; @@ -97,10 +98,12 @@ void cResponseBase::sendHeaders(int status, const char *title, const char *extra snprintf(f, sizeof(f), "Content-Type: %s\r\n", mime); hdr += f; } + if (length >= 0) { snprintf(f, sizeof(f), "Content-Length: %lld\r\n", length); hdr += f; } + if (date != -1) { strftime(timebuf, sizeof(timebuf), RFC1123FMT, gmtime(&date)); snprintf(f, sizeof(f), "Last-Modified: %s\r\n", timebuf); |