Stratum: detect HTTP and send a response

This commit is contained in:
SChernykh
2024-08-08 18:14:43 +02:00
parent 8aad4a16b3
commit ad49afb34b
3 changed files with 33 additions and 3 deletions

View File

@@ -228,9 +228,6 @@ bool ServerTls::on_read_internal(char* data, uint32_t size, ReadCallback::Base&&
return false;
}
int bytes_read = 0;
char buf[1024];
if (!SSL_is_init_finished(ssl)) {
const int result = SSL_do_handshake(ssl);
@@ -274,6 +271,9 @@ bool ServerTls::on_read_internal(char* data, uint32_t size, ReadCallback::Base&&
}
}
int bytes_read;
char buf[1024];
while ((bytes_read = SSL_read(ssl, buf, sizeof(buf))) > 0) {
if (!read_callback(buf, static_cast<uint32_t>(bytes_read))) {
return false;