cleanup
Costa Tsaousis committed
Jun 1, 2016 at 00:56 UTC
8e6cad71bac90ae314d7e4632de4782ed08400c4
3 files changed
+4
-5
src/registry.c
+1
-1
@@ -1024,8 +1024,8 @@ static inline void registry_set_person_cookie(struct web_client *w, PERSON *p) {
1024
}
1025
1026
static inline void registry_json_header(struct web_client *w, const char *action, const char *status) {
1027
- w->response.data->contenttype = CT_APPLICATION_JSON;
1027
buffer_flush(w->response.data);
1028
+ w->response.data->contenttype = CT_APPLICATION_JSON;
1029
buffer_sprintf(w->response.data, "{\n\t\"action\": \"%s\",\n\t\"status\": \"%s\",\n\t\"hostname\": \"%s\",\n\t\"machine_guid\": \"%s\"",
1030
action, status, registry.hostname, registry.machine_guid);
1031
}
src/web_client.c
+3
-1
@@ -11,13 +11,15 @@
11
#include <pthread.h>
12
#include <sys/stat.h>
13
#include <fcntl.h>
14
-#include <netinet/tcp.h>
14
#include <malloc.h>
15
#include <pwd.h>
16
#include <grp.h>
17
#include <ctype.h>
18
#include <poll.h>
19
20
+// TCP_CORK
21
+#include <netinet/tcp.h>
22
+
23
#include "common.h"
24
#include "log.h"
25
#include "appconfig.h"
src/web_client.h
-3
@@ -65,16 +65,13 @@ struct web_client {
65
uint8_t dead:1; // if set to 1, this client is dead
66
67
uint8_t keepalive:1; // if set to 1, the web client will be re-used
68
- uint8_t enable_gzip:1; // if set to 1, the response will be compressed
68
69
uint8_t mode:3; // the operational mode of the client
70
71
uint8_t wait_receive:1; // 1 = we are waiting more input data
72
uint8_t wait_send:1; // 1 = we have data to send to the client
73
75
-#ifdef TCP_CORK
74
int tcp_cork; // 1 = we have a cork on the socket
77
-#endif /* TCP_CORK */
75
76
int ifd;
77
int ofd;