Skip to content

Commit ae91d67

Browse files
committed
Change option name server.daemon to server.thread
1 parent 873f627 commit ae91d67

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

examples/echo_tcp_server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ int main(int argc, char **argv) {
146146
// Run server in a separate thread. If you want to run multiple
147147
// server instances or if you want to run it in background, this
148148
// is the option.
149-
ad_server_set_option(server, "server.daemon", "0");
149+
ad_server_set_option(server, "server.thread", "0");
150150

151151
// Call ad_server_free() internally when server is shutting down.
152152
ad_server_set_option(server, "server.free_on_stop", "1");

include/asyncd/ad_server.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ typedef struct ad_hook_s ad_hook_t;
106106
{ "server.request_pipelining", "1" }, \
107107
\
108108
/* Run server in a separate thread */ \
109-
{ "server.daemon", "0" }, \
109+
{ "server.thread", "0" }, \
110110
\
111111
/* Collect resources after stop */ \
112112
{ "server.free_on_stop", "1" }, \

src/ad_http_handler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,4 +669,4 @@ static ssize_t evbuffer_drainln(struct evbuffer *buffer, size_t *n_read_out, enu
669669
return linelen;
670670
}
671671

672-
#endif _DOXYGEN_SKIP
672+
#endif // _DOXYGEN_SKIP

src/ad_server.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ int ad_server_start(ad_server_t *server) {
221221
INFO("Listening on %s:%d%s", addr, port, ((server->sslctx) ? " (SSL)" : ""));
222222

223223
int exitstatus = 0;
224-
if (ad_server_get_option_int(server, "server.daemon")) {
224+
if (ad_server_get_option_int(server, "server.thread")) {
225225
DEBUG("Launching server as a thread.")
226226
server->thread = NEW_OBJECT(pthread_t);
227227
pthread_create(server->thread, NULL, &server_loop, (void *)server);
@@ -252,7 +252,7 @@ void ad_server_stop(ad_server_t *server) {
252252
notify_loopexit(server);
253253
sleep(1);
254254

255-
if (ad_server_get_option_int(server, "server.daemon")) {
255+
if (ad_server_get_option_int(server, "server.thread")) {
256256
close_server(server);
257257
if (ad_server_get_option_int(server, "server.free_on_stop")) {
258258
ad_server_free(server);
@@ -266,8 +266,8 @@ void ad_server_stop(ad_server_t *server) {
266266
void ad_server_free(ad_server_t *server) {
267267
if (server == NULL) return;
268268

269-
int daemon = ad_server_get_option_int(server, "server.daemon");
270-
if (daemon && server->thread) {
269+
int thread = ad_server_get_option_int(server, "server.thread");
270+
if (thread && server->thread) {
271271
notify_loopexit(server);
272272
sleep(1);
273273
close_server(server);
@@ -758,4 +758,4 @@ static void *get_userdata(ad_conn_t *conn, int index) {
758758
return conn->userdata[index];
759759
}
760760

761-
#endif _DOXYGEN_SKIP
761+
#endif // _DOXYGEN_SKIP

0 commit comments

Comments
 (0)