OpenTTD Source
20240919-master-gdf0233f4c2
|
Go to the documentation of this file.
12 #ifndef NETWORK_CORE_HTTP_H
13 #define NETWORK_CORE_HTTP_H
17 constexpr
int HTTP_429_TOO_MANY_REQUESTS = 429;
33 virtual void OnReceiveData(std::unique_ptr<
char[]> data,
size_t length) = 0;
58 static void Connect(
const std::string &uri,
HTTPCallback *callback,
const std::string data =
"");
virtual void OnReceiveData(std::unique_ptr< char[]> data, size_t length)=0
We're receiving data.
Base socket handler for HTTP traffic.
Callback for when the HTTP handler has something to tell us.
static void Connect(const std::string &uri, HTTPCallback *callback, const std::string data="")
Connect to the given URI.
virtual void OnFailure()=0
An error has occurred and the connection has been closed.
void NetworkHTTPUninitialize()
Uninitialize the HTTP socket handler.
virtual ~HTTPCallback()=default
Silentium.
static void HTTPReceive()
Do the receiving for all HTTP connections.
void NetworkHTTPInitialize()
Initialize the HTTP socket handler.
virtual bool IsCancelled() const =0
Check if there is a request to cancel the transfer.