22#ifndef BACKENDS_NETWORKING_HTTP_NETWORKREADSTREAM_H
23#define BACKENDS_NETWORKING_HTTP_NETWORKREADSTREAM_H
25#include "common/array.h"
26#include "common/hash-str.h"
27#include "common/hashmap.h"
28#include "common/memstream.h"
29#include "common/path.h"
30#include "common/str.h"
31#include "common/stream.h"
40 long _keepAliveIdle, _keepAliveInterval;
44 : _eos(
false), _keepAlive(keepAlive),
45 _keepAliveIdle(keepAliveIdle), _keepAliveInterval(keepAliveInterval) {
53 bool uploading =
false,
bool usingPatch =
false,
54 bool keepAlive =
false,
long keepAliveIdle = 120,
long keepAliveInterval = 60);
59 bool keepAlive =
false,
long keepAliveIdle = 120,
long keepAliveInterval = 60);
63 bool uploading =
false,
bool usingPatch =
false,
bool post =
true,
64 bool keepAlive =
false,
long keepAliveIdle = 120,
long keepAliveInterval = 60);
74 virtual bool reuse(
const char *url,
RequestHeaders *headersList,
const byte *buffer, uint32 bufferSize,
bool uploading =
false,
bool usingPatch =
false,
bool post =
true) = 0;
85 bool eos()
const override {
return _eos; }
99 uint32
read(
void *dataPtr, uint32 dataSize)
override = 0;
128 bool keepAlive()
const {
return _keepAlive; }
130 virtual bool hasError()
const = 0;
131 virtual const char *getError()
const = 0;
Definition: networkreadstream.h:37
static NetworkReadStream * make(const char *url, RequestHeaders *headersList, const byte *buffer, uint32 bufferSize, bool uploading=false, bool usingPatch=false, bool post=true, bool keepAlive=false, long keepAliveIdle=120, long keepAliveInterval=60)
static NetworkReadStream * make(const char *url, RequestHeaders *headersList, const Common::HashMap< Common::String, Common::String > &formFields, const Common::HashMap< Common::String, Common::Path > &formFiles, bool keepAlive=false, long keepAliveIdle=120, long keepAliveInterval=60)
virtual bool reuse(const char *url, RequestHeaders *headersList, const Common::String &postFields, bool uploading=false, bool usingPatch=false)=0
uint32 read(void *dataPtr, uint32 dataSize) override=0
static NetworkReadStream * make(const char *url, RequestHeaders *headersList, const Common::String &postFields, bool uploading=false, bool usingPatch=false, bool keepAlive=false, long keepAliveIdle=120, long keepAliveInterval=60)
bool eos() const override
Definition: networkreadstream.h:85
virtual Common::HashMap< Common::String, Common::String > responseHeadersMap() const =0
virtual bool reuse(const char *url, RequestHeaders *headersList, const byte *buffer, uint32 bufferSize, bool uploading=false, bool usingPatch=false, bool post=true)=0
virtual bool reuse(const char *url, RequestHeaders *headersList, const Common::HashMap< Common::String, Common::String > &formFields, const Common::HashMap< Common::String, Common::Path > &formFiles)=0
virtual Common::String currentLocation() const =0
virtual double getProgress() const =0
virtual long httpResponseCode() const =0