summaryrefslogtreecommitdiffstats
path: root/src/shrpx_http_downstream_connection.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/shrpx_http_downstream_connection.cc')
-rw-r--r--src/shrpx_http_downstream_connection.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/shrpx_http_downstream_connection.cc b/src/shrpx_http_downstream_connection.cc
index 4164b8b..8031098 100644
--- a/src/shrpx_http_downstream_connection.cc
+++ b/src/shrpx_http_downstream_connection.cc
@@ -425,8 +425,8 @@ int HttpDownstreamConnection::initiate_connection() {
auto sni_name =
addr_->sni.empty() ? StringRef{addr_->host} : StringRef{addr_->sni};
- if (!util::numeric_host(sni_name.c_str())) {
- SSL_set_tlsext_host_name(conn_.tls.ssl, sni_name.c_str());
+ if (!util::numeric_host(sni_name.data())) {
+ SSL_set_tlsext_host_name(conn_.tls.ssl, sni_name.data());
}
auto session = tls::reuse_tls_session(addr_->tls_session_cache);
@@ -564,9 +564,10 @@ int HttpDownstreamConnection::push_request_headers() {
return -1;
}
auto iov = make_byte_ref(balloc, base64::encode_length(nonce.size()) + 1);
- auto p = base64::encode(std::begin(nonce), std::end(nonce), iov.base);
+ auto p =
+ base64::encode(std::begin(nonce), std::end(nonce), std::begin(iov));
*p = '\0';
- auto key = StringRef{iov.base, p};
+ auto key = StringRef{std::span{std::begin(iov), p}};
downstream_->set_ws_key(key);
buf->append("Sec-Websocket-Key: ");