Roxen.git / server / protocols / http.pike

version» Context lines:

Roxen.git/server/protocols/http.pike:752:    string chunk_extras;    int n = sscanf(buf, "%" + chunk_offset + "*s%x%s\r\n%n",    misc->chunk_len, chunk_extras,    chunk_data_offset);    if (n < 4) {    misc->chunk_buf = buf[chunk_offset..];    misc->chunk_len = 0;    return 0; // More data needed to parse the chunk length.    }    +  misc->len += misc->chunk_len; +    #ifdef CONNECTION_DEBUG    werror("HTTP[%s]: Got chunk with %d bytes of data.\n",    DEBUG_GET_FD, misc->chunk_len);   #endif       // FIXME: Currently we ignore the chunk_extras.       if (buf_max) {    int payload_size =    ((data_buffer && sizeof(data_buffer)) + misc->chunk_len);
Roxen.git/server/protocols/http.pike:1049:    acontents = contents;    contents = contents[0];    } else {    acontents = ({ contents });    }    switch (linename)    {    case "cache-control": // Opera sends "no-cache" here.    case "pragma": pragma|=(multiset)((contents-" ")/","); break;    -  case "content-length": misc->len = (int)contents; break; +  case "content-length": +  if (misc->chunked) break; +  misc->len = (int)contents; +  break;    case "transfer-encoding":    misc->transfer_encoding =    map(lower_case(contents)/";", String.trim_all_whites);    if (has_value(misc->transfer_encoding, "chunked")) { -  +  misc->len = 0;    misc->chunked = 1;    misc->chunk_buf = "";    new_data = data; // For got_chunk_fragment() below.    data = "";    }    break;    case "authorization": rawauth = contents; break;    case "referer": referer = ({contents}); break;    case "if-modified-since": since=contents; break;    case "if-match": break; // Not supported yet.