aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r--src/microhttpd/connection.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 1fa2ee87..715b2d40 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -231,60 +231,6 @@ recv_param_adapter (struct MHD_Connection *connection,
231 231
232 232
233/** 233/**
234 * Callback for writing data to the socket.
235 *
236 * @param connection the MHD connection structure
237 * @param other data to write
238 * @param i number of bytes to write
239 * @return positive value for number of bytes actually sent or
240 * negative value for error number MHD_ERR_xxx_
241 */
242static ssize_t
243send_param_adapter (struct MHD_Connection *connection,
244 const void *other,
245 size_t i)
246{
247 ssize_t ret;
248
249 if ( (MHD_INVALID_SOCKET == connection->socket_fd) ||
250 (MHD_CONNECTION_CLOSED == connection->state) )
251 {
252 return MHD_ERR_NOTCONN_;
253 }
254 if (i > MHD_SCKT_SEND_MAX_SIZE_)
255 i = MHD_SCKT_SEND_MAX_SIZE_; /* return value limit */
256
257 ret = MHD_send_ (connection->socket_fd,
258 other,
259 i);
260 if (0 > ret)
261 {
262 const int err = MHD_socket_get_error_ ();
263
264 if (MHD_SCKT_ERR_IS_EAGAIN_ (err))
265 {
266#ifdef EPOLL_SUPPORT
267 /* EAGAIN --- no longer write-ready */
268 connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
269#endif /* EPOLL_SUPPORT */
270 return MHD_ERR_AGAIN_;
271 }
272 if (MHD_SCKT_ERR_IS_EINTR_ (err))
273 return MHD_ERR_AGAIN_;
274 if (MHD_SCKT_ERR_IS_ (err, MHD_SCKT_ECONNRESET_))
275 return MHD_ERR_CONNRESET_;
276 /* Treat any other error as hard error. */
277 return MHD_ERR_NOTCONN_;
278 }
279#ifdef EPOLL_SUPPORT
280 else if (i > (size_t) ret)
281 connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
282#endif /* EPOLL_SUPPORT */
283 return ret;
284}
285
286
287/**
288 * Get all of the headers from the request. 234 * Get all of the headers from the request.
289 * 235 *
290 * @param connection connection to get values from 236 * @param connection connection to get values from
@@ -3814,7 +3760,6 @@ void
3814MHD_set_http_callbacks_ (struct MHD_Connection *connection) 3760MHD_set_http_callbacks_ (struct MHD_Connection *connection)
3815{ 3761{
3816 connection->recv_cls = &recv_param_adapter; 3762 connection->recv_cls = &recv_param_adapter;
3817 connection->send_cls = &send_param_adapter;
3818} 3763}
3819 3764
3820 3765