goto bad;
host = *(++argv);
}
-#if 0
- else if (strcmp(*argv, "-host") == 0) {
- if (--argc < 1)
- goto bad;
- host = *(++argv);
- } else if (strcmp(*argv, "-port") == 0) {
- if (--argc < 1)
- goto bad;
- port = *(++argv);
- }
-#endif
else if (strcmp(*argv, "-reuse") == 0)
perform = 2;
else if (strcmp(*argv, "-new") == 0)
if (--argc < 1)
goto bad;
maxTime = atoi(*(++argv));
+ if(maxTime <= 0) {
+ BIO_printf(bio_err, "time must be > 0\n");
+ badop = 1;
+ }
} else {
BIO_printf(bio_err, "unknown option %s\n", *argv);
badop = 1;
if (st_bugs)
SSL_CTX_set_options(tm_ctx, SSL_OP_ALL);
- SSL_CTX_set_cipher_list(tm_ctx, tm_cipher);
+ if(!SSL_CTX_set_cipher_list(tm_ctx, tm_cipher))
+ goto end;
if (!set_cert_stuff(tm_ctx, t_cert_file, t_key_file))
goto end;
if (s_www_path != NULL) {
BIO_snprintf(buf, sizeof buf, "GET %s HTTP/1.0\r\n\r\n",
s_www_path);
- SSL_write(scon, buf, strlen(buf));
+ if(SSL_write(scon, buf, strlen(buf)) <= 0)
+ goto end;
while ((i = SSL_read(scon, buf, sizeof(buf))) > 0)
bytes_read += i;
}
if (s_www_path != NULL) {
BIO_snprintf(buf, sizeof buf, "GET %s HTTP/1.0\r\n\r\n", s_www_path);
- SSL_write(scon, buf, strlen(buf));
+ if(SSL_write(scon, buf, strlen(buf)) <= 0)
+ goto end;
while (SSL_read(scon, buf, sizeof(buf)) > 0) ;
}
#ifdef NO_SHUTDOWN
if (s_www_path) {
BIO_snprintf(buf, sizeof buf, "GET %s HTTP/1.0\r\n\r\n",
s_www_path);
- SSL_write(scon, buf, strlen(buf));
+ if(SSL_write(scon, buf, strlen(buf)) <= 0)
+ goto end;
while ((i = SSL_read(scon, buf, sizeof(buf))) > 0)
bytes_read += i;
}
nConn, totalTime, ((double)nConn / totalTime), bytes_read);
printf
("%d connections in %ld real seconds, %ld bytes read per connection\n",
- nConn, (long)time(NULL) - finishtime + maxTime, bytes_read / nConn);
+ nConn, (long)time(NULL) - finishtime + maxTime,
+ bytes_read / (nConn?nConn:1));
ret = 0;
end:
SSL_set_bio(serverCon, conn, conn);
-#if 0
- if (scon != NULL)
- SSL_set_session(serverCon, SSL_get_session(scon));
-#endif
-
/* ok, lets connect */
for (;;) {
i = SSL_connect(serverCon);