fixup! start refactoring isc_nm_httprequest() into read/send

This commit is contained in:
Evan Hunt
2021-02-08 12:43:21 -08:00
parent 01fce69199
commit bf9796140e
4 changed files with 11 additions and 13 deletions

View File

@@ -17,7 +17,7 @@
#include <isc/types.h>
typedef struct ssl_ctx_st isc_tlsctx_t;
typedef struct ssl_st isc_tls_t;
typedef struct ssl_st isc_tls_t;
void
isc_tls_initialize(void);

View File

@@ -1061,13 +1061,8 @@ server_on_begin_headers_callback(nghttp2_session *ngsession,
isc__nmsocket_init(socket, session->serversocket->mgr,
isc_nm_httpsocket, (isc_nmiface_t *)&iface);
socket->h2 = (isc_nmsocket_h2_t){
.bufpos = 0,
.bufsize = 0,
.buf = isc_mem_allocate(session->mctx, MAX_DNS_MESSAGE_SIZE),
.psock = socket,
.handler = NULL,
.request_path = NULL,
.query_data = NULL,
.stream_id = frame->hd.stream_id,
.session = session
};
@@ -2210,9 +2205,10 @@ void
isc__nm_http_initsocket(isc_nmsocket_t *sock) {
REQUIRE(sock != NULL);
memset(&sock->h2, 0, sizeof(sock->h2));
sock->h2.request_type = ISC_HTTP_REQ_UNSUPPORTED;
sock->h2.request_scheme = ISC_HTTP_SCHEME_UNSUPPORTED;
sock->h2 = (isc_nmsocket_h2_t){
.request_type = ISC_HTTP_REQ_UNSUPPORTED,
.request_scheme = ISC_HTTP_SCHEME_UNSUPPORTED,
};
if (sock->type == isc_nm_httplistener) {
ISC_LIST_INIT(sock->h2.handlers);

View File

@@ -245,7 +245,7 @@ tls_do_bio(isc_nmsocket_t *sock) {
/* Data from TLS to network */
pending = BIO_pending(sock->tlsstream.app_bio);
if (pending > 0) {
/*TODO Should we keep the track of these requests in a list? */
/* TODO Should we keep track of these requests in a list? */
isc_nmsocket_tls_send_req_t *send_req = NULL;
if (pending > TLS_BUF_SIZE) {
pending = TLS_BUF_SIZE;
@@ -891,8 +891,11 @@ isc__nm_async_tlsconnect(isc__networker_t *worker, isc__netievent_t *ev0) {
tlssock->timer_initialized = true;
tlssock->tlsstream.state = TLS_INIT;
/* We ignore the error code because even in the case of failure callback
* gets called and the error code gets passed to it. */
/*
* We ignore the return code, because even in the case of
* failure, the callback will be called and the error code
* passed to it.
*/
(void)isc_nm_tcpconnect(worker->mgr, (isc_nmiface_t *)&ievent->local,
(isc_nmiface_t *)&ievent->peer, tls_connect_cb,
tlssock, tlssock->connect_timeout, 0);

View File

@@ -337,7 +337,6 @@ isc_tlsctx_enable_http2client_alpn(isc_tlsctx_t *ctx) {
SSL_CTX_set_alpn_protos(ctx, (const unsigned char *)NGHTTP2_PROTO_ALPN,
NGHTTP2_PROTO_ALPN_LEN);
#endif /* OPENSSL_VERSION_NUMBER >= 0x10002000L */
}
#ifndef OPENSSL_NO_NEXTPROTONEG