Branch: Tag:

2001-08-23

2001-08-23 13:29:52 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Support request content-length for more methods than POST.

Rev: server/protocols/http.pike:1.333

2:   // Modified by Francesco Chemolli to add throttling capabilities.   // Copyright © 1996 - 2001, Roxen IS.    - constant cvs_version = "$Id: http.pike,v 1.332 2001/08/23 05:33:43 nilsson Exp $"; + constant cvs_version = "$Id: http.pike,v 1.333 2001/08/23 13:29:52 grubba Exp $";   // #define REQUEST_DEBUG   #define MAGIC_ERROR   
891:    break;    }    } -  if(misc->len && method == "POST") +  if(misc->len)    {    if(!data) data="";    int l = misc->len;
900:       if(strlen(data) < l)    { -  REQUEST_WERR("HTTP: parse_request(): More data needed in POST."); +  REQUEST_WERR(sprintf("HTTP: parse_request(): More data needed in %s.", +  method));    TIMER_END(parse_got);    return 0;    }    leftovers = data[l+2..];    data = data[..l+1];    -  +  if (method == "POST") {    switch(lower_case((((misc["content-type"]||"")+";")/";")[0]-" "))    {    default:
947:    break;    }    } +  }    TIMER_END(parse_got);    return 3; // Done.   }