41
41
42
42
#include < QObject>
43
43
44
- #undef min
45
- #undef std::max
46
-
47
-
48
44
#define POSTBUFFERSIZE 512
49
45
50
46
#define GET 0
51
47
#define POST 1
52
48
53
49
struct connection_info {
54
50
55
- int connectiontype; // GET or POST
56
- struct MHD_PostProcessor *postprocessor; // the POST processor used internally by microhttpd
57
- int answercode; // used internally by microhttpd to see where things went wrong or right
51
+ int connectiontype; // GET or POST
52
+ struct MHD_PostProcessor *postprocessor; // the POST processor used internally by microhttpd
53
+ int answercode; // used internally by microhttpd to see where things went wrong or right
58
54
59
55
std::string data;
60
56
std::string compilationOptions;
61
- std::string winUrl; // To be able to replace faust content in the right FLWindow
62
- std::string answerstring; // the answer sent to the user after upload
57
+ std::string winUrl; // To be able to replace faust content in the right FLWindow
58
+ std::string answerstring; // the answer sent to the user after upload
63
59
64
60
};
65
61
@@ -70,41 +66,41 @@ class FLServerHttp : public QObject
70
66
71
67
Q_OBJECT
72
68
73
- int fMaxCients ;
74
- std::string fError ; // Not important right now
75
- std::string fUrl ; // Url of wrapped http page
69
+ int fMaxCients ;
70
+ std::string fError ; // Not important right now
71
+ std::string fUrl ; // Url of wrapped http page
76
72
77
- bool fPosted ; // Post request completed
78
- bool fCompiled ; // Compilation sucess
73
+ bool fPosted ; // Post request completed
74
+ bool fCompiled ; // Compilation sucess
79
75
80
- std::string fServerAddress ;
81
- std::string fJson ;
82
- std::string fHtml ;
83
- std::string fHome ;
76
+ std::string fServerAddress ;
77
+ std::string fJson ;
78
+ std::string fHtml ;
79
+ std::string fHome ;
84
80
85
- std::map<int , std::string> fDeclaredNames ;
81
+ std::map<int , std::string> fDeclaredNames ;
86
82
87
- static FLServerHttp* _serverInstance;
83
+ static FLServerHttp* _serverInstance;
88
84
89
- static int fUploadingClients ;
85
+ static int fUploadingClients ;
90
86
91
- struct MHD_Daemon * fDaemon ;
87
+ struct MHD_Daemon * fDaemon ;
92
88
93
- int handleGet (MHD_Connection* connection, const char * url);
94
- int handlePost (MHD_Connection* connection, const char * url, void * info);
89
+ int handleGet (MHD_Connection* connection, const char * url);
90
+ int handlePost (MHD_Connection* connection, const char * url, void * info);
95
91
96
- void updateAvailableInterfaces ();
97
- int getMaxClients ();
92
+ void updateAvailableInterfaces ();
93
+ int getMaxClients ();
98
94
99
- int sendPage (struct MHD_Connection *connection, const char * page, int length, int status_code, const char * type = 0 );
95
+ int sendPage (struct MHD_Connection *connection, const char * page, int length, int status_code, const char * type = 0 );
100
96
101
- static int answerToConnection (void * cls, struct MHD_Connection * connection,
102
- const char * url, const char * method,
103
- const char * version, const char * upload_data,
104
- size_t * upload_data_size, void ** con_cls);
97
+ static int answerToConnection (void * cls, struct MHD_Connection * connection,
98
+ const char * url, const char * method,
99
+ const char * version, const char * upload_data,
100
+ size_t * upload_data_size, void ** con_cls);
105
101
106
102
107
- int redirectJsonRequest (struct MHD_Connection *connection, std::string portNumber);
103
+ int redirectJsonRequest (struct MHD_Connection *connection, std::string portNumber);
108
104
109
105
static void requestCompleted (void * cls, MHD_Connection* connection, void ** con_cls, MHD_RequestTerminationCode toe);
110
106
@@ -120,19 +116,19 @@ class FLServerHttp : public QObject
120
116
FLServerHttp (const std::string& home);
121
117
virtual ~FLServerHttp ();
122
118
123
- bool start ();
124
- void stop ();
119
+ bool start ();
120
+ void stop ();
125
121
126
- void declareHttpInterface (int port, const std::string& name);
127
- void removeHttpInterface (int port);
122
+ void declareHttpInterface (int port, const std::string& name);
123
+ void removeHttpInterface (int port);
128
124
129
- void compileSuccessfull (const std::string& url);
130
- void compileFailed (const std::string& error);
125
+ void compileSuccessfull (const std::string& url);
126
+ void compileFailed (const std::string& error);
131
127
132
128
static void createInstance (const std::string& homeFolder);
133
129
static void deleteInstance ();
134
130
135
- static FLServerHttp* _Instance ();
131
+ static FLServerHttp* _Instance ();
136
132
137
133
signals:
138
134
0 commit comments