summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2022-11-21 00:44:19 +0200
committerGitHub <noreply@github.com>2022-11-21 00:44:19 +0200
commit55c073c253ea57f43caec7779efc72f773c4560c (patch)
treecfd4cbd2a1fb80d0e14ce5444d1d3dfa8efe7ea5 /web
parent284f6f3aa4f36cefad2601c490510621496c2b53 (diff)
remove retries from SSL (#14026)
remove retries
Diffstat (limited to 'web')
-rw-r--r--web/server/web_client.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/web/server/web_client.c b/web/server/web_client.c
index b569360f48..4d6f20052a 100644
--- a/web/server/web_client.c
+++ b/web/server/web_client.c
@@ -1212,25 +1212,9 @@ static inline void web_client_send_http_header(struct web_client *w) {
ssize_t bytes;
#ifdef ENABLE_HTTPS
if ( (!web_client_check_unix(w)) && (netdata_ssl_srv_ctx) ) {
- if ( ( w->ssl.conn ) && ( !w->ssl.flags ) ){
- while((bytes = netdata_ssl_write(w->ssl.conn, buffer_tostring(w->response.header_output), buffer_strlen(w->response.header_output))) < 0) {
- count++;
- if(count > 100 || (errno != EAGAIN && errno != EWOULDBLOCK)) {
- error("Cannot send HTTPS headers to web client.");
- break;
- }
- }
- } else {
- while((bytes = send(w->ofd, buffer_tostring(w->response.header_output), buffer_strlen(w->response.header_output), 0)) == -1) {
- count++;
-
- if(count > 100 || (errno != EAGAIN && errno != EWOULDBLOCK)) {
- error("Cannot send HTTP headers to web client.");
- break;
- }
- }
- }
- } else {
+ if ( ( w->ssl.conn ) && ( w->ssl.flags == NETDATA_SSL_HANDSHAKE_COMPLETE ) )
+ bytes = netdata_ssl_write(w->ssl.conn, buffer_tostring(w->response.header_output), buffer_strlen(w->response.header_output));
+ else {
while((bytes = send(w->ofd, buffer_tostring(w->response.header_output), buffer_strlen(w->response.header_output), 0)) == -1) {
count++;
@@ -1239,6 +1223,17 @@ static inline void web_client_send_http_header(struct web_client *w) {
break;
}
}
+ }
+ }
+ else {
+ while((bytes = send(w->ofd, buffer_tostring(w->response.header_output), buffer_strlen(w->response.header_output), 0)) == -1) {
+ count++;
+
+ if(count > 100 || (errno != EAGAIN && errno != EWOULDBLOCK)) {
+ error("Cannot send HTTP headers to web client.");
+ break;
+ }
+ }
}
#else
while((bytes = send(w->ofd, buffer_tostring(w->response.header_output), buffer_strlen(w->response.header_output), 0)) == -1) {