allow the API to switch hosts
Costa Tsaousis (ktsaou) committed
Feb 19, 2017 at 13:57 UTC
38b4fc953f5079eb9c4d449479be545eea329184
3 files changed
+210
-184
src/web_client.c
+208
-182
@@ -1853,7 +1853,13 @@ static inline char *http_header_parse(struct web_client *w, char *s) {
1853
// > 0 : request is not supported
1854
// < 0 : request is incomplete - wait for more data
1855
1856
-static inline int http_request_validate(struct web_client *w) {
1856
+typedef enum http_validation {
1857
+ HTTP_VALIDATION_OK,
1858
+ HTTP_VALIDATION_NOT_SUPPORTED,
1859
+ HTTP_VALIDATION_INCOMPLETE
1860
+} HTTP_VALIDATION;
1861
+
1862
+static inline HTTP_VALIDATION http_request_validate(struct web_client *w) {
1863
char *s = w->response.data->buffer, *encoded_url = NULL;
1864
1865
// is is a valid request?
@@ -1867,7 +1873,7 @@ static inline int http_request_validate(struct web_client *w) {
1873
}
1874
else {
1875
w->wait_receive = 0;
1870
- return 1;
1876
+ return HTTP_VALIDATION_NOT_SUPPORTED;
1877
}
1878
1879
// find the SPACE + "HTTP/"
@@ -1883,7 +1889,7 @@ static inline int http_request_validate(struct web_client *w) {
1889
// incomplete requests
1890
if(unlikely(!*s)) {
1891
w->wait_receive = 1;
1886
- return -2;
1892
+ return HTTP_VALIDATION_INCOMPLETE;
1893
}
1894
1895
// we have the end of encoded_url - remember it
@@ -1914,7 +1920,7 @@ static inline int http_request_validate(struct web_client *w) {
1920
strncpyz(w->last_url, w->decoded_url, URL_MAX);
1921
1922
w->wait_receive = 0;
1917
- return 0;
1923
+ return HTTP_VALIDATION_OK;
1924
}
1925
1926
// another header line
@@ -1924,7 +1930,7 @@ static inline int http_request_validate(struct web_client *w) {
1930
1931
// incomplete request
1932
w->wait_receive = 1;
1927
- return -3;
1933
+ return HTTP_VALIDATION_INCOMPLETE;
1934
}
1935
1936
static inline void web_client_send_http_header(struct web_client *w) {
@@ -2069,7 +2075,35 @@ static inline void web_client_send_http_header(struct web_client *w) {
2075
w->stats_sent_bytes += bytes;
2076
}
2077
2072
-void web_client_process(struct web_client *w) {
2078
+static inline int web_client_process_url(RRDHOST *host, struct web_client *w, char *url);
2079
+
2080
+static inline int web_client_switch_host(RRDHOST *host, struct web_client *w, char *url) {
2081
+ if(host != localhost) {
2082
+ buffer_flush(w->response.data);
2083
+ buffer_strcat(w->response.data, "Nesting of hosts is not allowed.");
2084
+ return 400;
2085
+ }
2086
+
2087
+ char *tok = mystrsep(&url, "/?&");
2088
+ if(tok && *tok) {
2089
+ debug(D_WEB_CLIENT, "%llu: Searching for host with name '%s'.", w->id, tok);
2090
+
2091
+ uint32_t hash = simple_hash(tok);
2092
+ RRDHOST *h;
2093
+ for(h = localhost; h; h = h->next) {
2094
+ if(unlikely((hash == h->hash_hostname && !strcmp(tok, h->hostname)) ||
2095
+ (hash == h->hash_machine_guid && !strcmp(tok, h->machine_guid))))
2096
+ return web_client_process_url(h, w, url);
2097
+ }
2098
+ }
2099
+
2100
+ buffer_flush(w->response.data);
2101
+ buffer_strcat(w->response.data, "Host is not found: ");
2102
+ buffer_strcat_htmlescape(w->response.data, tok?tok:"");
2103
+ return 404;
2104
+}
2105
+
2106
+static inline int web_client_process_url(RRDHOST *host, struct web_client *w, char *url) {
2107
static uint32_t
2108
hash_api = 0,
2109
hash_netdata_conf = 0,
@@ -2077,15 +2111,13 @@ void web_client_process(struct web_client *w) {
2111
hash_datasource = 0,
2112
hash_graph = 0,
2113
hash_list = 0,
2080
- hash_all_json = 0;
2114
+ hash_all_json = 0,
2115
+ hash_host = 0;
2116
2117
#ifdef NETDATA_INTERNAL_CHECKS
2118
static uint32_t hash_exit = 0, hash_debug = 0, hash_mirror = 0;
2119
#endif
2120
2086
- // start timing us
2087
- now_realtime_timeval(&w->tv_in);
2088
-
2121
if(unlikely(!hash_api)) {
2122
hash_api = simple_hash("api");
2123
hash_netdata_conf = simple_hash("netdata.conf");
@@ -2094,6 +2126,7 @@ void web_client_process(struct web_client *w) {
2126
hash_graph = simple_hash(WEB_PATH_GRAPH);
2127
hash_list = simple_hash("list");
2128
hash_all_json = simple_hash("all.json");
2129
+ hash_host = simple_hash("host");
2130
#ifdef NETDATA_INTERNAL_CHECKS
2131
hash_exit = simple_hash("exit");
2132
hash_debug = simple_hash("debug");
@@ -2101,207 +2134,201 @@ void web_client_process(struct web_client *w) {
2134
#endif
2135
}
2136
2104
- int code = 500;
2137
+ char *tok = mystrsep(&url, "/?");
2138
+ if(likely(tok && *tok)) {
2139
+ uint32_t hash = simple_hash(tok);
2140
+ debug(D_WEB_CLIENT, "%llu: Processing command '%s'.", w->id, tok);
2141
2106
- int what_to_do = http_request_validate(w);
2142
+ if(unlikely(hash == hash_host && strcmp(tok, "host") == 0)) {
2143
+ debug(D_WEB_CLIENT_ACCESS, "%llu: host switch request ...", w->id);
2144
+ return web_client_switch_host(host, w, url);
2145
+ }
2146
+ if(unlikely(hash == hash_api && strcmp(tok, "api") == 0)) {
2147
+ debug(D_WEB_CLIENT_ACCESS, "%llu: API request ...", w->id);
2148
+ return web_client_api_request(host, w, url);
2149
+ }
2150
+ else if(unlikely(hash == hash_netdata_conf && strcmp(tok, "netdata.conf") == 0)) {
2151
+ debug(D_WEB_CLIENT_ACCESS, "%llu: Sending netdata.conf ...", w->id);
2152
+ w->response.data->contenttype = CT_TEXT_PLAIN;
2153
+ buffer_flush(w->response.data);
2154
+ generate_config(w->response.data, 0);
2155
+ return 200;
2156
+ }
2157
+ else if(unlikely(hash == hash_data && strcmp(tok, WEB_PATH_DATA) == 0)) { // "data"
2158
+ // the client is requesting rrd data -- OLD API
2159
+ return web_client_api_old_data_request(host, w, url, DATASOURCE_JSON);
2160
+ }
2161
+ else if(unlikely(hash == hash_datasource && strcmp(tok, WEB_PATH_DATASOURCE) == 0)) { // "datasource"
2162
+ // the client is requesting google datasource -- OLD API
2163
+ return web_client_api_old_data_request(host, w, url, DATASOURCE_DATATABLE_JSONP);
2164
+ }
2165
+ else if(unlikely(hash == hash_graph && strcmp(tok, WEB_PATH_GRAPH) == 0)) { // "graph"
2166
+ // the client is requesting an rrd graph -- OLD API
2167
2108
- // wait for more data
2109
- if(what_to_do < 0) {
2110
- if(w->response.data->len > TOO_BIG_REQUEST) {
2111
- strcpy(w->last_url, "too big request");
2168
+ // get the name of the data to show
2169
+ tok = mystrsep(&url, "/?&");
2170
+ if(tok && *tok) {
2171
+ debug(D_WEB_CLIENT, "%llu: Searching for RRD data with name '%s'.", w->id, tok);
2172
+
2173
+ // do we have such a data set?
2174
+ RRDSET *st = rrdset_find_byname(host, tok);
2175
+ if(!st) st = rrdset_find(host, tok);
2176
+ if(!st) {
2177
+ // we don't have it
2178
+ // try to send a file with that name
2179
+ buffer_flush(w->response.data);
2180
+ return mysendfile(w, tok);
2181
+ }
2182
2113
- debug(D_WEB_CLIENT_ACCESS, "%llu: Received request is too big (%zu bytes).", w->id, w->response.data->len);
2183
+ debug(D_WEB_CLIENT_ACCESS, "%llu: Sending %s.json of RRD_STATS...", w->id, st->name);
2184
+ w->response.data->contenttype = CT_APPLICATION_JSON;
2185
+ buffer_flush(w->response.data);
2186
+ rrd_stats_graph_json(st, url, w->response.data);
2187
+ return 200;
2188
+ }
2189
2115
- code = 400;
2190
buffer_flush(w->response.data);
2117
- buffer_sprintf(w->response.data, "Received request is too big (%zu bytes).\r\n", w->response.data->len);
2118
- }
2119
- else {
2120
- // wait for more data
2121
- return;
2191
+ buffer_strcat(w->response.data, "Graph name?\r\n");
2192
+ return 400;
2193
}
2123
- }
2124
- else if(what_to_do > 0) {
2125
- // strcpy(w->last_url, "not a valid request");
2194
+ else if(unlikely(hash == hash_list && strcmp(tok, "list") == 0)) {
2195
+ // OLD API
2196
+ debug(D_WEB_CLIENT_ACCESS, "%llu: Sending list of RRD_STATS...", w->id);
2197
2127
- debug(D_WEB_CLIENT_ACCESS, "%llu: Cannot understand '%s'.", w->id, w->response.data->buffer);
2198
+ buffer_flush(w->response.data);
2199
+ RRDSET *st = host->rrdset_root;
2200
2129
- code = 500;
2130
- buffer_flush(w->response.data);
2131
- buffer_strcat(w->response.data, "I don't understand you...\r\n");
2132
- }
2133
- else { // what_to_do == 0
2134
- if(w->mode == WEB_CLIENT_MODE_OPTIONS) {
2135
- code = 200;
2201
+ for ( ; st ; st = st->next )
2202
+ buffer_sprintf(w->response.data, "%s\n", st->name);
2203
+
2204
+ return 200;
2205
+ }
2206
+ else if(unlikely(hash == hash_all_json && strcmp(tok, "all.json") == 0)) {
2207
+ // OLD API
2208
+ debug(D_WEB_CLIENT_ACCESS, "%llu: Sending JSON list of all monitors of RRD_STATS...", w->id);
2209
+
2210
+ w->response.data->contenttype = CT_APPLICATION_JSON;
2211
+ buffer_flush(w->response.data);
2212
+ rrd_stats_all_json(host, w->response.data);
2213
+ return 200;
2214
+ }
2215
+#ifdef NETDATA_INTERNAL_CHECKS
2216
+ else if(unlikely(hash == hash_exit && strcmp(tok, "exit") == 0)) {
2217
w->response.data->contenttype = CT_TEXT_PLAIN;
2218
buffer_flush(w->response.data);
2138
- buffer_strcat(w->response.data, "OK");
2219
+
2220
+ if(!netdata_exit)
2221
+ buffer_strcat(w->response.data, "ok, will do...");
2222
+ else
2223
+ buffer_strcat(w->response.data, "I am doing it already");
2224
+
2225
+ error("web request to exit received.");
2226
+ netdata_cleanup_and_exit(0);
2227
+ return 200;
2228
}
2140
- else {
2141
- char *url = w->decoded_url;
2142
- char *tok = mystrsep(&url, "/?");
2143
- if(tok && *tok) {
2144
- uint32_t hash = simple_hash(tok);
2145
- debug(D_WEB_CLIENT, "%llu: Processing command '%s'.", w->id, tok);
2229
+ else if(unlikely(hash == hash_debug && strcmp(tok, "debug") == 0)) {
2230
+ buffer_flush(w->response.data);
2231
2147
- if(hash == hash_api && strcmp(tok, "api") == 0) {
2148
- // the client is requesting api access
2149
- code = web_client_api_request(localhost, w, url);
2232
+ // get the name of the data to show
2233
+ tok = mystrsep(&url, "/?&");
2234
+ if(tok && *tok) {
2235
+ debug(D_WEB_CLIENT, "%llu: Searching for RRD data with name '%s'.", w->id, tok);
2236
+
2237
+ // do we have such a data set?
2238
+ RRDSET *st = rrdset_find_byname(host, tok);
2239
+ if(!st) st = rrdset_find(host, tok);
2240
+ if(!st) {
2241
+ buffer_strcat(w->response.data, "Chart is not found: ");
2242
+ buffer_strcat_htmlescape(w->response.data, tok);
2243
+ debug(D_WEB_CLIENT_ACCESS, "%llu: %s is not found.", w->id, tok);
2244
+ return 404;
2245
}
2151
- else if(hash == hash_netdata_conf && strcmp(tok, "netdata.conf") == 0) {
2152
- code = 200;
2153
- debug(D_WEB_CLIENT_ACCESS, "%llu: Sending netdata.conf ...", w->id);
2246
2155
- w->response.data->contenttype = CT_TEXT_PLAIN;
2156
- buffer_flush(w->response.data);
2157
- generate_config(w->response.data, 0);
2158
- }
2159
- else if(hash == hash_data && strcmp(tok, WEB_PATH_DATA) == 0) { // "data"
2160
- // the client is requesting rrd data -- OLD API
2161
- code = web_client_api_old_data_request(localhost, w, url, DATASOURCE_JSON);
2162
- }
2163
- else if(hash == hash_datasource && strcmp(tok, WEB_PATH_DATASOURCE) == 0) { // "datasource"
2164
- // the client is requesting google datasource -- OLD API
2165
- code = web_client_api_old_data_request(localhost, w, url, DATASOURCE_DATATABLE_JSONP);
2166
- }
2167
- else if(hash == hash_graph && strcmp(tok, WEB_PATH_GRAPH) == 0) { // "graph"
2168
- // the client is requesting an rrd graph -- OLD API
2169
-
2170
- // get the name of the data to show
2171
- tok = mystrsep(&url, "/?&");
2172
- if(tok && *tok) {
2173
- debug(D_WEB_CLIENT, "%llu: Searching for RRD data with name '%s'.", w->id, tok);
2174
-
2175
- // do we have such a data set?
2176
- RRDSET *st = rrdset_find_byname(localhost, tok);
2177
- if(!st) st = rrdset_find(localhost, tok);
2178
- if(!st) {
2179
- // we don't have it
2180
- // try to send a file with that name
2181
- buffer_flush(w->response.data);
2182
- code = mysendfile(w, tok);
2183
- }
2184
- else {
2185
- code = 200;
2186
- debug(D_WEB_CLIENT_ACCESS, "%llu: Sending %s.json of RRD_STATS...", w->id, st->name);
2187
- w->response.data->contenttype = CT_APPLICATION_JSON;
2188
- buffer_flush(w->response.data);
2189
- rrd_stats_graph_json(st, url, w->response.data);
2190
- }
2191
- }
2192
- else {
2193
- code = 400;
2194
- buffer_flush(w->response.data);
2195
- buffer_strcat(w->response.data, "Graph name?\r\n");
2196
- }
2197
- }
2198
- else if(hash == hash_list && strcmp(tok, "list") == 0) {
2199
- // OLD API
2200
- code = 200;
2247
+ debug_flags |= D_RRD_STATS;
2248
2202
- debug(D_WEB_CLIENT_ACCESS, "%llu: Sending list of RRD_STATS...", w->id);
2249
+ if(rrdset_flag_check(st, RRDSET_FLAG_DEBUG))
2250
+ rrdset_flag_clear(st, RRDSET_FLAG_DEBUG);
2251
+ else
2252
+ rrdset_flag_set(st, RRDSET_FLAG_DEBUG);
2253
2204
- buffer_flush(w->response.data);
2205
- RRDSET *st = localhost->rrdset_root;
2254
+ buffer_sprintf(w->response.data, "Chart has now debug %s: ", rrdset_flag_check(st, RRDSET_FLAG_DEBUG)?"enabled":"disabled");
2255
+ buffer_strcat_htmlescape(w->response.data, tok);
2256
+ debug(D_WEB_CLIENT_ACCESS, "%llu: debug for %s is %s.", w->id, tok, rrdset_flag_check(st, RRDSET_FLAG_DEBUG)?"enabled":"disabled");
2257
+ return 200;
2258
+ }
2259
2207
- for ( ; st ; st = st->next )
2208
- buffer_sprintf(w->response.data, "%s\n", st->name);
2209
- }
2210
- else if(hash == hash_all_json && strcmp(tok, "all.json") == 0) {
2211
- // OLD API
2212
- code = 200;
2213
- debug(D_WEB_CLIENT_ACCESS, "%llu: Sending JSON list of all monitors of RRD_STATS...", w->id);
2260
+ buffer_flush(w->response.data);
2261
+ buffer_strcat(w->response.data, "debug which chart?\r\n");
2262
+ return 400;
2263
+ }
2264
+ else if(unlikely(hash == hash_mirror && strcmp(tok, "mirror") == 0)) {
2265
+ debug(D_WEB_CLIENT_ACCESS, "%llu: Mirroring...", w->id);
2266
2215
- w->response.data->contenttype = CT_APPLICATION_JSON;
2216
- buffer_flush(w->response.data);
2217
- rrd_stats_all_json(localhost, w->response.data);
2218
- }
2219
-#ifdef NETDATA_INTERNAL_CHECKS
2220
- else if(hash == hash_exit && strcmp(tok, "exit") == 0) {
2221
- code = 200;
2222
- w->response.data->contenttype = CT_TEXT_PLAIN;
2223
- buffer_flush(w->response.data);
2267
+ // replace the zero bytes with spaces
2268
+ buffer_char_replace(w->response.data, '\0', ' ');
2269
2225
- if(!netdata_exit)
2226
- buffer_strcat(w->response.data, "ok, will do...");
2227
- else
2228
- buffer_strcat(w->response.data, "I am doing it already");
2270
+ // just leave the buffer as is
2271
+ // it will be copied back to the client
2272
2230
- error("web request to exit received.");
2231
- netdata_cleanup_and_exit(0);
2232
- }
2233
- else if(hash == hash_debug && strcmp(tok, "debug") == 0) {
2234
- buffer_flush(w->response.data);
2273
+ return 200;
2274
+ }
2275
+#endif /* NETDATA_INTERNAL_CHECKS */
2276
+ }
2277
2236
- // get the name of the data to show
2237
- tok = mystrsep(&url, "/?&");
2238
- if(tok && *tok) {
2239
- debug(D_WEB_CLIENT, "%llu: Searching for RRD data with name '%s'.", w->id, tok);
2240
-
2241
- // do we have such a data set?
2242
- RRDSET *st = rrdset_find_byname(localhost, tok);
2243
- if(!st) st = rrdset_find(localhost, tok);
2244
- if(!st) {
2245
- code = 404;
2246
- buffer_strcat(w->response.data, "Chart is not found: ");
2247
- buffer_strcat_htmlescape(w->response.data, tok);
2248
- debug(D_WEB_CLIENT_ACCESS, "%llu: %s is not found.", w->id, tok);
2249
- }
2250
- else {
2251
- code = 200;
2252
- debug_flags |= D_RRD_STATS;
2253
-
2254
- if(rrdset_flag_check(st, RRDSET_FLAG_DEBUG))
2255
- rrdset_flag_clear(st, RRDSET_FLAG_DEBUG);
2256
- else
2257
- rrdset_flag_set(st, RRDSET_FLAG_DEBUG);
2258
-
2259
- buffer_sprintf(w->response.data, "Chart has now debug %s: ", rrdset_flag_check(st, RRDSET_FLAG_DEBUG)?"enabled":"disabled");
2260
- buffer_strcat_htmlescape(w->response.data, tok);
2261
- debug(D_WEB_CLIENT_ACCESS, "%llu: debug for %s is %s.", w->id, tok, rrdset_flag_check(st, RRDSET_FLAG_DEBUG)?"enabled":"disabled");
2262
- }
2263
- }
2264
- else {
2265
- code = 500;
2266
- buffer_flush(w->response.data);
2267
- buffer_strcat(w->response.data, "debug which chart?\r\n");
2268
- }
2269
- }
2270
- else if(hash == hash_mirror && strcmp(tok, "mirror") == 0) {
2271
- code = 200;
2278
+ char filename[FILENAME_MAX+1];
2279
+ url = filename;
2280
+ strncpyz(filename, w->last_url, FILENAME_MAX);
2281
+ tok = mystrsep(&url, "?");
2282
+ buffer_flush(w->response.data);
2283
+ return mysendfile(w, (tok && *tok)?tok:"/");
2284
+}
2285
2273
- debug(D_WEB_CLIENT_ACCESS, "%llu: Mirroring...", w->id);
2286
+void web_client_process_request(struct web_client *w) {
2287
2275
- // replace the zero bytes with spaces
2276
- buffer_char_replace(w->response.data, '\0', ' ');
2288
+ // start timing us
2289
+ now_realtime_timeval(&w->tv_in);
2290
2278
- // just leave the buffer as is
2279
- // it will be copied back to the client
2280
- }
2281
-#endif /* NETDATA_INTERNAL_CHECKS */
2282
- else {
2283
- char filename[FILENAME_MAX+1];
2284
- url = filename;
2285
- strncpyz(filename, w->last_url, FILENAME_MAX);
2286
- tok = mystrsep(&url, "?");
2287
- buffer_flush(w->response.data);
2288
- code = mysendfile(w, (tok && *tok)?tok:"/");
2289
- }
2291
+ switch(http_request_validate(w)) {
2292
+ case HTTP_VALIDATION_OK:
2293
+ if(unlikely(w->mode == WEB_CLIENT_MODE_OPTIONS)) {
2294
+ w->response.data->contenttype = CT_TEXT_PLAIN;
2295
+ buffer_flush(w->response.data);
2296
+ buffer_strcat(w->response.data, "OK");
2297
+ w->response.code = 200;
2298
}
2291
- else {
2292
- char filename[FILENAME_MAX+1];
2293
- url = filename;
2294
- strncpyz(filename, w->last_url, FILENAME_MAX);
2295
- tok = mystrsep(&url, "?");
2299
+ else
2300
+ w->response.code = web_client_process_url(localhost, w, w->decoded_url);
2301
+ break;
2302
+
2303
+ case HTTP_VALIDATION_INCOMPLETE:
2304
+ if(w->response.data->len > TOO_BIG_REQUEST) {
2305
+ strcpy(w->last_url, "too big request");
2306
+
2307
+ debug(D_WEB_CLIENT_ACCESS, "%llu: Received request is too big (%zu bytes).", w->id, w->response.data->len);
2308
+
2309
buffer_flush(w->response.data);
2297
- code = mysendfile(w, (tok && *tok)?tok:"/");
2310
+ buffer_sprintf(w->response.data, "Received request is too big (%zu bytes).\r\n", w->response.data->len);
2311
+ w->response.code = 400;
2312
}
2299
- }
2313
+ else {
2314
+ // wait for more data
2315
+ return;
2316
+ }
2317
+ break;
2318
+
2319
+ case HTTP_VALIDATION_NOT_SUPPORTED:
2320
+ debug(D_WEB_CLIENT_ACCESS, "%llu: Cannot understand '%s'.", w->id, w->response.data->buffer);
2321
+
2322
+ buffer_flush(w->response.data);
2323
+ buffer_strcat(w->response.data, "I don't understand you...\r\n");
2324
+ w->response.code = 400;
2325
+ break;
2326
}
2327
2328
+ // keep track of the time we done processing
2329
now_realtime_timeval(&w->tv_ready);
2330
+
2331
w->response.sent = 0;
2304
- w->response.code = code;
2332
2333
// set a proper last modified date
2334
if(unlikely(!w->response.data->date))
@@ -2313,7 +2340,6 @@ void web_client_process(struct web_client *w) {
2340
if(w->response.data->len) w->wait_send = 1;
2341
else w->wait_send = 0;
2342
2316
- // pretty logging
2343
switch(w->mode) {
2344
case WEB_CLIENT_MODE_OPTIONS:
2345
debug(D_WEB_CLIENT, "%llu: Done preparing the OPTIONS response. Sending data (%zu bytes) to client.", w->id, w->response.data->len);
@@ -2756,7 +2782,7 @@ void *web_client_main(void *ptr)
2782
2783
if(w->mode == WEB_CLIENT_MODE_NORMAL) {
2784
debug(D_WEB_CLIENT, "%llu: Attempting to process received data.", w->id);
2759
- web_client_process(w);
2785
+ web_client_process_request(w);
2786
}
2787
}
2788
src/web_client.h
+1
-1
@@ -103,7 +103,7 @@ extern struct web_client *web_client_create(int listener);
103
extern struct web_client *web_client_free(struct web_client *w);
104
extern ssize_t web_client_send(struct web_client *w);
105
extern ssize_t web_client_receive(struct web_client *w);
106
-extern void web_client_process(struct web_client *w);
106
+extern void web_client_process_request(struct web_client *w);
107
extern void web_client_reset(struct web_client *w);
108
109
extern void *web_client_main(void *ptr);
src/web_server.c
+1
-1
@@ -614,7 +614,7 @@ void *socket_listen_main_single_threaded(void *ptr) {
614
615
if (w->mode != WEB_CLIENT_MODE_FILECOPY) {
616
debug(D_WEB_CLIENT, "%llu: Processing received data.", w->id);
617
- web_client_process(w);
617
+ web_client_process_request(w);
618
}
619
}
620