sending also Last-Modified now

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2479 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
JohnNy_cz 2007-03-16 01:18:07 +00:00
parent 3a2310238d
commit 0dfab03d35
1 changed files with 12 additions and 3 deletions

View File

@ -25,6 +25,7 @@ Password checks and stuff are implemented here. This is server side stuff.
*/
#include "qtv.h"
#include "time.h"
#undef IN
@ -530,6 +531,13 @@ void HTMLprintf(char *outb, int outl, char *fmt, ...)
*outb++ = 0;
}
static const char* SV_GetTime()
{
time_t rawtime;
time (&rawtime);
return ctime(&rawtime);
}
static void SV_SendHTTPHeader(cluster_t *cluster, oproxy_t *dest, char *error_code, char *content_type, qboolean nocache)
{
char *s;
@ -540,16 +548,17 @@ static void SV_SendHTTPHeader(cluster_t *cluster, oproxy_t *dest, char *error_co
"Content-Type: %s\n"
"Cache-Control: no-cache, must-revalidate\n"
"Expires: Mon, 26 Jul 1997 05:00:00 GMT\n"
"Last-Modified: %s"
"Connection: close\n"
"\n";
snprintf(buffer, sizeof(buffer), s, error_code, content_type, SV_GetTime());
} else {
s = "HTTP/1.1 %s OK\n"
"Content-Type: %s\n"
"Connection: close\n"
"\n";
}
snprintf(buffer, sizeof(buffer), s, error_code, content_type);
snprintf(buffer, sizeof(buffer), s, error_code, content_type);
}
Net_ProxySend(cluster, dest, buffer, strlen(buffer));
}