Begin work on new streams API
This commit is contained in:
+15
-1
@@ -11,10 +11,24 @@ namespace uWS {
|
||||
|
||||
template <bool SSL>
|
||||
struct HttpResponseData : HttpParser, AsyncSocketData<SSL> {
|
||||
template <bool> friend struct HttpResponse;
|
||||
template <bool> friend struct HttpContext;
|
||||
private:
|
||||
/* Bits of status */
|
||||
enum {
|
||||
HTTP_STATUS_SENT = 1,
|
||||
HTTP_WRITE_CALLED = 2,
|
||||
HTTP_KNOWN_STREAM_OUT_SIZE = 4,
|
||||
HTTP_PAUSED_STREAM_OUT = 8
|
||||
};
|
||||
|
||||
std::function<void(std::string_view)> inStream;
|
||||
std::function<std::string_view(int)> outStream;
|
||||
std::function<std::pair<bool, std::string_view>(int)> outStream;
|
||||
/* Outgoing offset */
|
||||
int offset = 0;
|
||||
|
||||
/* Current state (content-length sent, status sent, write called, etc */
|
||||
int state = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user