diff options
Diffstat (limited to 'src/microhttpd/connection_https.c')
-rw-r--r-- | src/microhttpd/connection_https.c | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/microhttpd/connection_https.c b/src/microhttpd/connection_https.c index 79a52b5e..7307d48b 100644 --- a/src/microhttpd/connection_https.c +++ b/src/microhttpd/connection_https.c | |||
@@ -91,52 +91,6 @@ recv_tls_adapter (struct MHD_Connection *connection, | |||
91 | 91 | ||
92 | 92 | ||
93 | /** | 93 | /** |
94 | * Callback for writing data to the socket. | ||
95 | * | ||
96 | * @param connection the MHD connection structure | ||
97 | * @param other data to write | ||
98 | * @param i number of bytes to write | ||
99 | * @return positive value for number of bytes actually sent or | ||
100 | * negative value for error number MHD_ERR_xxx_ | ||
101 | */ | ||
102 | ssize_t | ||
103 | send_tls_adapter (struct MHD_Connection *connection, | ||
104 | const void *other, | ||
105 | size_t i) | ||
106 | { | ||
107 | ssize_t res; | ||
108 | |||
109 | if (i > SSIZE_MAX) | ||
110 | i = SSIZE_MAX; | ||
111 | |||
112 | res = gnutls_record_send (connection->tls_session, | ||
113 | other, | ||
114 | i); | ||
115 | if ( (GNUTLS_E_AGAIN == res) || | ||
116 | (GNUTLS_E_INTERRUPTED == res) ) | ||
117 | { | ||
118 | #ifdef EPOLL_SUPPORT | ||
119 | if (GNUTLS_E_AGAIN == res) | ||
120 | connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY; | ||
121 | #endif | ||
122 | return MHD_ERR_AGAIN_; | ||
123 | } | ||
124 | if (res < 0) | ||
125 | { | ||
126 | /* Likely 'GNUTLS_E_INVALID_SESSION' (client communication | ||
127 | disrupted); interpret as a hard error */ | ||
128 | return MHD_ERR_NOTCONN_; | ||
129 | } | ||
130 | #ifdef EPOLL_SUPPORT | ||
131 | /* Unlike non-TLS connections, do not reset "write-ready" if | ||
132 | * sent amount smaller than provided amount, as TLS | ||
133 | * connections may break data into smaller parts for sending. */ | ||
134 | #endif /* EPOLL_SUPPORT */ | ||
135 | return res; | ||
136 | } | ||
137 | |||
138 | |||
139 | /** | ||
140 | * Give gnuTLS chance to work on the TLS handshake. | 94 | * Give gnuTLS chance to work on the TLS handshake. |
141 | * | 95 | * |
142 | * @param connection connection to handshake on | 96 | * @param connection connection to handshake on |
@@ -192,7 +146,6 @@ void | |||
192 | MHD_set_https_callbacks (struct MHD_Connection *connection) | 146 | MHD_set_https_callbacks (struct MHD_Connection *connection) |
193 | { | 147 | { |
194 | connection->recv_cls = &recv_tls_adapter; | 148 | connection->recv_cls = &recv_tls_adapter; |
195 | connection->send_cls = &send_tls_adapter; | ||
196 | } | 149 | } |
197 | 150 | ||
198 | 151 | ||