diff options
Diffstat (limited to 'src/lib/connection_options.c')
-rw-r--r-- | src/lib/connection_options.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/lib/connection_options.c b/src/lib/connection_options.c index 00652161..ce31b315 100644 --- a/src/lib/connection_options.c +++ b/src/lib/connection_options.c | |||
@@ -35,44 +35,44 @@ | |||
35 | */ | 35 | */ |
36 | void | 36 | void |
37 | MHD_connection_set_timeout (struct MHD_Connection *connection, | 37 | MHD_connection_set_timeout (struct MHD_Connection *connection, |
38 | unsigned int timeout_s) | 38 | unsigned int timeout_s) |
39 | { | 39 | { |
40 | struct MHD_Daemon *daemon = connection->daemon; | 40 | struct MHD_Daemon *daemon = connection->daemon; |
41 | 41 | ||
42 | connection->last_activity = MHD_monotonic_sec_counter(); | 42 | connection->last_activity = MHD_monotonic_sec_counter (); |
43 | if (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode) | 43 | if (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode) |
44 | { | 44 | { |
45 | /* Simple case, no need to lock to update DLLs */ | 45 | /* Simple case, no need to lock to update DLLs */ |
46 | connection->connection_timeout = (time_t) timeout_s; | 46 | connection->connection_timeout = (time_t) timeout_s; |
47 | return; | 47 | return; |
48 | } | 48 | } |
49 | 49 | ||
50 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); | 50 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); |
51 | if (! connection->suspended) | 51 | if (! connection->suspended) |
52 | { | 52 | { |
53 | if (connection->connection_timeout == | 53 | if (connection->connection_timeout == |
54 | daemon->connection_default_timeout) | 54 | daemon->connection_default_timeout) |
55 | XDLL_remove (daemon->normal_timeout_head, | 55 | XDLL_remove (daemon->normal_timeout_head, |
56 | daemon->normal_timeout_tail, | 56 | daemon->normal_timeout_tail, |
57 | connection); | 57 | connection); |
58 | else | 58 | else |
59 | XDLL_remove (daemon->manual_timeout_head, | 59 | XDLL_remove (daemon->manual_timeout_head, |
60 | daemon->manual_timeout_tail, | 60 | daemon->manual_timeout_tail, |
61 | connection); | 61 | connection); |
62 | } | 62 | } |
63 | connection->connection_timeout = (time_t) timeout_s; | 63 | connection->connection_timeout = (time_t) timeout_s; |
64 | if (! connection->suspended) | 64 | if (! connection->suspended) |
65 | { | 65 | { |
66 | if (connection->connection_timeout == | 66 | if (connection->connection_timeout == |
67 | daemon->connection_default_timeout) | 67 | daemon->connection_default_timeout) |
68 | XDLL_insert (daemon->normal_timeout_head, | 68 | XDLL_insert (daemon->normal_timeout_head, |
69 | daemon->normal_timeout_tail, | 69 | daemon->normal_timeout_tail, |
70 | connection); | 70 | connection); |
71 | else | 71 | else |
72 | XDLL_insert (daemon->manual_timeout_head, | 72 | XDLL_insert (daemon->manual_timeout_head, |
73 | daemon->manual_timeout_tail, | 73 | daemon->manual_timeout_tail, |
74 | connection); | 74 | connection); |
75 | } | 75 | } |
76 | MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); | 76 | MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); |
77 | } | 77 | } |
78 | 78 | ||
@@ -95,7 +95,7 @@ MHD_update_last_activity_ (struct MHD_Connection *connection) | |||
95 | if (connection->suspended) | 95 | if (connection->suspended) |
96 | return; /* no activity on suspended connections */ | 96 | return; /* no activity on suspended connections */ |
97 | 97 | ||
98 | connection->last_activity = MHD_monotonic_sec_counter(); | 98 | connection->last_activity = MHD_monotonic_sec_counter (); |
99 | if (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode) | 99 | if (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode) |
100 | return; /* each connection has personal timeout */ | 100 | return; /* each connection has personal timeout */ |
101 | 101 | ||
@@ -106,11 +106,11 @@ MHD_update_last_activity_ (struct MHD_Connection *connection) | |||
106 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); | 106 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); |
107 | /* move connection to head of timeout list (by remove + add operation) */ | 107 | /* move connection to head of timeout list (by remove + add operation) */ |
108 | XDLL_remove (daemon->normal_timeout_head, | 108 | XDLL_remove (daemon->normal_timeout_head, |
109 | daemon->normal_timeout_tail, | 109 | daemon->normal_timeout_tail, |
110 | connection); | 110 | connection); |
111 | XDLL_insert (daemon->normal_timeout_head, | 111 | XDLL_insert (daemon->normal_timeout_head, |
112 | daemon->normal_timeout_tail, | 112 | daemon->normal_timeout_tail, |
113 | connection); | 113 | connection); |
114 | MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); | 114 | MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); |
115 | } | 115 | } |
116 | 116 | ||