1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-12-22 04:02:04 +03:00

C++ Wrapper: Store post data per connection instead of per server

Fix #2 as proposed on June 16 2014 - see:
See https://groups.google.com/forum/#!topic/civetweb/ri0mNRJ_5-4
This commit is contained in:
bel
2014-06-16 22:36:42 +02:00
parent be97d78aac
commit db1e1eb028
2 changed files with 32 additions and 21 deletions

View File

@@ -9,10 +9,11 @@
#ifdef __cplusplus
#include "civetweb.h"
#include <vector>
#include <map>
#include <string>
class CivetServer; // forward declaration
// forward declaration
class CivetServer;
/**
* Basic interface for a URI request handler. Handlers implementations
@@ -271,10 +272,23 @@ public:
static void urlEncode(const char *src, size_t src_len, std::string &dst, bool append=false);
protected:
class CivetConnection {
public:
char * postData;
unsigned long postDataLen;
CivetConnection() {
postData = NULL;
postDataLen = 0;
}
~CivetConnection() {
free(postData);
}
};
struct mg_context *context;
char * postData;
unsigned long postDataLen;
std::map<struct mg_connection *, class CivetConnection> connections;
private:
/**