ports/benchmarks/httperf/files/patch-src_core.c
Alexey Dokuchaev 9a71a9819f - Update to the latest GitHub commit: current version is from 2015
and is not compatible with modern OpenSSL implementations
- Set PORTVERSION to the version number as reported by `httperf -V'
- Increase buffer size in do_recv() to match TLS record size which
  can be up to 16kB [1]
- When using TLS 1.1 or TLS 1.2, the first SSL_connect() may often
  return error, while subsequent requests work fine -- to mitigate
  this, try to SSL_connect() a little harder [2]

Approved by:	maintainer timeout

PR:	230680 [1], 230681 [2]
2019-12-07 11:39:35 +00:00

30 lines
793 B
C

--- src/core.c.orig 2019-08-29 17:26:06 UTC
+++ src/core.c
@@ -651,7 +651,7 @@ recv_done(Call * call)
static void
do_recv(Conn * s)
{
- char *cp, buf[8193];
+ char *cp, buf[16385];
Call *c = s->recvq;
int i, saved_errno;
ssize_t nread = 0;
@@ -1062,8 +1062,7 @@ core_ssl_connect(Conn * s)
exit(-1);
}
- ssl_err = SSL_connect(s->ssl);
- if (ssl_err < 0) {
+ while ((ssl_err = SSL_connect(s->ssl)) < 0) {
int reason = SSL_get_error(s->ssl, ssl_err);
if (reason == SSL_ERROR_WANT_READ
@@ -1083,7 +1082,7 @@ core_ssl_connect(Conn * s)
clear_active(s, READ);
set_active(s, WRITE);
}
- return;
+ continue;
}
fprintf(stderr,
"%s: failed to connect to SSL server (err=%d, reason=%d)\n",