Roxen.git
/
server
/
plugins
/
protocols
/
http.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/plugins/protocols/http.pike:1:
// This is a ChiliMoon protocol module. // Modified by Francesco Chemolli to add throttling capabilities. // Copyright © 1996 - 2001, Roxen IS.
-
constant cvs_version = "$Id: http.pike,v 1.
389
2002/
10
/
30
19
:
36
:
12
nilsson
Exp $";
+
constant cvs_version = "$Id: http.pike,v 1.
390
2002/
11
/
02
03
:
25
:
24
mani
Exp $";
// #define REQUEST_DEBUG #define MAGIC_ERROR // HTTP protocol module. #include <config.h> #define TIMER_PREFIX "http:" #include <timers.h> inherit RequestID;
Roxen.git/server/plugins/protocols/http.pike:1491:
if( Stat fstat = file->stat ) { if( !file->len ) file->len = fstat[1]; if ( fstat[ST_MTIME] > misc->last_modified ) misc->last_modified = fstat[ST_MTIME]; } if( misc->cacheable < INITIAL_CACHEABLE ) {
+
if (misc->cacheable == 0)
+
heads["Expires"] = Roxen.http_date( 0 );
+
else
heads["Expires"] = Roxen.http_date( predef::time(1)+misc->cacheable ); if (!misc->cacheable && !misc->last_modified) { // Data with immediate expiry is assumed to have been generated // at the same instant. misc->last_modified = predef::time(1); } } if (misc->last_modified)
Roxen.git/server/plugins/protocols/http.pike:1520:
/* ({ time, len }) */ array(int) since_info = Roxen.parse_since( since ); // werror("since: %{%O, %}\n" // "lm: %O\n" // "cacheable: %O\n", // since_info, // misc->last_modified, // misc->cacheable); if ( ((since_info[0] >= misc->last_modified) && ((since_info[1] == -1) || (since_info[1] == file->len)))
-
// never say 'not modified' if
not
cacheable
at
all
.
-
&& (misc->cacheable
!
=
0
)
+
// never say 'not modified' if cacheable
has
been lowered
.
+
&& (misc->cacheable
>
=
INITIAL_CACHEABLE
)
// actually ok, or... // || ((misc->cacheable>0) // && (since_info[0] + misc->cacheable<= predef::time(1)) // // cacheable, and not enough time has passed. ) { file->error = 304; file->file = 0; file->data=""; }