Roxen.git / server / protocols / http.pike

version» Context lines:

Roxen.git/server/protocols/http.pike:1667:    (body ? #"    <div class='msg'>" + body + #"</div>" : "") + #"    </td>    </tr>    <tr valign='bottom' height='100%'>    <td colspan='2'>    <table border='0' cellspacing='0' cellpadding='0'>    <tr>    <td><img src='/internal-roxen-roxen-mini' /></td>    <td class='info'> -  &nbsp;&nbsp;<b>" + roxen_product_name + #"</b> -  <font color='#ffbe00'>|</font> " + roxen_dist_version + #" +  &nbsp;&nbsp;" + +  (roxen.query("default_ident")? +  ("<b>" + roxen_product_name + #"</b> +  <font color='#ffbe00'>|</font> "):"") + roxen.version() + #"    </td>    </tr>    </table>    </td>    </tr>   </table>   </body></html>";   }      
Roxen.git/server/protocols/http.pike:2762:    // Note: Terminated with a double CRLF.    string variant_string="";       // The full header block (prot + " " + code + head_string + variant_string).    string full_headers="";      #if 0    REQUEST_WERR(sprintf("HTTP: Sending result for prot:%O, method:%O, file:%O",    prot, method, file));   #endif -  if(!file->raw && (prot != "HTTP/0.9")) +  if(!file->raw)    {    if ((sizeof(file) <= 1) && multi_status) {    // NB: Configuration::examine_return_mapping() adds an    // empty extra_heads entry to the mapping.    if ((sizeof(file) != 1) || file->extra_heads) {    file = multi_status->http_answer();    }    }       if (file->error == Protocols.HTTP.HTTP_NO_CONTENT) {
Roxen.git/server/protocols/http.pike:2999: Inside #if defined(HTTP_COMPRESSION)
   }    }       if(file->compressed && misc->etag) {    string etag = misc->etag;    if(etag[sizeof(etag)-1..] == "\"")    misc->etag = etag[..sizeof(etag)-2] + ";gzip\"";    }   #endif    -  // Some browsers, e.g. Netscape 4.7, don't trust a zero -  // content length when using keep-alive. So let's force a -  // close in that case. -  if( file->error/100 == 2 && file->len <= 0 ) -  { -  variant_heads->Connection = "close"; -  misc->connection = "close"; -  } -  +     if (file->error == 200) {    int conditional;    if (none_match) {    // NOTE: misc->etag may be zero below, but that's ok.    if (none_match[misc->etag] || (misc->etag && none_match["*"])) {    // We have a if-none-match header that matches our etag.    if ((<"HEAD", "GET">)[method]) {    // RFC 2616 14.26:    // Instead, if the request method was GET or HEAD, the server    // SHOULD respond with a 304 (Not Modified) response, including
Roxen.git/server/protocols/http.pike:3123:    }    }    if (!skip) {    // NOTE: Modifies both arguments destructively.    handle_byte_ranges(file, variant_heads);    }    }    }       variant_string = Roxen.make_http_headers(variant_heads); +  if (prot != "HTTP/0.9") {    full_headers = prot + " " + file->error + head_string + variant_string; -  +  }       low_send_result(full_headers, file->data, file->len, file->file);    }    else { -  // RAW or HTTP/0.9 mode. +  // RAW mode.       if(!file->type) file->type="text/plain";       // No headers!    low_send_result("", file->data, file->len, file->file);    }       MARK_FD("HTTP handled");      
Roxen.git/server/protocols/http.pike:3749: Inside #if defined(RAM_CACHE)
      string expires;    if (expires = (cache_status->stale // See above.   #ifndef DISABLE_VARY_EXPIRES_FALLBACK    || (file->varies && (prot == "HTTP/1.0"))   #endif /* !DISABLE_VARY_EXPIRES_FALLBACK */    ? Roxen->http_date(predef::time(1)-31557600) :    file->expires)) {    variant_heads["Expires"] = expires;    } -  // Some browsers, e.g. Netscape 4.7, don't trust a zero -  // content length when using keep-alive. So let's force a -  // close in that case. -  if( file->error/100 == 2 && file->len <= 0 ) -  { -  variant_heads->Connection = "close"; -  misc->connection = "close"; -  } +     if (misc->range) {    // Handle byte ranges.    int skip;    string if_range;    if (if_range = request_headers["if-range"]) {    // Check If-Range header (RFC 2068 14.27).    if (has_prefix(if_range, "\"")) {    // ETag    if (if_range != file->etag) {    // ETag has changed.