finishtime=time(NULL)+maxTime;
finishtime=(long)time(NULL)+maxTime;
int MAIN(int argc, char **argv)	{	double totalTime = 0.0;	int nConn = 0;	SSL *scon=NULL;	long finishtime=0;	int ret=1,i;	MS_STATIC char buf[1024*8];	int ver;	apps_startup();	s_time_init();	if (bio_err == NULL)		bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)	s_time_meth=SSLv23_client_method();#elif !defined(OPENSSL_NO_SSL3)	s_time_meth=SSLv3_client_method();#elif !defined(OPENSSL_NO_SSL2)	s_time_meth=SSLv2_client_method();#endif	/* parse the command line arguments */	if( parseArgs( argc, argv ) < 0 )		goto end;	OpenSSL_add_ssl_algorithms();	if ((tm_ctx=SSL_CTX_new(s_time_meth)) == NULL) return(1);	SSL_CTX_set_quiet_shutdown(tm_ctx,1);	if (st_bugs) SSL_CTX_set_options(tm_ctx,SSL_OP_ALL);	SSL_CTX_set_cipher_list(tm_ctx,tm_cipher);	if(!set_cert_stuff(tm_ctx,t_cert_file,t_key_file)) 		goto end;	SSL_load_error_strings();	if ((!SSL_CTX_load_verify_locations(tm_ctx,CAfile,CApath)) ||		(!SSL_CTX_set_default_verify_paths(tm_ctx)))		{		/* BIO_printf(bio_err,"error setting default verify locations\n"); */		ERR_print_errors(bio_err);		/* goto end; */		}	if (tm_cipher == NULL)		tm_cipher = getenv("SSL_CIPHER");	if (tm_cipher == NULL ) {		fprintf( stderr, "No CIPHER specified\n" );	}	if (!(perform & 1)) goto next;	printf( "Collecting connection statistics for %d seconds\n", maxTime );	/* Loop and time how long it takes to make connections */	bytes_read=0;	finishtime=(long)time(NULL)+maxTime;	tm_Time_F(START);	for (;;)		{		if (finishtime < time(NULL)) break;#ifdef WIN32_STUFF		if( flushWinMsgs(0) == -1 )			goto end;		if( waitingToDie || exitNow )		/* we're dead */			goto end;#endif		if( (scon = doConnection( NULL )) == NULL )			goto end;		if (s_www_path != NULL)			{			sprintf(buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);			SSL_write(scon,buf,strlen(buf));			while ((i=SSL_read(scon,buf,sizeof(buf))) > 0)				bytes_read+=i;			}#ifdef NO_SHUTDOWN		SSL_set_shutdown(scon,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);#else		SSL_shutdown(scon);#endif		SHUTDOWN2(SSL_get_fd(scon));		nConn += 1;		if (SSL_session_reused(scon))			ver='r';		else			{			ver=SSL_version(scon);			if (ver == TLS1_VERSION)				ver='t';			else if (ver == SSL3_VERSION)				ver='3';			else if (ver == SSL2_VERSION)				ver='2';			else				ver='*';			}		fputc(ver,stdout);		fflush(stdout);		SSL_free( scon );		scon=NULL;		}	totalTime += tm_Time_F(STOP); /* Add the time for this iteration */	i=(int)(time(NULL)-finishtime+maxTime);	printf( "\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", nConn, totalTime, ((double)nConn/totalTime),bytes_read);	printf( "%d connections in %ld real seconds, %ld bytes read per connection\n",nConn,time(NULL)-finishtime+maxTime,bytes_read/nConn);	/* Now loop and time connections using the same session id over and over */next:	if (!(perform & 2)) goto end;	printf( "\n\nNow timing with session id reuse.\n" );	/* Get an SSL object so we can reuse the session id */	if( (scon = doConnection( NULL )) == NULL )		{		fprintf( stderr, "Unable to get connection\n" );		goto end;		}	if (s_www_path != NULL)		{		sprintf(buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);		SSL_write(scon,buf,strlen(buf));		while (SSL_read(scon,buf,sizeof(buf)) > 0)			;		}#ifdef NO_SHUTDOWN	SSL_set_shutdown(scon,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);#else	SSL_shutdown(scon);#endif	SHUTDOWN2(SSL_get_fd(scon));	nConn = 0;	totalTime = 0.0;	finishtime=time(NULL)+maxTime;	printf( "starting\n" );	bytes_read=0;	tm_Time_F(START);			for (;;)		{		if (finishtime < time(NULL)) break;#ifdef WIN32_STUFF		if( flushWinMsgs(0) == -1 )			goto end;		if( waitingToDie || exitNow )	/* we're dead */			goto end;#endif	 	if( (doConnection( scon )) == NULL )			goto end;		if (s_www_path)			{			sprintf(buf,"GET %s HTTP/1.0\r\n\r\n",s_www_path);			SSL_write(scon,buf,strlen(buf));			while ((i=SSL_read(scon,buf,sizeof(buf))) > 0)				bytes_read+=i;			}#ifdef NO_SHUTDOWN		SSL_set_shutdown(scon,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);#else		SSL_shutdown(scon);#endif		SHUTDOWN2(SSL_get_fd(scon));			nConn += 1;		if (SSL_session_reused(scon))			ver='r';		else			{			ver=SSL_version(scon);			if (ver == TLS1_VERSION)				ver='t';			else if (ver == SSL3_VERSION)				ver='3';			else if (ver == SSL2_VERSION)				ver='2';			else				ver='*';			}		fputc(ver,stdout);		fflush(stdout);		}	totalTime += tm_Time_F(STOP); /* Add the time for this iteration*/	printf( "\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", nConn, totalTime, ((double)nConn/totalTime),bytes_read);	printf( "%d connections in %ld real seconds, %ld bytes read per connection\n",nConn,time(NULL)-finishtime+maxTime,bytes_read/nConn);	ret=0;end:	if (scon != NULL) SSL_free(scon);	if (tm_ctx != NULL)		{		SSL_CTX_free(tm_ctx);		tm_ctx=NULL;		}	apps_shutdown();	EXIT(ret);	}