HTTP server networking side, also, fix the releasing of channels in driver

This commit is contained in:
2022-05-17 15:00:20 -04:00
parent 1ac1ab9420
commit cd3064eb05
4 changed files with 80 additions and 56 deletions

View File

@@ -269,6 +269,10 @@ public:
//
HttpParser();
// Get the parsed status.
//
int status() const { return status_; }
// Store the parsed fields into a lua table.
//
void store(LuaStack &LS, LuaSlot tab) const;
@@ -318,17 +322,19 @@ public:
using HttpParserVec = eng::vector<HttpParser>;
// This class associates an HTTP request to an actual communication
// channel that is executing that request.
class HttpClientChannel {
// This class is used by LpxServer to store the
// incoming and outgoing http channels.
//
class HttpChannel {
public:
SharedChannel channel_;
int64_t parsed_bytes_;
HttpClientChannel() : parsed_bytes_(0) {}
bool marked_for_deletion() const { return channel_ == nullptr; }
HttpChannel() : parsed_bytes_(0) {}
};
using HttpClientChannelMap = eng::map<int64_t, HttpClientChannel>;
using HttpChannelMap = eng::map<int64_t, HttpChannel>;
using HttpChannelVec = eng::vector<HttpChannel>;
#endif // HTTP_HPP