summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorStefan Fritsch <sf@sfritsch.de>2015-04-28 22:06:31 +0200
committerStefan Fritsch <sf@sfritsch.de>2015-04-28 22:06:31 +0200
commit080d5e16db802902200a9ce5b6c40f8f1fdc1f73 (patch)
tree69845ca856fe6817f103544e88541d80411fe9a8 /support
parentcb35beef2a938b80c9e4b5d6a408eca437aa74db (diff)
downloadapache2-080d5e16db802902200a9ce5b6c40f8f1fdc1f73.tar.gz
Imported Upstream version 2.4.12
Diffstat (limited to 'support')
-rw-r--r--support/ab.c14
-rw-r--r--support/htdigest.c2
-rw-r--r--support/split-logfile.in9
3 files changed, 13 insertions, 12 deletions
diff --git a/support/ab.c b/support/ab.c
index 2bb7eef3..b26f0acf 100644
--- a/support/ab.c
+++ b/support/ab.c
@@ -220,7 +220,7 @@ typedef enum {
STATE_READ
} connect_state_e;
-#define CBUFFSIZE (2048)
+#define CBUFFSIZE (8192)
struct connection {
apr_pool_t *ctx;
@@ -340,7 +340,7 @@ BIO *bio_out,*bio_err;
apr_time_t start, lasttime, stoptime;
/* global request (and its length) */
-char _request[2048];
+char _request[8192];
char *request = _request;
apr_size_t reqlen;
@@ -1515,12 +1515,14 @@ static void read_connection(struct connection * c)
* this is first time, extract some interesting info
*/
char *p, *q;
+ size_t len = 0;
p = strstr(c->cbuff, "Server:");
q = servername;
if (p) {
p += 8;
- while (*p > 32)
- *q++ = *p++;
+ /* -1 to not overwrite last '\0' byte */
+ while (*p > 32 && len++ < sizeof(servername) - 1)
+ *q++ = *p++;
}
*q = 0;
}
@@ -1888,14 +1890,14 @@ static void test(void)
static void copyright(void)
{
if (!use_html) {
- printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1604373 $>");
+ printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1638069 $>");
printf("Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
printf("Licensed to The Apache Software Foundation, http://www.apache.org/\n");
printf("\n");
}
else {
printf("<p>\n");
- printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i><br>\n", AP_AB_BASEREVISION, "$Revision: 1604373 $");
+ printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i><br>\n", AP_AB_BASEREVISION, "$Revision: 1638069 $");
printf(" Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
printf(" Licensed to The Apache Software Foundation, http://www.apache.org/<br>\n");
printf("</p>\n<p>\n");
diff --git a/support/htdigest.c b/support/htdigest.c
index f76036d7..972fa82d 100644
--- a/support/htdigest.c
+++ b/support/htdigest.c
@@ -92,7 +92,7 @@ static void getword(char *word, char *line, char stop)
static int get_line(char *s, int n, apr_file_t *f)
{
- register int i = 0;
+ int i = 0;
char ch;
apr_status_t rv = APR_EINVAL;
diff --git a/support/split-logfile.in b/support/split-logfile.in
index 59eda713..e5abfc7d 100644
--- a/support/split-logfile.in
+++ b/support/split-logfile.in
@@ -29,7 +29,7 @@
use strict;
use warnings;
-my %is_open = ();
+my %log_file = ();
while (my $log_line = <STDIN>) {
#
@@ -54,10 +54,9 @@ while (my $log_line = <STDIN>) {
# If the log file for this virtual host isn't opened
# yet, do it now.
#
- if (! $is_open{$vhost}) {
- open $vhost, ">>${vhost}.log"
+ if (! $log_file{$vhost}) {
+ open $log_file{$vhost}, ">>${vhost}.log"
or die ("Can't open ${vhost}.log");
- $is_open{$vhost} = 1;
}
#
# Strip off the first token (which may be null in the
@@ -65,6 +64,6 @@ while (my $log_line = <STDIN>) {
# record to the current log file.
#
$log_line =~ s/^\S*\s+//;
- printf $vhost "%s", $log_line;
+ print {$log_file{$vhost}} $log_line;
}
exit 0;