<commit_before>/**
 * This file is part of the "libstx" project
 *   Copyright (c) 2014 <NAME>, Google Inc.
 *
 * libstx is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License v3.0. You should have received a
 * copy of the GNU General Public License along with this program. If not, see
 * <http://www.gnu.org/licenses/>.
 */
#ifndef _STX_HTTP_SERVERCONNECTION_H
#define _STX_HTTP_SERVERCONNECTION_H
#include <memory>
#include <vector>
#include <stx/autoref.h>
#include <stx/stdtypes.h>
#include <stx/http/httphandler.h>
#include <stx/http/httpparser.h>
#include <stx/http/httprequest.h>
#include <stx/http/httpresponse.h>
#include <stx/http/httpstats.h>
#include <stx/net/tcpconnection.h>
#include <stx/thread/taskscheduler.h>

namespace stx {
namespace http {

class HTTPServerConnection : public RefCounted {
public:
  static const size_t kMinBufferSize = 4096;

  /**
   * Start a new HTTP connection. conn must be an opened and valid TCP
   * connection.
   *
   * This method does not return a reference to the newly created HTTP
   * connection to simplify connection lifetime management. The HTTP connection
   * will free itself once it is closed.
   *
   * The user must provide a callback that is executed for each incoming
   * request. A pointer to the HTTP connection will be passed to the onRequest
   * callback and is valid only until the callback returns. Therefore it is
   * crucial that the passed connection pointer is only dereferenced from the
   * onRequest callback and not store anywhere.<commit_msg>increase http server buffer size to 1mb<commit_after>/**
 * This file is part of the "libstx" project
 *   Copyright (c) 2014 <NAME>, Google Inc.
 *
 * libstx is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License v3.0. You should have received a
 * copy of the GNU General Public License along with this program. If not, see
 * <http://www.gnu.org/licenses/>.
 */
#ifndef _STX_HTTP_SERVERCONNECTION_H
#define _STX_HTTP_SERVERCONNECTION_H
#include <memory>
#include <vector>
#include <stx/autoref.h>
#include <stx/stdtypes.h>
#include <stx/http/httphandler.h>
#include <stx/http/httpparser.h>
#include <stx/http/httprequest.h>
#include <stx/http/httpresponse.h>
#include <stx/http/httpstats.h>
#include <stx/net/tcpconnection.h>
#include <stx/thread/taskscheduler.h>

namespace stx {
namespace http {

class HTTPServerConnection : public RefCounted {
public:
  static const size_t kMinBufferSize = 1024 * 1024;

  /**
   * Start a new HTTP connection. conn must be an opened and valid TCP
   * connection.
   *
   * This method does not return a reference to the newly created HTTP
   * connection to simplify connection lifetime management. The HTTP connection
   * will free itself once it is closed.
   *
   * The user must provide a callback that is executed for each incoming
   * request. A pointer to the HTTP connection will be passed to the onRequest
   * callback and is valid only until the callback returns. Therefore it is
   * crucial that the passed connection pointer is only dereferenced from the
   * onRequest callback and not store anywhere.
{'fraction_non_alphanumeric': 0.08023727755229472, 'fraction_numerical': 0.007805182641273806, 'mean_word_length': 3.982892690513219, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2997724', 'n_tokens_mistral': 964, 'n_tokens_neox': 936, 'n_words': 390}