OpenTTD Source: HTTPCallback Struct Reference

OpenTTD Source 13.1

Public Member Functions
HTTPCallback Struct Referenceabstract

Callback for when the HTTP handler has something to tell us. More...

`#include <tcp_http.h>`

Inheritance diagram for HTTPCallback:

## Public Member Functions
virtual void | OnFailure ()=0
| An error has occurred and the connection has been closed. More...
virtual void | OnReceiveData (const char *data, size_t length)=0
| We're receiving data. More...
virtual | ~HTTPCallback ()
| Silentium.

## Detailed Description

Callback for when the HTTP handler has something to tell us.

Definition at line 18 of file tcp_http.h.

## Member Function Documentation

## ◆ OnFailure()

virtual void HTTPCallback::OnFailure | ( |  | ) |
| pure virtual

An error has occurred and the connection has been closed.

Note
  HTTP socket handler is closed/freed.

Implemented in ClientNetworkContentSocketHandler.

Referenced by NetworkHTTPSocketHandler::HTTPReceive(), NetworkHTTPSocketHandler::NetworkHTTPSocketHandler(), and NetworkHTTPContentConnecter::OnFailure().

## ◆ OnReceiveData()

virtual void HTTPCallback::OnReceiveData | ( | const char * | data,
|  | size_t | length
| ) |  |
| pure virtual

We're receiving data.

Parameters

  data | the received data, nullptr when all data has been received.
  length | the amount of received data, 0 when all data has been received.

Note
  When nullptr is sent the HTTP socket handler is closed/freed.

Implemented in ClientNetworkContentSocketHandler.

Referenced by NetworkHTTPSocketHandler::Receive().

The documentation for this struct was generated from the following file:

- src/network/core/tcp_http.h