# tcp_http.cpp File Reference

Basic functions to receive and send HTTP TCP packets. More...

`#include "../../stdafx.h"`
`#include "../../debug.h"`
`#include "../../rev.h"`
`#include "../network_func.h"`
`#include "tcp.h"`
`#include "tcp_http.h"`

Go to the source code of this file.

## Defines

#define | return_error(msg) { DEBUG(net, 0, msg); return -1; }
| Helper to simplify the error handling.

## Variables

static SmallVector < NetworkHTTPSocketHandler *, 1 > | _http_connections
| List of open HTTP connections.
static const char *const | NEWLINE = "\r\n"
| End of line marker.
static const char *const | END_OF_HEADER = "\r\n\r\n"
| End of header marker.
static const char *const | HTTP_1_0 = "HTTP/1.0 "
| Preamble for HTTP 1.0 servers.
static const char *const | HTTP_1_1 = "HTTP/1.1 "
| Preamble for HTTP 1.1 servers.
static const char *const | CONTENT_LENGTH = "Content-Length: "
| Header for the length of the content.
static const char *const | LOCATION = "Location: "
| Header for location.

## Detailed Description

Basic functions to receive and send HTTP TCP packets.

Definition in file tcp_http.cpp.

## Define Documentation

#define return_error | ( | msg |  | ) | { DEBUG(net, 0, msg); return -1; }

Helper to simplify the error handling.

Parameters:

  | msg | the error message to show.

Definition at line 79 of file tcp_http.cpp.

Referenced by NetworkHTTPSocketHandler::Connect(), and NetworkHTTPSocketHandler::HandleHeader().

## Variable Documentation

SmallVector<NetworkHTTPSocketHandler *, 1> _http_connections`[static]`

List of open HTTP connections.

Definition at line 25 of file tcp_http.cpp.