commit 11ed3de399e16ca294fd4478596845b444438968
parent 2abe788d8ab1426b03bdb1d27ca34c60b0a37769
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 16 Jun 2020 20:40:02 +0200
send param adapter is dead
Diffstat:
3 files changed, 0 insertions(+), 107 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
@@ -231,60 +231,6 @@ recv_param_adapter (struct MHD_Connection *connection,
/**
- * Callback for writing data to the socket.
- *
- * @param connection the MHD connection structure
- * @param other data to write
- * @param i number of bytes to write
- * @return positive value for number of bytes actually sent or
- * negative value for error number MHD_ERR_xxx_
- */
-static ssize_t
-send_param_adapter (struct MHD_Connection *connection,
- const void *other,
- size_t i)
-{
- ssize_t ret;
-
- if ( (MHD_INVALID_SOCKET == connection->socket_fd) ||
- (MHD_CONNECTION_CLOSED == connection->state) )
- {
- return MHD_ERR_NOTCONN_;
- }
- if (i > MHD_SCKT_SEND_MAX_SIZE_)
- i = MHD_SCKT_SEND_MAX_SIZE_; /* return value limit */
-
- ret = MHD_send_ (connection->socket_fd,
- other,
- i);
- if (0 > ret)
- {
- const int err = MHD_socket_get_error_ ();
-
- if (MHD_SCKT_ERR_IS_EAGAIN_ (err))
- {
-#ifdef EPOLL_SUPPORT
- /* EAGAIN --- no longer write-ready */
- connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
-#endif /* EPOLL_SUPPORT */
- return MHD_ERR_AGAIN_;
- }
- if (MHD_SCKT_ERR_IS_EINTR_ (err))
- return MHD_ERR_AGAIN_;
- if (MHD_SCKT_ERR_IS_ (err, MHD_SCKT_ECONNRESET_))
- return MHD_ERR_CONNRESET_;
- /* Treat any other error as hard error. */
- return MHD_ERR_NOTCONN_;
- }
-#ifdef EPOLL_SUPPORT
- else if (i > (size_t) ret)
- connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
-#endif /* EPOLL_SUPPORT */
- return ret;
-}
-
-
-/**
* Get all of the headers from the request.
*
* @param connection connection to get values from
@@ -3814,7 +3760,6 @@ void
MHD_set_http_callbacks_ (struct MHD_Connection *connection)
{
connection->recv_cls = &recv_param_adapter;
- connection->send_cls = &send_param_adapter;
}
diff --git a/src/microhttpd/connection_https.c b/src/microhttpd/connection_https.c
@@ -91,52 +91,6 @@ recv_tls_adapter (struct MHD_Connection *connection,
/**
- * Callback for writing data to the socket.
- *
- * @param connection the MHD connection structure
- * @param other data to write
- * @param i number of bytes to write
- * @return positive value for number of bytes actually sent or
- * negative value for error number MHD_ERR_xxx_
- */
-ssize_t
-send_tls_adapter (struct MHD_Connection *connection,
- const void *other,
- size_t i)
-{
- ssize_t res;
-
- if (i > SSIZE_MAX)
- i = SSIZE_MAX;
-
- res = gnutls_record_send (connection->tls_session,
- other,
- i);
- if ( (GNUTLS_E_AGAIN == res) ||
- (GNUTLS_E_INTERRUPTED == res) )
- {
-#ifdef EPOLL_SUPPORT
- if (GNUTLS_E_AGAIN == res)
- connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
-#endif
- return MHD_ERR_AGAIN_;
- }
- if (res < 0)
- {
- /* Likely 'GNUTLS_E_INVALID_SESSION' (client communication
- disrupted); interpret as a hard error */
- return MHD_ERR_NOTCONN_;
- }
-#ifdef EPOLL_SUPPORT
- /* Unlike non-TLS connections, do not reset "write-ready" if
- * sent amount smaller than provided amount, as TLS
- * connections may break data into smaller parts for sending. */
-#endif /* EPOLL_SUPPORT */
- return res;
-}
-
-
-/**
* Give gnuTLS chance to work on the TLS handshake.
*
* @param connection connection to handshake on
@@ -192,7 +146,6 @@ void
MHD_set_https_callbacks (struct MHD_Connection *connection)
{
connection->recv_cls = &recv_tls_adapter;
- connection->send_cls = &send_tls_adapter;
}
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
@@ -962,11 +962,6 @@ struct MHD_Connection
*/
ReceiveCallback recv_cls;
- /**
- * Function used for writing HTTP response stream.
- */
- TransmitCallback send_cls;
-
#ifdef UPGRADE_SUPPORT
/**
* If this connection was upgraded, this points to