diff options
Diffstat (limited to 'src/lib/daemon_add_connection.c')
-rw-r--r-- | src/lib/daemon_add_connection.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/lib/daemon_add_connection.c b/src/lib/daemon_add_connection.c new file mode 100644 index 00000000..30492d7c --- /dev/null +++ b/src/lib/daemon_add_connection.c | |||
@@ -0,0 +1,63 @@ | |||
1 | /* | ||
2 | This file is part of libmicrohttpd | ||
3 | Copyright (C) 2007-2018 Daniel Pittman and Christian Grothoff | ||
4 | |||
5 | This library is free software; you can redistribute it and/or | ||
6 | modify it under the terms of the GNU Lesser General Public | ||
7 | License as published by the Free Software Foundation; either | ||
8 | version 2.1 of the License, or (at your option) any later version. | ||
9 | |||
10 | This library is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Lesser General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Lesser General Public | ||
16 | License along with this library; if not, write to the Free Software | ||
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | */ | ||
19 | |||
20 | /** | ||
21 | * @file lib/daemon_add_connection.c | ||
22 | * @brief main functions to add a connection to be managed by a daemon | ||
23 | * @author Christian Grothoff | ||
24 | */ | ||
25 | #include "internal.h" | ||
26 | |||
27 | |||
28 | /** | ||
29 | * Add another client connection to the set of connections managed by | ||
30 | * MHD. This API is usually not needed (since MHD will accept inbound | ||
31 | * connections on the server socket). Use this API in special cases, | ||
32 | * for example if your HTTP server is behind NAT and needs to connect | ||
33 | * out to the HTTP client, or if you are building a proxy. | ||
34 | * | ||
35 | * If you use this API in conjunction with a internal select or a | ||
36 | * thread pool, you must set the option | ||
37 | * #MHD_USE_ITC to ensure that the freshly added | ||
38 | * connection is immediately processed by MHD. | ||
39 | * | ||
40 | * The given client socket will be managed (and closed!) by MHD after | ||
41 | * this call and must no longer be used directly by the application | ||
42 | * afterwards. | ||
43 | * | ||
44 | * @param daemon daemon that manages the connection | ||
45 | * @param client_socket socket to manage (MHD will expect | ||
46 | * to receive an HTTP request from this socket next). | ||
47 | * @param addr IP address of the client | ||
48 | * @param addrlen number of bytes in @a addr | ||
49 | * @return #MHD_SC_OK on success | ||
50 | * The socket will be closed in any case; `errno` is | ||
51 | * set to indicate further details about the error. | ||
52 | * @ingroup specialized | ||
53 | */ | ||
54 | _MHD_EXTERN enum MHD_StatusCode | ||
55 | MHD_daemon_add_connection (struct MHD_Daemon *daemon, | ||
56 | MHD_socket client_socket, | ||
57 | const struct sockaddr *addr, | ||
58 | socklen_t addrlen) | ||
59 | { | ||
60 | return -1; | ||
61 | } | ||
62 | |||
63 | /* end of daemon_add_connection.c */ | ||