mirror of https://github.com/nealey/eris.git
fix for when if-modified-since not sent
This commit is contained in:
parent
03fb0e042c
commit
72e5fbb1d8
2
Makefile
2
Makefile
|
@ -4,7 +4,7 @@ CXX=g++
|
|||
#LIBOWFAT=../libowfat/
|
||||
#DIET=diet -Os
|
||||
|
||||
CFLAGS=-Os -fomit-frame-pointer
|
||||
CFLAGS += -Os -fomit-frame-pointer
|
||||
#CFLAGS=-g
|
||||
|
||||
all: fnord fnord-cgi fnord-idx
|
||||
|
|
14
httpd.c
14
httpd.c
|
@ -940,7 +940,6 @@ static struct stat st;
|
|||
static int doit(char* buf,int buflen,char* url,int explicit) {
|
||||
int fd=-1;
|
||||
char* accept;
|
||||
time_t ims;
|
||||
while (url[0]=='/') ++url;
|
||||
getmimetype(url,explicit);
|
||||
{
|
||||
|
@ -967,9 +966,16 @@ ok:
|
|||
if (S_ISDIR(st.st_mode)) goto bad;
|
||||
/* see if the peer accepts MIME type */
|
||||
/* see if the document has been changed */
|
||||
ims=timerfc(header(buf,buflen,"If-Modified-Since"));
|
||||
//fprintf(stderr, "ims: %lu %lu %d\n", ims, st.st_mtime, st.st_mtime - ims);
|
||||
if ((ims!=(time_t)-1) && (st.st_mtime<=ims)) { retcode=304; goto bad; }
|
||||
{
|
||||
char *field = header(buf,buflen,"If-Modified-Since");
|
||||
|
||||
if (field) {
|
||||
time_t ims;
|
||||
|
||||
ims = timerfc(field);
|
||||
if ((ims!=(time_t)-1) && (st.st_mtime<=ims)) { retcode=304; goto bad; }
|
||||
}
|
||||
}
|
||||
rangestart=0; rangeend=st.st_size;
|
||||
if ((accept=header(buf,buflen,"Range"))) {
|
||||
/* format: "bytes=17-23", "bytes=23-" */
|
||||
|
|
Loading…
Reference in New Issue