Debian Codegraph @

src/microhttpd/connection_https.h

raw
1 /*
2 This file is part of libmicrohttpd
3 Copyright (C) 2008 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 connection_https.h
22 * @brief Methods for managing connections
23 * @author Christian Grothoff
24 */
25
26 #ifndef CONNECTION_HTTPS_H
27 #define CONNECTION_HTTPS_H
28
29 #include "internal.h"
30
31 #ifdef HTTPS_SUPPORT
32 /**
33 * Set connection callback function to be used through out
34 * the processing of this secure connection.
35 *
36 * @param connection which callbacks should be modified
37 */
38 void
39 MHD_set_https_callbacks (struct MHD_Connection *connection);
40
41
42 /**
43 * Give gnuTLS chance to work on the TLS handshake.
44 *
45 * @param connection connection to handshake on
46 * @return true if the handshake has completed successfully
47 * and we should start to read/write data,
48 * false is handshake in progress or in case
49 * of error
50 */
51 bool
52 MHD_run_tls_handshake_ (struct MHD_Connection *connection);
53
54
55 /**
56 * Initiate shutdown of TLS layer of connection.
57 *
58 * @param connection to use
59 * @return true if succeed, false otherwise.
60 */
61 bool
62 MHD_tls_connection_shutdown (struct MHD_Connection *connection);
63
64 /**
65 * Callback for writing data to the socket.
66 *
67 * @param connection the MHD connection structure
68 * @param other data to write
69 * @param i number of bytes to write
70 * @return positive value for number of bytes actually sent or
71 * negative value for error number MHD_ERR_xxx_
72 */
73 ssize_t
74 send_tls_adapter (struct MHD_Connection *connection,
75 const void *other,
76 size_t i);
77
78 #endif /* HTTPS_SUPPORT */
79
80 #endif