@@ -9,6 +9,8 @@
#ifdef _WIN32
#include <Windows.h>
+#else
+#include <unistd.h>
#endif
#define DOCUMENT_ROOT "."
@@ -281,14 +281,8 @@ protected:
char * postData;
unsigned long postDataLen;
- CivetConnection() {
- postData = NULL;
- postDataLen = 0;
- }
-
- ~CivetConnection() {
- free(postData);
+ CivetConnection();
+ ~CivetConnection();
};
struct mg_context *context;
@@ -277,3 +277,12 @@ CivetServer::urlEncode(const char *src, size_t src_len, std::string &dst, bool a
}
+
+CivetServer::CivetConnection::CivetConnection() {
+ postData = NULL;
+ postDataLen = 0;
+}
+CivetServer::CivetConnection::~CivetConnection() {
+ free(postData);