Skip to content

Commit

Permalink
Fixes a couple of minor issues that have raised up during the tests.
Browse files Browse the repository at this point in the history
git-svn-id: svn://cherokee-project.com/benchmark@3507 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information
alobbs committed Aug 4, 2009
1 parent 3c2bbc0 commit 715e337
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ CFLAGS_ALL=\
$(CFLAGS) \ $(CFLAGS) \
`curl-config --cflags` \ `curl-config --cflags` \
`cherokee-config --cflags` \ `cherokee-config --cflags` \
-DCHEROKEE_COMPILATION -DCHEROKEE_COMPILATION \
-D_FILE_OFFSET_BITS=64


LIBS_ALL=\ LIBS_ALL=\
$(LIBS) \ $(LIBS) \
Expand Down
10 changes: 9 additions & 1 deletion main.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ print_update (void)
int reqs_sec = 0; int reqs_sec = 0;
int tx_sec = 0; int tx_sec = 0;


if ((request_done == 0) &&
(request_fails == 0)) {
return;
}

time_now = get_time_msecs(); time_now = get_time_msecs();
elapse = time_now - time_start; elapse = time_now - time_start;


Expand Down Expand Up @@ -207,6 +212,7 @@ thread_routine (void *me)
{ {
int re; int re;
long http_code; long http_code;
int is_error = 0;
cb_thread_t *thread = (cb_thread_t *)me; cb_thread_t *thread = (cb_thread_t *)me;
cb_url_t *url = (cb_url_t *)urls.next; cb_url_t *url = (cb_url_t *)urls.next;


Expand Down Expand Up @@ -239,11 +245,13 @@ thread_routine (void *me)
break; break;


case CURLE_COULDNT_RESOLVE_HOST: case CURLE_COULDNT_RESOLVE_HOST:
is_error = 1;
request_fails++; request_fails++;
report_fatal_error (curl_easy_strerror(re)); report_fatal_error (curl_easy_strerror(re));
break; break;


default: default:
is_error = 1;
request_fails++; request_fails++;
if (verbose) { if (verbose) {
report_error (curl_easy_strerror(re)); report_error (curl_easy_strerror(re));
Expand All @@ -252,7 +260,7 @@ thread_routine (void *me)


/* Prepare for the next request /* Prepare for the next request
*/ */
if (! keepalive) { if ((! keepalive) || (is_error)) {
curl_easy_cleanup (thread->curl); curl_easy_cleanup (thread->curl);
thread->curl = NULL; thread->curl = NULL;
} }
Expand Down

0 comments on commit 715e337

Please sign in to comment.