aboutsummaryrefslogtreecommitdiff
path: root/src/examples/suspend_resume_epoll.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples/suspend_resume_epoll.c')
-rw-r--r--src/examples/suspend_resume_epoll.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/examples/suspend_resume_epoll.c b/src/examples/suspend_resume_epoll.c
index 0f9f66bf..903dcd81 100644
--- a/src/examples/suspend_resume_epoll.c
+++ b/src/examples/suspend_resume_epoll.c
@@ -74,7 +74,7 @@ ahc_echo (void *cls,
74 74
75 if (-1 != req->timerfd) 75 if (-1 != req->timerfd)
76 { 76 {
77 // send response (echo request url) 77 /* send response (echo request url) */
78 response = MHD_create_response_from_buffer (strlen (url), 78 response = MHD_create_response_from_buffer (strlen (url),
79 (void *) url, 79 (void *) url,
80 MHD_RESPMEM_MUST_COPY); 80 MHD_RESPMEM_MUST_COPY);
@@ -86,7 +86,7 @@ ahc_echo (void *cls,
86 MHD_destroy_response (response); 86 MHD_destroy_response (response);
87 return ret; 87 return ret;
88 } 88 }
89 // create timer and suspend connection 89 /* create timer and suspend connection */
90 req->timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK); 90 req->timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
91 if (-1 == req->timerfd) 91 if (-1 == req->timerfd)
92 { 92 {
@@ -183,24 +183,24 @@ main (int argc,
183 { 183 {
184 if (events_list[0].data.ptr) 184 if (events_list[0].data.ptr)
185 { 185 {
186 // A timer has timed out 186 /* A timer has timed out */
187 req = events_list[0].data.ptr; 187 req = events_list[0].data.ptr;
188 // read from the fd so the system knows we heard the notice 188 /* read from the fd so the system knows we heard the notice */
189 if (-1 == read(req->timerfd, &timer_expirations, sizeof(timer_expirations))) 189 if (-1 == read(req->timerfd, &timer_expirations, sizeof(timer_expirations)))
190 { 190 {
191 return 1; 191 return 1;
192 } 192 }
193 // Now resume the connection 193 /* Now resume the connection */
194 MHD_resume_connection(req->connection); 194 MHD_resume_connection(req->connection);
195 } 195 }
196 } 196 }
197 else if (0 == current_event_count) 197 else if (0 == current_event_count)
198 { 198 {
199 // no events: continue 199 /* no events: continue */
200 } 200 }
201 else 201 else
202 { 202 {
203 // error 203 /* error */
204 return 1; 204 return 1;
205 } 205 }
206 if (! MHD_run(d)) 206 if (! MHD_run(d))