OpenTTD
Macros | Variables
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_http.h"
#include "../../safeguards.h"

Go to the source code of this file.

Macros

#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.

Macro Definition Documentation

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

Helper to simplify the error handling.

Parameters
msgthe error message to show.

Definition at line 91 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 26 of file tcp_http.cpp.