Open weeweetan opened 2 weeks ago
@weeweetan I meet the problem too. ngx_ssl_shutdown
lead to single cpu core high usage.Is it the same?
@mcdullbloom yes, same problem, so I need the developer to confirm why these lines are added
how to reproduce?
@mcdullbloom after receiving the response, client calls the sleep function to block
I don't get it.What does the client should do after receive the response? Can you give more details?
ssl = SSL_new(ctx);
SSL_set_fd(ssl, sock);
if (SSL_connect(ssl) <= 0) {
ERR_print_errors_fp(stderr);
} else {
printf("Connected with %s encryption\n", SSL_get_cipher(ssl));
SSL_write(ssl, "GET /HTTP/1.1\r\nHost: " HOSTNAME "\r\nConnection: close\r\n\r\n", strlen("GET / HTTP/1.1\r\nHost: " HOSTNAME "\r\nConnection: close\r\n\r\n"));
char buffer[BUFFER_SIZE];
int bytes;
while ((bytes = SSL_read(ssl, buffer, sizeof(buffer))) > 0) {
buffer[bytes] = 0;
printf("%s", buffer);
}
}
sleep(10000);
SSL_free(ssl);
close(sock);
implement a simple client like this
https://github.com/intel/asynch_mode_nginx/blob/4023ec58d430dd6912c7ac4b54d0b74d5bb59ed6/src/event/ngx_event_openssl.c#L3662, What scenario is this solving? In the stream tls scenario, after nginx calls ssl_shutdown, the client does not respond, which will cause nginx cpu 100%