diff options
Diffstat (limited to 'src/daemon/connection.c')
-rw-r--r-- | src/daemon/connection.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/daemon/connection.c b/src/daemon/connection.c index 79a8e29b..ec300627 100644 --- a/src/daemon/connection.c +++ b/src/daemon/connection.c | |||
@@ -2293,7 +2293,7 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
2293 | } | 2293 | } |
2294 | break; | 2294 | break; |
2295 | } | 2295 | } |
2296 | timeout = connection->daemon->connection_timeout; | 2296 | timeout = connection->connection_timeout; |
2297 | if ( (timeout != 0) && | 2297 | if ( (timeout != 0) && |
2298 | (timeout <= (time (NULL) - connection->last_activity)) ) | 2298 | (timeout <= (time (NULL) - connection->last_activity)) ) |
2299 | { | 2299 | { |
@@ -2354,4 +2354,32 @@ MHD_get_connection_info (struct MHD_Connection *connection, | |||
2354 | } | 2354 | } |
2355 | 2355 | ||
2356 | 2356 | ||
2357 | /** | ||
2358 | * Set a custom option for the given connection, overriding defaults. | ||
2359 | * | ||
2360 | * @param connection connection to modify | ||
2361 | * @param option option to set | ||
2362 | * @param ... arguments to the option, depending on the option type | ||
2363 | * @return MHD_YES on success, MHD_NO if setting the option failed | ||
2364 | */ | ||
2365 | int | ||
2366 | MHD_set_connection_option (struct MHD_Connection *connection, | ||
2367 | enum MHD_CONNECTION_OPTION option, | ||
2368 | ...) | ||
2369 | { | ||
2370 | va_list ap; | ||
2371 | |||
2372 | switch (option) | ||
2373 | { | ||
2374 | case MHD_CONNECTION_OPTION_TIMEOUT: | ||
2375 | va_start (ap, option); | ||
2376 | connection->connection_timeout = va_arg (ap, unsigned int); | ||
2377 | va_end (ap); | ||
2378 | return MHD_YES; | ||
2379 | default: | ||
2380 | return MHD_NO; | ||
2381 | } | ||
2382 | } | ||
2383 | |||
2384 | |||
2357 | /* end of connection.c */ | 2385 | /* end of connection.c */ |