Branch: Tag:

2000-01-22

2000-01-22 00:25:05 by Martin Stjernholm <mast@lysator.liu.se>

Do not send a short file when only HEAD is requested.

Rev: server/protocols/http.pike:1.190

2:   // Modified by Francesco Chemolli to add throttling capabilities.   // Copyright © 1996 - 2000, Idonex AB.    - constant cvs_version = "$Id: http.pike,v 1.189 2000/01/21 23:05:21 mast Exp $"; + constant cvs_version = "$Id: http.pike,v 1.190 2000/01/22 00:25:05 mast Exp $";      #define MAGIC_ERROR   
1520:    if(!leftovers) leftovers = data||"";   #endif    +  if(head_string) send(head_string); +  +  if(method != "HEAD" && file->error != 304) +  // No data for these two... +  {    if(my_fd->query_fd && my_fd->query_fd() >= 0 &&    file->len > 0 && file->len < 2000)    {
1532:    return;    }    -  if(head_string) send(head_string); -  -  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)
1781:    end();   }    + private int __count = ++all_constants()->__SDf_DAsdf; +    void create(object f, object c)   { -  +  werror ("id create %d\n", __count);    if(f)    {    MARK_FD("HTTP connection");
1795:    }   }    + void destroy () {werror ("id destroy %d\n", __count);} +    void chain(object f, object c, string le)   {    my_fd = f;