1998-03-26
1998-03-26 01:03:24 by David Hedbor <david@hedbor.org>
-
18b31602403f82b2bb8055ea57d9838042f951aa
(13 lines)
(+8/-5)
[
Show
| Annotate
]
Branch: 5.2
fixed support for keep alive in HEAD and 304 (not modified) requests.
Rev: server/protocols/http.pike:1.68
1:
// This is a roxen module. Copyright © 1996 - 1998, Idonex AB.
- constant cvs_version = "$Id: http.pike,v 1.67 1998/03/25 06:09:48 per Exp $";
+ constant cvs_version = "$Id: http.pike,v 1.68 1998/03/26 01:03:24 neotron Exp $";
// HTTP protocol module.
#include <config.h>
private inherit "roxenlib";
588: Inside #if defined(KEEP_ALIVE)
#ifdef KEEP_ALIVE
if(keepit &&
- (!(file->raw || file->len<=0))
+ (!(file->raw || file->len <= 0))
&& (misc->connection || (prot == "HTTP/1.1"))
&& my_fd)
{
687:
foreach(from[1], array q)
catch {
int id;
- if(sscanf(Stdio.read_bytes(q[0]), "%*s$Id: http.pike,v 1.67 1998/03/25 06:09:48 per Exp $", id) == 4)
+ if(sscanf(Stdio.read_bytes(q[0]), "%*s$Id: http.pike,v 1.68 1998/03/26 01:03:24 neotron Exp $", id) == 4)
q[0] += " ("+id+")";
};
return from;
937:
if(head_string) send(head_string);
- if(method != "HEAD")
+ if(method != "HEAD" && file->error != 304)
+ // No data for these two...
{
if(file->data && strlen(file->data))
send(file->data, file->len);
if(file->file)
send(file->file, file->len);
- }
+ } else
+ file->len = 1; // Keep those alive, please...
if (pipe) {
pipe->set_done_callback( do_log );
pipe->output(my_fd);