You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2005/11/10 16:22:44 UTC
svn commit: r332309 [12/13] - in /httpd/httpd/branches/2.2.x: modules/aaa/
modules/arch/netware/ modules/arch/win32/ modules/cache/ modules/dav/fs/
modules/dav/lock/ modules/dav/main/ modules/debug/ modules/echo/
modules/experimental/ modules/filters/ ...
Modified: httpd/httpd/branches/2.2.x/support/ab.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/support/ab.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/support/ab.c (original)
+++ httpd/httpd/branches/2.2.x/support/ab.c Thu Nov 10 07:20:05 2005
@@ -83,15 +83,15 @@
**/
/* Note: this version string should start with \d+[\d\.]* and be a valid
- * string for an HTTP Agent: header when prefixed with 'ApacheBench/'.
- * It should reflect the version of AB - and not that of the apache server
- * it happens to accompany. And it should be updated or changed whenever
- * the results are no longer fundamentally comparable to the results of
+ * string for an HTTP Agent: header when prefixed with 'ApacheBench/'.
+ * It should reflect the version of AB - and not that of the apache server
+ * it happens to accompany. And it should be updated or changed whenever
+ * the results are no longer fundamentally comparable to the results of
* a previous version of ab. Either due to a change in the logic of
- * ab - or to due to a change in the distribution it is compiled with
+ * ab - or to due to a change in the distribution it is compiled with
* (such as an APR change in for example blocking).
*/
-#define AP_AB_BASEREVISION "2.0.40-dev"
+#define AP_AB_BASEREVISION "2.0.40-dev"
/*
* BUGS:
@@ -469,14 +469,14 @@
{
SSL_CIPHER *c;
int alg_bits,bits;
-
+
c = SSL_get_current_cipher(ssl);
BIO_printf(bio,"Cipher Suite Protocol :%s\n", SSL_CIPHER_get_version(c));
BIO_printf(bio,"Cipher Suite Name :%s\n",SSL_CIPHER_get_name(c));
-
+
bits = SSL_CIPHER_get_bits(c,&alg_bits);
BIO_printf(bio,"Cipher Suite Cipher Bits:%d (%d)\n",bits,alg_bits);
-
+
return(1);
}
@@ -556,7 +556,7 @@
SSL_CIPHER *ci;
X509 *cert;
int sk_bits, pk_bits, swork;
-
+
ci = SSL_get_current_cipher(c->ssl);
sk_bits = SSL_CIPHER_get_bits(ci, &swork);
cert = SSL_get_peer_certificate(c->ssl);
@@ -564,7 +564,7 @@
pk_bits = EVP_PKEY_bits(X509_get_pubkey(cert));
else
pk_bits = 0; /* Anon DH */
-
+
ssl_info = malloc(128);
apr_snprintf(ssl_info, 128, "%s,%s,%d,%d",
SSL_CIPHER_get_version(ci),
@@ -607,7 +607,7 @@
apr_time_t tnow = apr_time_now();
apr_size_t l = c->rwrite;
apr_status_t e = APR_SUCCESS; /* prevent gcc warning */
-
+
/*
* First time round ?
*/
@@ -624,7 +624,7 @@
close_connection(c);
return;
}
-
+
#ifdef USE_SSL
if (c->ssl) {
apr_size_t e_ssl;
@@ -647,7 +647,7 @@
*/
if (l == c->rwrite)
break;
-
+
if (e != APR_SUCCESS) {
/*
* Let's hope this traps EWOULDBLOCK too !
@@ -727,7 +727,7 @@
timetakenusec = endtime - start;
timetaken = ((float)apr_time_sec(timetakenusec)) +
((float)apr_time_usec(timetakenusec)) / 1000000.0F;
-
+
printf("\n\n");
printf("Server Software: %s\n", servername);
printf("Server Hostname: %s\n", hostname);
@@ -762,9 +762,9 @@
/* avoid divide by zero */
if (timetaken) {
- printf("Requests per second: %.2f [#/sec] (mean)\n",
+ printf("Requests per second: %.2f [#/sec] (mean)\n",
(float) (done / timetaken));
- printf("Time per request: %.3f [ms] (mean)\n",
+ printf("Time per request: %.3f [ms] (mean)\n",
(float) (1000 * concurrency * timetaken / done));
printf("Time per request: %.3f [ms] (mean, across all concurrent requests)\n",
(float) (1000 * timetaken / done));
@@ -783,7 +783,7 @@
long i;
apr_time_t totalcon = 0, total = 0, totald = 0, totalwait = 0;
apr_time_t meancon, meantot, meand, meanwait;
- apr_interval_time_t mincon = AB_MAX, mintot = AB_MAX, mind = AB_MAX,
+ apr_interval_time_t mincon = AB_MAX, mintot = AB_MAX, mind = AB_MAX,
minwait = AB_MAX;
apr_interval_time_t maxcon = 0, maxtot = 0, maxd = 0, maxwait = 0;
apr_interval_time_t mediancon = 0, mediantot = 0, mediand = 0, medianwait = 0;
@@ -795,12 +795,12 @@
mintot = ap_min(mintot, s.time);
mind = ap_min(mind, s.time - s.ctime);
minwait = ap_min(minwait, s.waittime);
-
+
maxcon = ap_max(maxcon, s.ctime);
maxtot = ap_max(maxtot, s.time);
maxd = ap_max(maxd, s.time - s.ctime);
maxwait = ap_max(maxwait, s.waittime);
-
+
totalcon += s.ctime;
total += s.time;
totald += s.time - s.ctime;
@@ -829,7 +829,7 @@
sdcon = (requests > 1) ? sqrt(sdcon / (requests - 1)) : 0;
sdd = (requests > 1) ? sqrt(sdd / (requests - 1)) : 0;
sdwait = (requests > 1) ? sqrt(sdwait / (requests - 1)) : 0;
-
+
if (gnuplot) {
FILE *out = fopen(gnuplot, "w");
long i;
@@ -866,7 +866,7 @@
mediancon = (stats[requests / 2].ctime + stats[requests / 2 + 1].ctime) / 2;
else
mediancon = stats[requests / 2].ctime;
-
+
qsort(stats, requests, sizeof(struct data),
(int (*) (const void *, const void *)) compri);
if ((requests > 1) && (requests % 2))
@@ -874,27 +874,27 @@
-stats[requests / 2].ctime - stats[requests / 2 + 1].ctime) / 2;
else
mediand = stats[requests / 2].time - stats[requests / 2].ctime;
-
+
qsort(stats, requests, sizeof(struct data),
(int (*) (const void *, const void *)) compwait);
if ((requests > 1) && (requests % 2))
medianwait = (stats[requests / 2].waittime + stats[requests / 2 + 1].waittime) / 2;
else
medianwait = stats[requests / 2].waittime;
-
+
qsort(stats, requests, sizeof(struct data),
(int (*) (const void *, const void *)) comprando);
if ((requests > 1) && (requests % 2))
mediantot = (stats[requests / 2].time + stats[requests / 2 + 1].time) / 2;
else
mediantot = stats[requests / 2].time;
-
+
printf("\nConnection Times (ms)\n");
if (confidence) {
#define CONF_FMT_STRING "%5" APR_TIME_T_FMT " %4d %5.1f %6" APR_TIME_T_FMT " %7" APR_TIME_T_FMT "\n"
printf(" min mean[+/-sd] median max\n");
- printf("Connect: " CONF_FMT_STRING,
+ printf("Connect: " CONF_FMT_STRING,
mincon, (int) (meancon + 0.5), sdcon, mediancon, maxcon);
printf("Processing: " CONF_FMT_STRING,
mind, (int) (meand + 0.5), sdd, mediand, maxd);
@@ -923,11 +923,11 @@
else {
printf(" min avg max\n");
#define CONF_FMT_STRING "%5" APR_TIME_T_FMT " %5" APR_TIME_T_FMT "%5" APR_TIME_T_FMT "\n"
- printf("Connect: " CONF_FMT_STRING,
+ printf("Connect: " CONF_FMT_STRING,
mincon, meancon, maxcon);
- printf("Processing: " CONF_FMT_STRING,
+ printf("Processing: " CONF_FMT_STRING,
mintot - mincon, meantot - meancon, maxtot - maxcon);
- printf("Total: " CONF_FMT_STRING,
+ printf("Total: " CONF_FMT_STRING,
mintot, meantot, maxtot);
#undef CONF_FMT_STRING
}
@@ -943,7 +943,7 @@
printf(" 100%% %5" APR_TIME_T_FMT " (longest request)\n",
stats[requests - 1].time);
else
- printf(" %d%% %5" APR_TIME_T_FMT "\n", percs[i],
+ printf(" %d%% %5" APR_TIME_T_FMT "\n", percs[i],
stats[(int) (requests * percs[i] / 100)].time);
}
}
@@ -1051,14 +1051,14 @@
trstring, tdstring, tdstring,
(float) (totalread + totalposted) / timetaken);
}
- }
+ }
{
/* work out connection times */
long i;
apr_interval_time_t totalcon = 0, total = 0;
apr_interval_time_t mincon = AB_MAX, mintot = AB_MAX;
apr_interval_time_t maxcon = 0, maxtot = 0;
-
+
for (i = 0; i < requests; i++) {
struct data s = stats[i];
mincon = ap_min(mincon, s.ctime);
@@ -1068,7 +1068,7 @@
totalcon += s.ctime;
total += s.time;
}
-
+
if (requests > 0) { /* avoid division by zero (if 0 requests) */
printf("<tr %s><th %s colspan=4>Connnection Times (ms)</th></tr>\n",
trstring, tdstring);
@@ -1268,12 +1268,12 @@
status = SSL_read(c->ssl, buffer, r);
if (status <= 0) {
int scode = SSL_get_error(c->ssl, status);
-
+
if (scode == SSL_ERROR_ZERO_RETURN) {
/* connection closed cleanly: */
good++;
close_connection(c);
- }
+ }
else if (scode != SSL_ERROR_WANT_WRITE
&& scode != SSL_ERROR_WANT_READ) {
/* some fatal error: */
@@ -1286,7 +1286,7 @@
}
r = status;
}
- else
+ else
#endif
{
status = apr_socket_recv(c->aprsock, buffer, &r);
@@ -1320,7 +1320,7 @@
int tocopy = (space < r) ? space : r;
#ifdef NOT_ASCII
apr_size_t inbytes_left = space, outbytes_left = space;
-
+
status = apr_xlate_conv_buffer(from_ascii, buffer, &inbytes_left,
c->cbuff + c->cbx, &outbytes_left);
if (status || inbytes_left || outbytes_left) {
@@ -1388,7 +1388,7 @@
* needs to be extended to handle whatever servers folks want to
* test against. -djg
*/
-
+
/* check response code */
part = strstr(c->cbuff, "HTTP"); /* really HTTP/1.x_ */
if (part && strlen(part) > strlen("HTTP/1.x_")) {
@@ -1398,7 +1398,7 @@
else {
strcpy(respcode, "500");
}
-
+
if (respcode[0] != '2') {
err_response++;
if (verbosity >= 2)
@@ -1505,7 +1505,7 @@
now = apr_time_now();
con = calloc(concurrency, sizeof(struct connection));
-
+
stats = calloc(requests, sizeof(struct data));
if ((status = apr_pollset_create(&readbits, concurrency, cntxt, 0)) != APR_SUCCESS) {
@@ -1514,7 +1514,7 @@
/* setup request */
if (posting <= 0) {
- snprintf_res = apr_snprintf(request, sizeof(_request),
+ snprintf_res = apr_snprintf(request, sizeof(_request),
"%s %s HTTP/1.0\r\n"
"User-Agent: ApacheBench/%s\r\n"
"%s" "%s" "%s"
@@ -1601,7 +1601,7 @@
apr_int32_t n;
apr_int32_t timed;
const apr_pollfd_t *pollresults;
-
+
/* check for time limit expiry */
now = apr_time_now();
timed = (apr_int32_t)apr_time_sec(now - start);
@@ -1609,20 +1609,20 @@
requests = done; /* so stats are correct */
break; /* no need to do another round */
}
-
+
n = concurrency;
status = apr_pollset_poll(readbits, aprtimeout, &n, &pollresults);
if (status != APR_SUCCESS)
apr_err("apr_poll", status);
-
+
if (!n) {
err("\nServer timed out\n\n");
}
-
+
for (i = 0; i < n; i++) {
const apr_pollfd_t *next_fd = &(pollresults[i]);
struct connection *c;
-
+
c = next_fd->client_data;
/*
@@ -1630,7 +1630,7 @@
*/
if (c->state == STATE_UNCONNECTED)
continue;
-
+
rv = next_fd->rtnevents;
#ifdef USE_SSL
@@ -1694,7 +1694,7 @@
write_request(c);
}
}
-
+
/*
* When using a select based poll every time we check the bits
* are reset. In 1.3's ab we copied the FD_SET's each time
@@ -2014,7 +2014,7 @@
}
l = apr_base64_encode(tmp, optarg, strlen(optarg));
tmp[l] = '\0';
-
+
auth = apr_pstrcat(cntxt, auth, "Authorization: Basic ", tmp,
"\r\n", NULL);
break;
@@ -2029,7 +2029,7 @@
}
l = apr_base64_encode(tmp, optarg, strlen(optarg));
tmp[l] = '\0';
-
+
auth = apr_pstrcat(cntxt, auth, "Proxy-Authorization: Basic ",
tmp, "\r\n", NULL);
break;
Modified: httpd/httpd/branches/2.2.x/support/htcacheclean.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/support/htcacheclean.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/support/htcacheclean.c (original)
+++ httpd/httpd/branches/2.2.x/support/htcacheclean.c Thu Nov 10 07:20:05 2005
@@ -450,10 +450,10 @@
case HEADERDATA:
nextpath = apr_pstrcat(p, path, "/", d->basename,
CACHE_HEADER_SUFFIX, NULL);
- if (apr_file_open(&fd, nextpath, APR_FOPEN_READ | APR_FOPEN_BINARY,
+ if (apr_file_open(&fd, nextpath, APR_FOPEN_READ | APR_FOPEN_BINARY,
APR_OS_DEFAULT, p) == APR_SUCCESS) {
len = sizeof(format);
- if (apr_file_read_full(fd, &format, len,
+ if (apr_file_read_full(fd, &format, len,
&len) == APR_SUCCESS) {
if (format == DISK_FORMAT_VERSION) {
apr_off_t offset = 0;
@@ -483,11 +483,11 @@
}
}
else if (format == VARY_FORMAT_VERSION) {
- /* This must be a URL that added Vary headers later,
+ /* This must be a URL that added Vary headers later,
* so kill the orphaned .data file
*/
apr_file_close(fd);
- apr_file_remove(apr_pstrcat(p, path, "/", d->basename,
+ apr_file_remove(apr_pstrcat(p, path, "/", d->basename,
CACHE_DATA_SUFFIX, NULL),
p);
}
@@ -523,10 +523,10 @@
current = apr_time_now();
nextpath = apr_pstrcat(p, path, "/", d->basename,
CACHE_HEADER_SUFFIX, NULL);
- if (apr_file_open(&fd, nextpath, APR_FOPEN_READ | APR_FOPEN_BINARY,
+ if (apr_file_open(&fd, nextpath, APR_FOPEN_READ | APR_FOPEN_BINARY,
APR_OS_DEFAULT, p) == APR_SUCCESS) {
len = sizeof(format);
- if (apr_file_read_full(fd, &format, len,
+ if (apr_file_read_full(fd, &format, len,
&len) == APR_SUCCESS) {
if (format == VARY_FORMAT_VERSION) {
apr_time_t expires;
@@ -824,7 +824,7 @@
}
benice = 1;
break;
-
+
case 't':
if (deldirs) {
usage();
Modified: httpd/httpd/branches/2.2.x/support/htdbm.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/support/htdbm.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/support/htdbm.c (original)
+++ httpd/httpd/branches/2.2.x/support/htdbm.c Thu Nov 10 07:20:05 2005
@@ -65,7 +65,7 @@
#define ALG_PLAIN 0
#define ALG_APMD5 1
#define ALG_APSHA 2
-
+
#if APR_HAVE_CRYPT_H
#define ALG_CRYPT 3
#endif
@@ -114,7 +114,7 @@
#endif
}
-static void htdbm_terminate(htdbm_t *htdbm)
+static void htdbm_terminate(htdbm_t *htdbm)
{
if (htdbm->dbm)
apr_dbm_close(htdbm->dbm);
@@ -122,15 +122,15 @@
}
static htdbm_t *h;
-
-static void htdbm_interrupted(void)
+
+static void htdbm_interrupted(void)
{
htdbm_terminate(h);
fprintf(stderr, "htdbm Interrupted !\n");
exit(ERR_INTERRUPTED);
}
-static apr_status_t htdbm_init(apr_pool_t **pool, htdbm_t **hdbm)
+static apr_status_t htdbm_init(apr_pool_t **pool, htdbm_t **hdbm)
{
#if APR_CHARSET_EBCDIC
@@ -167,18 +167,18 @@
return APR_SUCCESS;
}
-static apr_status_t htdbm_open(htdbm_t *htdbm)
+static apr_status_t htdbm_open(htdbm_t *htdbm)
{
if (htdbm->create)
- return apr_dbm_open_ex(&htdbm->dbm, htdbm->type, htdbm->filename, APR_DBM_RWCREATE,
+ return apr_dbm_open_ex(&htdbm->dbm, htdbm->type, htdbm->filename, APR_DBM_RWCREATE,
APR_OS_DEFAULT, htdbm->pool);
else
- return apr_dbm_open_ex(&htdbm->dbm, htdbm->type, htdbm->filename,
- htdbm->rdonly ? APR_DBM_READONLY : APR_DBM_READWRITE,
+ return apr_dbm_open_ex(&htdbm->dbm, htdbm->type, htdbm->filename,
+ htdbm->rdonly ? APR_DBM_READONLY : APR_DBM_READWRITE,
APR_OS_DEFAULT, htdbm->pool);
}
-static apr_status_t htdbm_save(htdbm_t *htdbm, int *changed)
+static apr_status_t htdbm_save(htdbm_t *htdbm, int *changed)
{
apr_datum_t key, val;
@@ -201,7 +201,7 @@
return apr_dbm_store(htdbm->dbm, key, val);
}
-static apr_status_t htdbm_del(htdbm_t *htdbm)
+static apr_status_t htdbm_del(htdbm_t *htdbm)
{
apr_datum_t key;
@@ -213,7 +213,7 @@
return apr_dbm_delete(htdbm->dbm, key);
}
-static apr_status_t htdbm_verify(htdbm_t *htdbm)
+static apr_status_t htdbm_verify(htdbm_t *htdbm)
{
apr_datum_t key, val;
char pwd[MAX_STRING_LEN] = {0};
@@ -222,7 +222,7 @@
key.dptr = htdbm->username;
key.dsize = strlen(htdbm->username);
if (!apr_dbm_exists(htdbm->dbm, key))
- return APR_ENOENT;
+ return APR_ENOENT;
if (apr_dbm_fetch(htdbm->dbm, key, &val) != APR_SUCCESS)
return APR_ENOENT;
rec = apr_pstrndup(htdbm->pool, val.dptr, val.dsize);
@@ -234,7 +234,7 @@
return apr_password_validate(htdbm->userpass, pwd);
}
-static apr_status_t htdbm_list(htdbm_t *htdbm)
+static apr_status_t htdbm_list(htdbm_t *htdbm)
{
apr_status_t rv;
apr_datum_t key, val;
@@ -244,13 +244,13 @@
rv = apr_dbm_firstkey(htdbm->dbm, &key);
if (rv != APR_SUCCESS) {
- fprintf(stderr, "Empty database -- %s\n", htdbm->filename);
+ fprintf(stderr, "Empty database -- %s\n", htdbm->filename);
return APR_ENOENT;
}
rec = apr_pcalloc(htdbm->pool, HUGE_STRING_LEN);
- fprintf(stderr, "Dumping records from database -- %s\n", htdbm->filename);
- fprintf(stderr, " %-32sComment\n", "Username");
+ fprintf(stderr, "Dumping records from database -- %s\n", htdbm->filename);
+ fprintf(stderr, " %-32sComment\n", "Username");
while (key.dptr != NULL) {
rv = apr_dbm_fetch(htdbm->dbm, key, &val);
if (rv != APR_SUCCESS) {
@@ -287,7 +287,7 @@
}
}
-static apr_status_t htdbm_make(htdbm_t *htdbm)
+static apr_status_t htdbm_make(htdbm_t *htdbm)
{
char cpw[MAX_STRING_LEN];
char salt[9];
@@ -298,7 +298,7 @@
apr_sha1_base64(htdbm->userpass,strlen(htdbm->userpass),cpw);
break;
- case ALG_APMD5:
+ case ALG_APMD5:
(void) srand((int) time((time_t *) NULL));
to64(&salt[0], rand(), 8);
salt[8] = '\0';
@@ -404,7 +404,7 @@
}
/*
* Preliminary check to make sure they provided at least
- * three arguments, we'll do better argument checking as
+ * three arguments, we'll do better argument checking as
* we parse the command line.
*/
if (argc < 3)
@@ -417,7 +417,7 @@
arg = argv[i];
if (*arg != '-')
break;
-
+
while (*++arg != '\0') {
switch (*arg) {
case 'b':
@@ -520,7 +520,7 @@
fprintf(stderr, "Password verification error\n");
exit(ERR_PWMISMATCH);
}
-
+
h->userpass = apr_pstrdup(pool, pwi);
}
if (need_cmnt && pwd_supplied)
@@ -558,13 +558,13 @@
htdbm_make(h);
break;
- }
+ }
if (need_file && !h->rdonly) {
if ((rv = htdbm_save(h, &changed)) != APR_SUCCESS) {
apr_strerror(rv, errbuf, sizeof(errbuf));
exit(ERR_FILEPERM);
}
- fprintf(stdout, "Database %s %s.\n", h->filename,
+ fprintf(stdout, "Database %s %s.\n", h->filename,
h->create ? "created" : (changed ? "modified" : "updated"));
}
if (cmd == HTDBM_NOFILE) {
@@ -577,6 +577,6 @@
}
}
htdbm_terminate(h);
-
+
return 0; /* Suppress compiler warning. */
}
Modified: httpd/httpd/branches/2.2.x/support/htdigest.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/support/htdigest.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/support/htdigest.c (original)
+++ httpd/httpd/branches/2.2.x/support/htdigest.c Thu Nov 10 07:20:05 2005
@@ -96,7 +96,7 @@
char ch;
apr_status_t rv = APR_EINVAL;
- while (i < (n - 1) &&
+ while (i < (n - 1) &&
((rv = apr_file_getc(&ch, f)) == APR_SUCCESS) && (ch != '\n')) {
s[i++] = ch;
}
@@ -104,7 +104,7 @@
s[i++] = ch;
s[i] = '\0';
- if (rv != APR_SUCCESS)
+ if (rv != APR_SUCCESS)
return 1;
return 0;
@@ -193,9 +193,9 @@
char w[MAX_STRING_LEN];
char x[MAX_STRING_LEN];
int found;
-
+
apr_app_initialize(&argc, &argv, NULL);
- atexit(terminate);
+ atexit(terminate);
apr_pool_create(&cntxt, NULL);
apr_file_open_stderr(&errfile, cntxt);
@@ -207,7 +207,7 @@
exit(1);
}
#endif
-
+
apr_signal(SIGINT, (void (*)(int)) interrupted);
if (argc == 5) {
if (strcmp(argv[1], "-c"))
@@ -222,7 +222,7 @@
apr_strerror(rv, errmsg, sizeof errmsg));
exit(1);
}
- apr_file_printf(errfile, "Adding password for %s in realm %s.\n",
+ apr_file_printf(errfile, "Adding password for %s in realm %s.\n",
argv[4], argv[3]);
add_password(argv[4], argv[3], f);
apr_file_close(f);
@@ -266,7 +266,7 @@
continue;
}
else {
- apr_file_printf(errfile, "Changing password for user %s in realm %s\n",
+ apr_file_printf(errfile, "Changing password for user %s in realm %s\n",
user, realm);
add_password(user, realm, tfp);
found = 1;
@@ -282,7 +282,7 @@
*/
if (apr_file_copy(dirname, argv[1], APR_FILE_SOURCE_PERMS, cntxt) !=
APR_SUCCESS) {
- apr_file_printf(errfile, "%s: unable to update file %s\n",
+ apr_file_printf(errfile, "%s: unable to update file %s\n",
argv[0], argv[1]);
}
apr_file_close(tfp);
Modified: httpd/httpd/branches/2.2.x/support/htpasswd.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/support/htpasswd.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/support/htpasswd.c (original)
+++ httpd/httpd/branches/2.2.x/support/htpasswd.c Thu Nov 10 07:20:05 2005
@@ -23,7 +23,7 @@
/*
* htpasswd.c: simple program for manipulating password file for
* the Apache HTTP server
- *
+ *
* Originally by Rob McCool
*
* Exit values:
@@ -84,7 +84,7 @@
#define ALG_PLAIN 0
#define ALG_CRYPT 1
#define ALG_APMD5 2
-#define ALG_APSHA 3
+#define ALG_APSHA 3
#define ERR_FILEPERM 1
#define ERR_SYNTAX 2
@@ -141,7 +141,7 @@
else {
bufsize = sizeof(pwin);
if (apr_password_get("New password: ", pwin, &bufsize) != 0) {
- apr_snprintf(record, (rlen - 1), "password too long (>%"
+ apr_snprintf(record, (rlen - 1), "password too long (>%"
APR_SIZE_T_FMT ")", sizeof(pwin) - 1);
return ERR_OVERFLOW;
}
@@ -161,7 +161,7 @@
apr_sha1_base64(pw,strlen(pw),cpw);
break;
- case ALG_APMD5:
+ case ALG_APMD5:
(void) srand((int) time((time_t *) NULL));
to64(&salt[0], rand(), 8);
salt[8] = '\0';
@@ -272,8 +272,8 @@
#endif
}
-static void check_args(apr_pool_t *pool, int argc, const char *const argv[],
- int *alg, int *mask, char **user, char **pwfilename,
+static void check_args(apr_pool_t *pool, int argc, const char *const argv[],
+ int *alg, int *mask, char **user, char **pwfilename,
char **password)
{
const char *arg;
@@ -282,7 +282,7 @@
/*
* Preliminary check to make sure they provided at least
- * three arguments, we'll do better argument checking as
+ * three arguments, we'll do better argument checking as
* we parse the command line.
*/
if (argc < 3) {
@@ -517,7 +517,7 @@
dirname = apr_psprintf(pool, "%s/%s", dirname, tn);
if (apr_file_mktemp(&ftemp, dirname, 0, pool) != APR_SUCCESS) {
- apr_file_printf(errfile, "%s: unable to create temporary file %s" NL,
+ apr_file_printf(errfile, "%s: unable to create temporary file %s" NL,
argv[0], dirname);
exit(ERR_FILEPERM);
}
@@ -529,7 +529,7 @@
if (existing_file && !(mask & APHTP_NEWFILE)) {
if (apr_file_open(&fpw, pwfilename, APR_READ | APR_BUFFERED,
APR_OS_DEFAULT, pool) != APR_SUCCESS) {
- apr_file_printf(errfile, "%s: unable to read file %s" NL,
+ apr_file_printf(errfile, "%s: unable to read file %s" NL,
argv[0], pwfilename);
exit(ERR_FILEPERM);
}
@@ -555,7 +555,7 @@
}
else {
/*
- * If we've not got a colon on the line, this could well
+ * If we've not got a colon on the line, this could well
* not be a valid htpasswd file.
* We should bail at this point.
*/
@@ -603,7 +603,7 @@
*/
if (apr_file_copy(dirname, pwfilename, APR_FILE_SOURCE_PERMS, pool) !=
APR_SUCCESS) {
- apr_file_printf(errfile, "%s: unable to update file %s" NL,
+ apr_file_printf(errfile, "%s: unable to update file %s" NL,
argv[0], pwfilename);
exit(ERR_FILEPERM);
}
Modified: httpd/httpd/branches/2.2.x/support/httxt2dbm.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/support/httxt2dbm.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/support/httxt2dbm.c (original)
+++ httpd/httpd/branches/2.2.x/support/httxt2dbm.c Thu Nov 10 07:20:05 2005
@@ -157,7 +157,7 @@
dbmval.dsize = (c - line);
if (verbose) {
- apr_file_printf(errfile, " '%s' -> '%s'"NL,
+ apr_file_printf(errfile, " '%s' -> '%s'"NL,
dbmkey.dptr, dbmval.dptr);
}
@@ -173,7 +173,7 @@
return rv;
}
-int main(int argc, const char *const argv[])
+int main(int argc, const char *const argv[])
{
apr_pool_t *pool;
apr_status_t rv = APR_SUCCESS;
@@ -280,12 +280,12 @@
rv = apr_file_open_stdin(&infile, pool);
}
else {
- rv = apr_file_open(&infile, input, APR_READ|APR_BUFFERED,
+ rv = apr_file_open(&infile, input, APR_READ|APR_BUFFERED,
APR_OS_DEFAULT, pool);
}
if (rv != APR_SUCCESS) {
- apr_file_printf(errfile,
+ apr_file_printf(errfile,
"Error: Cannot open input file '%s': (%d) %s" NL NL,
input, rv, apr_strerror(rv, errbuf, sizeof(errbuf)));
return 1;
@@ -295,18 +295,18 @@
apr_file_printf(errfile, "Input File: %s"NL, input);
}
- rv = apr_dbm_open_ex(&outdbm, format, output, APR_DBM_RWCREATE,
+ rv = apr_dbm_open_ex(&outdbm, format, output, APR_DBM_RWCREATE,
APR_OS_DEFAULT, pool);
if (APR_STATUS_IS_ENOTIMPL(rv)) {
- apr_file_printf(errfile,
+ apr_file_printf(errfile,
"Error: The requested DBM Format '%s' is not available." NL NL,
format);
return 1;
}
if (rv != APR_SUCCESS) {
- apr_file_printf(errfile,
+ apr_file_printf(errfile,
"Error: Cannot open output DBM '%s': (%d) %s" NL NL,
output, rv, apr_strerror(rv, errbuf, sizeof(errbuf)));
return 1;
@@ -319,7 +319,7 @@
rv = to_dbm(outdbm, infile, pool);
if (rv != APR_SUCCESS) {
- apr_file_printf(errfile,
+ apr_file_printf(errfile,
"Error: Converting to DBM: (%d) %s" NL NL,
rv, apr_strerror(rv, errbuf, sizeof(errbuf)));
return 1;
Modified: httpd/httpd/branches/2.2.x/support/logresolve.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/support/logresolve.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/support/logresolve.c (original)
+++ httpd/httpd/branches/2.2.x/support/logresolve.c Thu Nov 10 07:20:05 2005
@@ -105,7 +105,7 @@
/*
* struct nsrec - record of nameservice for cache linked list
- *
+ *
* ipnum - IP number hostname - hostname noname - nonzero if IP number has no
* hostname, i.e. hostname=IP number
*/
@@ -307,7 +307,7 @@
#if defined(WIN32) || (defined(NETWARE) && defined(USE_WINSOCK))
/* If we apr'ify this code, apr_pool_create/apr_pool_destroy
- * should perform the WSAStartup/WSACleanup for us.
+ * should perform the WSAStartup/WSACleanup for us.
*/
WSADATA wsaData;
WSAStartup(MAKEWORD(2, 0), &wsaData);
Modified: httpd/httpd/branches/2.2.x/support/rotatelogs.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/support/rotatelogs.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/support/rotatelogs.c (original)
+++ httpd/httpd/branches/2.2.x/support/rotatelogs.c Thu Nov 10 07:20:05 2005
@@ -171,7 +171,7 @@
apr_finfo_t finfo;
apr_off_t current_size = -1;
- if ((nLogFD != NULL) &&
+ if ((nLogFD != NULL) &&
(apr_file_info_get(&finfo, APR_FINFO_SIZE, nLogFD) == APR_SUCCESS)) {
current_size = finfo.size;
}
@@ -188,7 +188,7 @@
if (nLogFD == NULL) {
int tLogStart;
-
+
if (tRotation) {
tLogStart = (now / tRotation) * tRotation;
}
Modified: httpd/httpd/branches/2.2.x/support/suexec.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/support/suexec.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/support/suexec.c (original)
+++ httpd/httpd/branches/2.2.x/support/suexec.c Thu Nov 10 07:20:05 2005
@@ -20,8 +20,8 @@
***********************************************************************
*
* NOTE! : DO NOT edit this code!!! Unless you know what you are doing,
- * editing this code might open up your system in unexpected
- * ways to would-be crackers. Every precaution has been taken
+ * editing this code might open up your system in unexpected
+ * ways to would-be crackers. Every precaution has been taken
* to make this code as safe as possible; alter it at your own
* risk.
*
@@ -217,9 +217,9 @@
*/
char **envp = environ;
char *empty_ptr = NULL;
-
+
environ = &empty_ptr; /* VERY safe environment */
-
+
if ((cleanenv = (char **) calloc(AP_ENVBUF, sizeof(char *))) == NULL) {
log_err("failed to malloc memory for environment\n");
exit(120);
@@ -429,7 +429,7 @@
}
}
#endif /*_OSD_POSIX*/
-
+
/*
* Save these for later since initgroups will hose the struct
*/
@@ -438,7 +438,7 @@
target_homedir = strdup(pw->pw_dir);
/*
- * Log the transaction here to be sure we have an open log
+ * Log the transaction here to be sure we have an open log
* before we setuid().
*/
log_no_err("uid: (%s/%s) gid: (%s/%s) cmd: %s\n",
@@ -595,9 +595,9 @@
umask(AP_SUEXEC_UMASK);
#endif /* AP_SUEXEC_UMASK */
- /*
+ /*
* Be sure to close the log file so the CGI can't
- * mess with it. If the exec fails, it will be reopened
+ * mess with it. If the exec fails, it will be reopened
* automatically when log_err is called. Note that the log
* might not actually be open if AP_LOG_EXEC isn't defined.
* However, the "log" cell isn't ifdef'd so let's be defensive
Modified: httpd/httpd/branches/2.2.x/support/win32/ApacheMonitor.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/support/win32/ApacheMonitor.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/support/win32/ApacheMonitor.c (original)
+++ httpd/httpd/branches/2.2.x/support/win32/ApacheMonitor.c Thu Nov 10 07:20:05 2005
@@ -20,7 +20,7 @@
* Contributed by Mladen Turk <mturk mappingsoft.com>
*
* 05 Aug 2001
- * ====================================================================
+ * ====================================================================
*/
#define _WIN32_WINNT 0x0400
@@ -89,8 +89,8 @@
ST_APACHE_SERVICE g_stServices[MAX_APACHE_SERVICES];
ST_MONITORED_COMP g_stComputers[MAX_APACHE_COMPUTERS];
-HBITMAP g_hBmpStart, g_hBmpStop;
-HBITMAP g_hBmpPicture, g_hBmpOld;
+HBITMAP g_hBmpStart, g_hBmpStop;
+HBITMAP g_hBmpPicture, g_hBmpOld;
BOOL g_bRescanServices;
HWND g_hwndServiceDlg;
HWND g_hwndMain;
@@ -116,7 +116,7 @@
void am_ClearServicesSt()
{
int i;
- for (i = 0; i < MAX_APACHE_SERVICES; i++)
+ for (i = 0; i < MAX_APACHE_SERVICES; i++)
{
if (g_stServices[i].szServiceName) {
free(g_stServices[i].szServiceName);
@@ -187,7 +187,7 @@
g_stComputers[i].szComputerName = NULL;
g_stComputers[i].hRegistry = NULL;
}
- }
+ }
}
@@ -205,7 +205,7 @@
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, GetLastError(), g_LangID,
(LPSTR) &lpMsgBuf, 0, NULL);
- MessageBox(NULL, (LPCSTR)lpMsgBuf,
+ MessageBox(NULL, (LPCSTR)lpMsgBuf,
g_lpMsg[IDS_MSG_ERROR - IDS_MSG_FIRST],
MB_OK | (bFatal ? MB_ICONERROR : MB_ICONEXCLAMATION));
LocalFree(lpMsgBuf);
@@ -231,9 +231,9 @@
if (i > MAX_APACHE_COMPUTERS - 1) {
return FALSE;
}
- if (RegConnectRegistry(szComputerName, HKEY_LOCAL_MACHINE, &hKeyRemote)
+ if (RegConnectRegistry(szComputerName, HKEY_LOCAL_MACHINE, &hKeyRemote)
!= ERROR_SUCCESS) {
- sprintf(szTmp, g_lpMsg[IDS_MSG_ECONNECT - IDS_MSG_FIRST],
+ sprintf(szTmp, g_lpMsg[IDS_MSG_ECONNECT - IDS_MSG_FIRST],
szComputerName);
ErrorMessage(szTmp, FALSE);
return FALSE;
@@ -243,7 +243,7 @@
g_stComputers[i].hRegistry = hKeyRemote;
return TRUE;
}
-}
+}
LPSTR GetStringRes(int id)
@@ -259,7 +259,7 @@
BOOL GetSystemOSVersion(LPDWORD dwVersion)
{
OSVERSIONINFO osvi;
- /*
+ /*
Try calling GetVersionEx using the OSVERSIONINFOEX structure.
If that fails, try using the OSVERSIONINFO structure.
*/
@@ -293,7 +293,7 @@
*dwVersion = 0;
return FALSE;
}
- return TRUE;
+ return TRUE;
}
@@ -344,7 +344,7 @@
}
-void appendMenuItem(HMENU hMenu, UINT uMenuId, LPSTR szName,
+void appendMenuItem(HMENU hMenu, UINT uMenuId, LPSTR szName,
BOOL fDefault, BOOL fEnabled)
{
MENUITEMINFO mii;
@@ -371,7 +371,7 @@
}
-void appendServiceMenu(HMENU hMenu, UINT uMenuId,
+void appendServiceMenu(HMENU hMenu, UINT uMenuId,
LPSTR szServiceName, BOOL fRunning)
{
MENUITEMINFO mii;
@@ -379,16 +379,16 @@
smh = CreatePopupMenu();
- appendMenuItem(smh, IDM_SM_START + uMenuId,
+ appendMenuItem(smh, IDM_SM_START + uMenuId,
g_lpMsg[IDS_MSG_SSTART - IDS_MSG_FIRST], FALSE, !fRunning);
- appendMenuItem(smh, IDM_SM_STOP + uMenuId,
+ appendMenuItem(smh, IDM_SM_STOP + uMenuId,
g_lpMsg[IDS_MSG_SSTOP - IDS_MSG_FIRST], FALSE, fRunning);
- appendMenuItem(smh, IDM_SM_RESTART + uMenuId,
+ appendMenuItem(smh, IDM_SM_RESTART + uMenuId,
g_lpMsg[IDS_MSG_SRESTART - IDS_MSG_FIRST], FALSE, fRunning);
memset(&mii, 0, sizeof(MENUITEMINFO));
mii.cbSize = sizeof(MENUITEMINFO);
- mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_SUBMENU
+ mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_SUBMENU
| MIIM_CHECKMARKS;
mii.fType = MFT_STRING;
mii.wID = uMenuId;
@@ -409,16 +409,16 @@
if (hMenu)
{
- appendMenuItem(hMenu, IDM_RESTORE,
- g_lpMsg[IDS_MSG_MNUSHOW - IDS_MSG_FIRST],
+ appendMenuItem(hMenu, IDM_RESTORE,
+ g_lpMsg[IDS_MSG_MNUSHOW - IDS_MSG_FIRST],
TRUE, TRUE);
if (g_dwOSVersion >= OS_VERSION_WINNT) {
- appendMenuItem(hMenu, IDC_SMANAGER,
- g_lpMsg[IDS_MSG_MNUSERVICES - IDS_MSG_FIRST],
+ appendMenuItem(hMenu, IDC_SMANAGER,
+ g_lpMsg[IDS_MSG_MNUSERVICES - IDS_MSG_FIRST],
FALSE, TRUE);
}
appendMenuItem(hMenu, 0, "", FALSE, TRUE);
- appendMenuItem(hMenu, IDM_EXIT,
+ appendMenuItem(hMenu, IDM_EXIT,
g_lpMsg[IDS_MSG_MNUEXIT - IDS_MSG_FIRST],
FALSE, TRUE);
@@ -426,7 +426,7 @@
SetForegroundWindow(NULL);
}
GetCursorPos(&pt);
- TrackPopupMenu(hMenu, TPM_LEFTALIGN|TPM_RIGHTBUTTON,
+ TrackPopupMenu(hMenu, TPM_LEFTALIGN|TPM_RIGHTBUTTON,
pt.x, pt.y, 0, hWnd, NULL);
DestroyMenu(hMenu);
}
@@ -454,7 +454,7 @@
SetForegroundWindow(NULL);
}
GetCursorPos(&pt);
- TrackPopupMenu(hMenu, TPM_LEFTALIGN|TPM_RIGHTBUTTON,
+ TrackPopupMenu(hMenu, TPM_LEFTALIGN|TPM_RIGHTBUTTON,
pt.x, pt.y, 0, hWnd, NULL);
DestroyMenu(hMenu);
}
@@ -486,18 +486,18 @@
/* Calculate new X and Y position*/
xNew = (rWorkArea.right - wChild) / 2;
yNew = (rWorkArea.bottom - hChild) / 2;
- return SetWindowPos(hwndChild, HWND_TOP, xNew, yNew, 0, 0,
+ return SetWindowPos(hwndChild, HWND_TOP, xNew, yNew, 0, 0,
SWP_NOSIZE | SWP_SHOWWINDOW);
}
-static void addListBoxItem(HWND hDlg, LPSTR lpStr, HBITMAP hBmp)
-{
- LRESULT nItem;
-
- nItem = SendMessage(hDlg, LB_ADDSTRING, 0, (LPARAM)lpStr);
- SendMessage(hDlg, LB_SETITEMDATA, nItem, (LPARAM)hBmp);
-}
+static void addListBoxItem(HWND hDlg, LPSTR lpStr, HBITMAP hBmp)
+{
+ LRESULT nItem;
+
+ nItem = SendMessage(hDlg, LB_ADDSTRING, 0, (LPARAM)lpStr);
+ SendMessage(hDlg, LB_SETITEMDATA, nItem, (LPARAM)hBmp);
+}
static void addListBoxString(HWND hListBox, LPSTR lpStr)
@@ -507,9 +507,9 @@
return;
}
++nItems;
- if (nItems > MAX_LOADSTRING)
+ if (nItems > MAX_LOADSTRING)
{
- SendMessage(hListBox, LB_RESETCONTENT, 0, 0);
+ SendMessage(hListBox, LB_RESETCONTENT, 0, 0);
nItems = 1;
}
ListBox_SetCurSel(hListBox,
@@ -525,17 +525,17 @@
BYTE ch;
DWORD dwReaded;
- while (ReadFile(g_hpipeOutRead, &ch, 1, &dwReaded, NULL) == TRUE)
+ while (ReadFile(g_hpipeOutRead, &ch, 1, &dwReaded, NULL) == TRUE)
{
- if (dwReaded > 0)
+ if (dwReaded > 0)
{
- if (ch == '\n' || nPtr >= MAX_PATH)
+ if (ch == '\n' || nPtr >= MAX_PATH)
{
lpBuffer[nPtr] = '\0';
addListBoxString(g_hwndStdoutList, lpBuffer);
nPtr = 0;
- }
- else if (ch == '\t' && nPtr < (MAX_PATH - 4))
+ }
+ else if (ch == '\t' && nPtr < (MAX_PATH - 4))
{
int i;
for (i = 0; i < 4; ++i) {
@@ -585,11 +585,11 @@
if (!CreatePipe(&g_hpipeOutRead, &g_hpipeOutWrite, NULL, MAX_PATH*8)) {
ErrorMessage(NULL, TRUE);
}
- DuplicateHandle(hProc, g_hpipeInRead, hProc, &g_hpipeInRead, 0, TRUE,
+ DuplicateHandle(hProc, g_hpipeInRead, hProc, &g_hpipeInRead, 0, TRUE,
DUPLICATE_CLOSE_SOURCE|DUPLICATE_SAME_ACCESS);
- DuplicateHandle(hProc, g_hpipeOutWrite, hProc, &g_hpipeOutWrite, 0, TRUE,
+ DuplicateHandle(hProc, g_hpipeOutWrite, hProc, &g_hpipeOutWrite, 0, TRUE,
DUPLICATE_CLOSE_SOURCE|DUPLICATE_SAME_ACCESS);
- DuplicateHandle(hProc, g_hpipeOutWrite, hProc, &g_hpipeStdError, 0, TRUE,
+ DuplicateHandle(hProc, g_hpipeOutWrite, hProc, &g_hpipeStdError, 0, TRUE,
DUPLICATE_SAME_ACCESS);
if (!g_hpipeInRead && !g_hpipeOutWrite && !g_hpipeStdError) {
ErrorMessage(NULL, TRUE);
@@ -622,7 +622,7 @@
return FALSE;
}
- CloseHandle(CreateThread(NULL, 0, ConsoleOutputThread,
+ CloseHandle(CreateThread(NULL, 0, ConsoleOutputThread,
0, 0, &dwThreadId));
ResumeThread(g_lpRedirectProc.hThread);
CloseHandle(CreateThread(NULL, 0, ConsoleWaitingThread,
@@ -671,7 +671,7 @@
}
-BOOL ApacheManageService(LPCSTR szServiceName, LPCSTR szImagePath,
+BOOL ApacheManageService(LPCSTR szServiceName, LPCSTR szImagePath,
LPSTR szComputerName, DWORD dwCommand)
{
CHAR szBuf[MAX_PATH];
@@ -697,7 +697,7 @@
break;
case SERVICE_CONTROL_CONTINUE:
- sprintf(szMsg, g_lpMsg[IDS_MSG_SRVSTART - IDS_MSG_FIRST],
+ sprintf(szMsg, g_lpMsg[IDS_MSG_SRVSTART - IDS_MSG_FIRST],
szServiceName);
addListBoxString(g_hwndStdoutList, szMsg);
lstrcat(szBuf, " -k start -n ");
@@ -727,7 +727,7 @@
}
else if (!serviceFlag)
{
- sprintf(szMsg, g_lpMsg[IDS_MSG_SRVSTARTED - IDS_MSG_FIRST],
+ sprintf(szMsg, g_lpMsg[IDS_MSG_SRVSTARTED - IDS_MSG_FIRST],
szServiceName);
addListBoxString(g_hwndStdoutList, szMsg);
g_bConsoleRun = FALSE;
@@ -743,8 +743,8 @@
return FALSE;
}
- schService = OpenService(schSCManager, szServiceName,
- SERVICE_QUERY_STATUS | SERVICE_START |
+ schService = OpenService(schSCManager, szServiceName,
+ SERVICE_QUERY_STATUS | SERVICE_START |
SERVICE_STOP | SERVICE_USER_DEFINED_CONTROL);
if (schService != NULL)
{
@@ -754,13 +754,13 @@
switch (dwCommand)
{
case SERVICE_CONTROL_STOP:
- sprintf(szMsg, g_lpMsg[IDS_MSG_SRVSTOP - IDS_MSG_FIRST],
+ sprintf(szMsg, g_lpMsg[IDS_MSG_SRVSTOP - IDS_MSG_FIRST],
szServiceName);
addListBoxString(g_hwndStdoutList, szMsg);
- if (ControlService(schService, SERVICE_CONTROL_STOP,
+ if (ControlService(schService, SERVICE_CONTROL_STOP,
&schSStatus)) {
Sleep(1000);
- while (QueryServiceStatus(schService, &schSStatus))
+ while (QueryServiceStatus(schService, &schSStatus))
{
if (schSStatus.dwCurrentState == SERVICE_STOP_PENDING)
{
@@ -776,8 +776,8 @@
if (schSStatus.dwCurrentState == SERVICE_STOPPED)
{
retValue = TRUE;
- sprintf(szMsg,
- g_lpMsg[IDS_MSG_SRVSTOPPED - IDS_MSG_FIRST],
+ sprintf(szMsg,
+ g_lpMsg[IDS_MSG_SRVSTOPPED - IDS_MSG_FIRST],
szServiceName);
addListBoxString(g_hwndStdoutList, szMsg);
}
@@ -789,10 +789,10 @@
szServiceName);
addListBoxString(g_hwndStdoutList, szMsg);
- if (StartService(schService, 0, NULL))
+ if (StartService(schService, 0, NULL))
{
Sleep(1000);
- while (QueryServiceStatus(schService, &schSStatus))
+ while (QueryServiceStatus(schService, &schSStatus))
{
if (schSStatus.dwCurrentState == SERVICE_START_PENDING)
{
@@ -808,7 +808,7 @@
if (schSStatus.dwCurrentState == SERVICE_RUNNING)
{
retValue = TRUE;
- sprintf(szMsg,
+ sprintf(szMsg,
g_lpMsg[IDS_MSG_SRVSTARTED - IDS_MSG_FIRST],
szServiceName);
addListBoxString(g_hwndStdoutList, szMsg);
@@ -821,7 +821,7 @@
szServiceName);
addListBoxString(g_hwndStdoutList, szMsg);
if (ControlService(schService, SERVICE_APACHE_RESTART,
- &schSStatus))
+ &schSStatus))
{
ticks = 60;
while (schSStatus.dwCurrentState == SERVICE_START_PENDING)
@@ -843,7 +843,7 @@
if (schSStatus.dwCurrentState == SERVICE_RUNNING)
{
retValue = TRUE;
- sprintf(szMsg,
+ sprintf(szMsg,
g_lpMsg[IDS_MSG_SRVRESTARTED - IDS_MSG_FIRST],
szServiceName);
addListBoxString(g_hwndStdoutList, szMsg);
@@ -853,7 +853,7 @@
CloseServiceHandle(schService);
CloseServiceHandle(schSCManager);
if (!retValue) {
- ErrorMessage(g_lpMsg[IDS_MSG_SRVFAILED - IDS_MSG_FIRST],
+ ErrorMessage(g_lpMsg[IDS_MSG_SRVFAILED - IDS_MSG_FIRST],
FALSE);
}
g_bConsoleRun = FALSE;
@@ -871,7 +871,7 @@
}
-BOOL IsServiceRunning(LPCSTR szServiceName, LPCSTR szComputerName,
+BOOL IsServiceRunning(LPCSTR szServiceName, LPCSTR szComputerName,
LPDWORD lpdwPid)
{
DWORD dwPid;
@@ -883,7 +883,7 @@
if (g_dwOSVersion == OS_VERSION_WIN9X)
{
hWnd = FindWindow("ApacheWin95ServiceMonitor", szServiceName);
- if (hWnd && GetWindowThreadProcessId(hWnd, &dwPid))
+ if (hWnd && GetWindowThreadProcessId(hWnd, &dwPid))
{
*lpdwPid = 1;
return TRUE;
@@ -901,7 +901,7 @@
return FALSE;
}
- schService = OpenService(schSCManager, szServiceName,
+ schService = OpenService(schSCManager, szServiceName,
SERVICE_QUERY_STATUS);
if (schService != NULL)
{
@@ -935,7 +935,7 @@
BOOL rv = FALSE;
while (g_stServices[i].szServiceName != NULL)
{
- if (!IsServiceRunning(g_stServices[i].szServiceName,
+ if (!IsServiceRunning(g_stServices[i].szServiceName,
g_stServices[i].szComputerName, &dwPid)) {
dwPid = 0;
}
@@ -983,7 +983,7 @@
lstrcpy(szKey, "System\\CurrentControlSet\\Services\\");
lstrcat(szKey, achKey);
- if (RegOpenKeyEx(hKeyRemote, szKey, 0,
+ if (RegOpenKeyEx(hKeyRemote, szKey, 0,
KEY_QUERY_VALUE, &hSubKey) == ERROR_SUCCESS)
{
dwBufLen = MAX_PATH;
@@ -991,7 +991,7 @@
&dwKeyType, szImagePath, &dwBufLen);
if (rv == ERROR_SUCCESS
- && (dwKeyType == REG_SZ
+ && (dwKeyType == REG_SZ
|| dwKeyType == REG_EXPAND_SZ)
&& dwBufLen)
{
@@ -1000,30 +1000,30 @@
/* the service name could be httpd*.exe or Apache*.exe */
if (((strstr(szBuf, "\\apache") != NULL)
|| (strstr(szBuf, "\\httpd") != NULL))
- && strstr(szBuf, ".exe")
- && (strstr(szBuf, "--ntservice") != NULL
+ && strstr(szBuf, ".exe")
+ && (strstr(szBuf, "--ntservice") != NULL
|| strstr(szBuf, "-k ") != NULL))
{
g_stServices[stPos].szServiceName = strdup(achKey);
- g_stServices[stPos].szImagePath =
+ g_stServices[stPos].szImagePath =
strdup(szImagePath);
- g_stServices[stPos].szComputerName =
+ g_stServices[stPos].szComputerName =
strdup(g_stComputers[computers].szComputerName);
dwBufLen = MAX_PATH;
if (RegQueryValueEx(hSubKey, "Description", NULL,
- &dwKeyType, szBuf, &dwBufLen)
+ &dwKeyType, szBuf, &dwBufLen)
== ERROR_SUCCESS) {
- g_stServices[stPos].szDescription =
+ g_stServices[stPos].szDescription =
strdup(szBuf);
}
dwBufLen = MAX_PATH;
if (RegQueryValueEx(hSubKey, "DisplayName", NULL,
- &dwKeyType, szBuf, &dwBufLen)
- == ERROR_SUCCESS)
+ &dwKeyType, szBuf, &dwBufLen)
+ == ERROR_SUCCESS)
{
if (strcmp(g_stComputers[computers]
- .szComputerName, g_szLocalHost) != 0)
- {
+ .szComputerName, g_szLocalHost) != 0)
+ {
strcpy(szTmp, g_stComputers[computers]
.szComputerName + 2);
strcat(szTmp, "@");
@@ -1032,7 +1032,7 @@
else {
strcpy(szTmp, szBuf);
}
- g_stServices[stPos].szDisplayName
+ g_stServices[stPos].szDisplayName
= strdup(szTmp);
}
@@ -1054,13 +1054,13 @@
}
-LRESULT CALLBACK ConnectDlgProc(HWND hDlg, UINT message,
+LRESULT CALLBACK ConnectDlgProc(HWND hDlg, UINT message,
WPARAM wParam, LPARAM lParam)
{
CHAR szCmp[MAX_COMPUTERNAME_LENGTH+4];
- switch (message)
- {
- case WM_INITDIALOG:
+ switch (message)
+ {
+ case WM_INITDIALOG:
ShowWindow(hDlg, SW_HIDE);
g_hwndConnectDlg = hDlg;
CenterWindow(hDlg);
@@ -1068,27 +1068,27 @@
SetFocus(GetDlgItem(hDlg, IDC_COMPUTER));
return TRUE;
- case WM_COMMAND:
- switch (LOWORD(wParam))
- {
- case IDOK:
+ case WM_COMMAND:
+ switch (LOWORD(wParam))
+ {
+ case IDOK:
memset(szCmp, 0, MAX_COMPUTERNAME_LENGTH+4);
strcpy(szCmp, "\\\\");
- SendMessage(GetDlgItem(hDlg, IDC_COMPUTER), WM_GETTEXT,
- (WPARAM) MAX_COMPUTERNAME_LENGTH,
- (LPARAM) szCmp+2);
+ SendMessage(GetDlgItem(hDlg, IDC_COMPUTER), WM_GETTEXT,
+ (WPARAM) MAX_COMPUTERNAME_LENGTH,
+ (LPARAM) szCmp+2);
strupr(szCmp);
if (strlen(szCmp) < 3) {
- EndDialog(hDlg, TRUE);
+ EndDialog(hDlg, TRUE);
return TRUE;
}
am_ConnectComputer(szCmp);
SendMessage(g_hwndMain, WM_TIMER, WM_TIMER_RESCAN, 0);
case IDCANCEL:
- EndDialog(hDlg, TRUE);
- return TRUE;
+ EndDialog(hDlg, TRUE);
+ return TRUE;
case IDC_LBROWSE:
{
@@ -1108,9 +1108,9 @@
bi.pidlRoot = il;
if (SHBrowseForFolder(&bi) != NULL) {
- SendMessage(GetDlgItem(hDlg, IDC_COMPUTER),
- WM_SETTEXT,
- (WPARAM) NULL, (LPARAM) szCmp);
+ SendMessage(GetDlgItem(hDlg, IDC_COMPUTER),
+ WM_SETTEXT,
+ (WPARAM) NULL, (LPARAM) szCmp);
}
if (SHGetMalloc(&pMalloc)) {
pMalloc->lpVtbl->Free(pMalloc, il);
@@ -1122,7 +1122,7 @@
break;
case WM_QUIT:
- case WM_CLOSE:
+ case WM_CLOSE:
EndDialog(hDlg, TRUE);
return TRUE;
@@ -1134,24 +1134,24 @@
}
-LRESULT CALLBACK ServiceDlgProc(HWND hDlg, UINT message,
+LRESULT CALLBACK ServiceDlgProc(HWND hDlg, UINT message,
WPARAM wParam, LPARAM lParam)
{
- CHAR szBuf[MAX_PATH];
+ CHAR szBuf[MAX_PATH];
HWND hListBox;
- static HWND hStatusBar;
- TEXTMETRIC tm;
- int i, y;
- HDC hdcMem;
- RECT rcBitmap;
+ static HWND hStatusBar;
+ TEXTMETRIC tm;
+ int i, y;
+ HDC hdcMem;
+ RECT rcBitmap;
LRESULT nItem;
- LPMEASUREITEMSTRUCT lpmis;
- LPDRAWITEMSTRUCT lpdis;
+ LPMEASUREITEMSTRUCT lpmis;
+ LPDRAWITEMSTRUCT lpdis;
memset(szBuf, 0, MAX_PATH);
- switch (message)
+ switch (message)
{
- case WM_INITDIALOG:
+ case WM_INITDIALOG:
ShowWindow(hDlg, SW_HIDE);
g_hwndServiceDlg = hDlg;
SetWindowText(hDlg, g_szTitle);
@@ -1159,17 +1159,17 @@
Button_Enable(GetDlgItem(hDlg, IDC_SSTOP), FALSE);
Button_Enable(GetDlgItem(hDlg, IDC_SRESTART), FALSE);
Button_Enable(GetDlgItem(hDlg, IDC_SDISCONN), FALSE);
- SetWindowText(GetDlgItem(hDlg, IDC_SSTART),
+ SetWindowText(GetDlgItem(hDlg, IDC_SSTART),
g_lpMsg[IDS_MSG_SSTART - IDS_MSG_FIRST]);
- SetWindowText(GetDlgItem(hDlg, IDC_SSTOP),
+ SetWindowText(GetDlgItem(hDlg, IDC_SSTOP),
g_lpMsg[IDS_MSG_SSTOP - IDS_MSG_FIRST]);
- SetWindowText(GetDlgItem(hDlg, IDC_SRESTART),
+ SetWindowText(GetDlgItem(hDlg, IDC_SRESTART),
g_lpMsg[IDS_MSG_SRESTART - IDS_MSG_FIRST]);
- SetWindowText(GetDlgItem(hDlg, IDC_SMANAGER),
+ SetWindowText(GetDlgItem(hDlg, IDC_SMANAGER),
g_lpMsg[IDS_MSG_SERVICES - IDS_MSG_FIRST]);
- SetWindowText(GetDlgItem(hDlg, IDC_SCONNECT),
+ SetWindowText(GetDlgItem(hDlg, IDC_SCONNECT),
g_lpMsg[IDS_MSG_CONNECT - IDS_MSG_FIRST]);
- SetWindowText(GetDlgItem(hDlg, IDC_SEXIT),
+ SetWindowText(GetDlgItem(hDlg, IDC_SEXIT),
g_lpMsg[IDS_MSG_MNUEXIT - IDS_MSG_FIRST]);
if (g_dwOSVersion < OS_VERSION_WINNT)
{
@@ -1177,7 +1177,7 @@
ShowWindow(GetDlgItem(hDlg, IDC_SCONNECT), SW_HIDE);
ShowWindow(GetDlgItem(hDlg, IDC_SDISCONN), SW_HIDE);
}
- hListBox = GetDlgItem(hDlg, IDL_SERVICES);
+ hListBox = GetDlgItem(hDlg, IDL_SERVICES);
g_hwndStdoutList = GetDlgItem(hDlg, IDL_STDOUT);
hStatusBar = CreateStatusWindow(0x0800 /* SBT_TOOLTIPS */
| WS_CHILD | WS_VISIBLE,
@@ -1188,15 +1188,15 @@
while (g_stServices[i].szServiceName != NULL)
{
addListBoxItem(hListBox, g_stServices[i].szDisplayName,
- g_stServices[i].dwPid == 0 ? g_hBmpStop
+ g_stServices[i].dwPid == 0 ? g_hBmpStop
: g_hBmpStart);
++i;
}
}
CenterWindow(hDlg);
ShowWindow(hDlg, SW_SHOW);
- SetFocus(hListBox);
- SendMessage(hListBox, LB_SETCURSEL, 0, 0);
+ SetFocus(hListBox);
+ SendMessage(hListBox, LB_SETCURSEL, 0, 0);
return TRUE;
break;
@@ -1210,8 +1210,8 @@
break;
case WM_UPDATEMESSAGE:
- hListBox = GetDlgItem(hDlg, IDL_SERVICES);
- SendMessage(hListBox, LB_RESETCONTENT, 0, 0);
+ hListBox = GetDlgItem(hDlg, IDL_SERVICES);
+ SendMessage(hListBox, LB_RESETCONTENT, 0, 0);
SendMessage(hStatusBar, SB_SETTEXT, 0, (LPARAM)"");
Button_Enable(GetDlgItem(hDlg, IDC_SSTART), FALSE);
Button_Enable(GetDlgItem(hDlg, IDC_SSTOP), FALSE);
@@ -1220,24 +1220,24 @@
i = 0;
while (g_stServices[i].szServiceName != NULL)
{
- addListBoxItem(hListBox, g_stServices[i].szDisplayName,
+ addListBoxItem(hListBox, g_stServices[i].szDisplayName,
g_stServices[i].dwPid == 0 ? g_hBmpStop : g_hBmpStart);
++i;
}
- SendMessage(hListBox, LB_SETCURSEL, 0, 0);
+ SendMessage(hListBox, LB_SETCURSEL, 0, 0);
/* Dirty hack to bring the window to the foreground */
SetWindowPos(hDlg, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW);
SetWindowPos(hDlg, HWND_NOTOPMOST, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW);
- SetFocus(hListBox);
+ SetFocus(hListBox);
return TRUE;
break;
- case WM_MEASUREITEM:
- lpmis = (LPMEASUREITEMSTRUCT) lParam;
- lpmis->itemHeight = YBITMAP;
- return TRUE;
+ case WM_MEASUREITEM:
+ lpmis = (LPMEASUREITEMSTRUCT) lParam;
+ lpmis->itemHeight = YBITMAP;
+ return TRUE;
case WM_SETCURSOR:
if (g_bConsoleRun) {
@@ -1248,49 +1248,49 @@
}
return TRUE;
- case WM_DRAWITEM:
- lpdis = (LPDRAWITEMSTRUCT) lParam;
- if (lpdis->itemID == -1) {
- break;
- }
- switch (lpdis->itemAction)
- {
- case ODA_SELECT:
- case ODA_DRAWENTIRE:
- g_hBmpPicture = (HBITMAP)SendMessage(lpdis->hwndItem,
+ case WM_DRAWITEM:
+ lpdis = (LPDRAWITEMSTRUCT) lParam;
+ if (lpdis->itemID == -1) {
+ break;
+ }
+ switch (lpdis->itemAction)
+ {
+ case ODA_SELECT:
+ case ODA_DRAWENTIRE:
+ g_hBmpPicture = (HBITMAP)SendMessage(lpdis->hwndItem,
LB_GETITEMDATA,
lpdis->itemID, (LPARAM) 0);
- hdcMem = CreateCompatibleDC(lpdis->hDC);
- g_hBmpOld = SelectObject(hdcMem, g_hBmpPicture);
+ hdcMem = CreateCompatibleDC(lpdis->hDC);
+ g_hBmpOld = SelectObject(hdcMem, g_hBmpPicture);
BitBlt(lpdis->hDC, lpdis->rcItem.left, lpdis->rcItem.top,
lpdis->rcItem.right - lpdis->rcItem.left,
lpdis->rcItem.bottom - lpdis->rcItem.top,
hdcMem, 0, 0, SRCCOPY);
- SendMessage(lpdis->hwndItem, LB_GETTEXT,
- lpdis->itemID, (LPARAM) szBuf);
+ SendMessage(lpdis->hwndItem, LB_GETTEXT,
+ lpdis->itemID, (LPARAM) szBuf);
GetTextMetrics(lpdis->hDC, &tm);
y = (lpdis->rcItem.bottom + lpdis->rcItem.top - tm.tmHeight) / 2;
- SelectObject(hdcMem, g_hBmpOld);
- DeleteDC(hdcMem);
+ SelectObject(hdcMem, g_hBmpOld);
+ DeleteDC(hdcMem);
- rcBitmap.left = lpdis->rcItem.left + XBITMAP + 2;
- rcBitmap.top = lpdis->rcItem.top;
- rcBitmap.right = lpdis->rcItem.right;
- rcBitmap.bottom = lpdis->rcItem.top + YBITMAP;
+ rcBitmap.left = lpdis->rcItem.left + XBITMAP + 2;
+ rcBitmap.top = lpdis->rcItem.top;
+ rcBitmap.right = lpdis->rcItem.right;
+ rcBitmap.bottom = lpdis->rcItem.top + YBITMAP;
- if (lpdis->itemState & ODS_SELECTED)
- {
+ if (lpdis->itemState & ODS_SELECTED)
+ {
if (g_hBmpPicture == g_hBmpStop)
{
Button_Enable(GetDlgItem(hDlg, IDC_SSTART), TRUE);
Button_Enable(GetDlgItem(hDlg, IDC_SSTOP), FALSE);
Button_Enable(GetDlgItem(hDlg, IDC_SRESTART), FALSE);
}
- else if (g_hBmpPicture == g_hBmpStart)
+ else if (g_hBmpPicture == g_hBmpStart)
{
Button_Enable(GetDlgItem(hDlg, IDC_SSTART), FALSE);
Button_Enable(GetDlgItem(hDlg, IDC_SSTOP), TRUE);
@@ -1301,7 +1301,7 @@
Button_Enable(GetDlgItem(hDlg, IDC_SSTOP), FALSE);
Button_Enable(GetDlgItem(hDlg, IDC_SRESTART), FALSE);
}
- if (strcmp(g_stServices[lpdis->itemID].szComputerName,
+ if (strcmp(g_stServices[lpdis->itemID].szComputerName,
g_szLocalHost) == 0) {
Button_Enable(GetDlgItem(hDlg, IDC_SDISCONN), FALSE);
}
@@ -1310,50 +1310,50 @@
}
if (g_stServices[lpdis->itemID].szDescription) {
- SendMessage(hStatusBar, SB_SETTEXT, 0,
+ SendMessage(hStatusBar, SB_SETTEXT, 0,
(LPARAM)g_stServices[lpdis->itemID].szDescription);
}
else {
SendMessage(hStatusBar, SB_SETTEXT, 0, (LPARAM)"");
}
- SetTextColor(lpdis->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));
- SetBkColor(lpdis->hDC, GetSysColor(COLOR_HIGHLIGHT));
+ SetTextColor(lpdis->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));
+ SetBkColor(lpdis->hDC, GetSysColor(COLOR_HIGHLIGHT));
FillRect(lpdis->hDC, &rcBitmap, (HBRUSH)(COLOR_HIGHLIGHTTEXT));
- }
+ }
else
{
- SetTextColor(lpdis->hDC, GetSysColor(COLOR_MENUTEXT));
- SetBkColor(lpdis->hDC, GetSysColor(COLOR_WINDOW));
- FillRect(lpdis->hDC, &rcBitmap, (HBRUSH)(COLOR_WINDOW+1));
- }
- TextOut(lpdis->hDC, XBITMAP + 6, y, szBuf, (int)strlen(szBuf));
- break;
-
- case ODA_FOCUS:
- break;
- }
+ SetTextColor(lpdis->hDC, GetSysColor(COLOR_MENUTEXT));
+ SetBkColor(lpdis->hDC, GetSysColor(COLOR_WINDOW));
+ FillRect(lpdis->hDC, &rcBitmap, (HBRUSH)(COLOR_WINDOW+1));
+ }
+ TextOut(lpdis->hDC, XBITMAP + 6, y, szBuf, (int)strlen(szBuf));
+ break;
+
+ case ODA_FOCUS:
+ break;
+ }
return TRUE;
- case WM_COMMAND:
- switch (LOWORD(wParam))
- {
+ case WM_COMMAND:
+ switch (LOWORD(wParam))
+ {
case IDL_SERVICES:
switch (HIWORD(wParam))
{
case LBN_DBLCLK:
/* if started then stop, if stopped then start */
- hListBox = GetDlgItem(hDlg, IDL_SERVICES);
+ hListBox = GetDlgItem(hDlg, IDL_SERVICES);
nItem = SendMessage(hListBox, LB_GETCURSEL, 0, 0);
if (nItem != LB_ERR)
{
- g_hBmpPicture = (HBITMAP)SendMessage(hListBox,
+ g_hBmpPicture = (HBITMAP)SendMessage(hListBox,
LB_GETITEMDATA,
nItem, (LPARAM) 0);
if (g_hBmpPicture == g_hBmpStop) {
- SendMessage(hDlg, WM_MANAGEMESSAGE, nItem,
+ SendMessage(hDlg, WM_MANAGEMESSAGE, nItem,
SERVICE_CONTROL_CONTINUE);
}
else {
- SendMessage(hDlg, WM_MANAGEMESSAGE, nItem,
+ SendMessage(hDlg, WM_MANAGEMESSAGE, nItem,
SERVICE_CONTROL_STOP);
}
@@ -1362,44 +1362,44 @@
}
break;
- case IDOK:
- EndDialog(hDlg, TRUE);
- return TRUE;
+ case IDOK:
+ EndDialog(hDlg, TRUE);
+ return TRUE;
- case IDC_SSTART:
+ case IDC_SSTART:
Button_Enable(GetDlgItem(hDlg, IDC_SSTART), FALSE);
- hListBox = GetDlgItem(hDlg, IDL_SERVICES);
- nItem = SendMessage(hListBox, LB_GETCURSEL, 0, 0);
+ hListBox = GetDlgItem(hDlg, IDL_SERVICES);
+ nItem = SendMessage(hListBox, LB_GETCURSEL, 0, 0);
if (nItem != LB_ERR) {
- SendMessage(hDlg, WM_MANAGEMESSAGE, nItem,
+ SendMessage(hDlg, WM_MANAGEMESSAGE, nItem,
SERVICE_CONTROL_CONTINUE);
}
Button_Enable(GetDlgItem(hDlg, IDC_SSTART), TRUE);
return TRUE;
- case IDC_SSTOP:
+ case IDC_SSTOP:
Button_Enable(GetDlgItem(hDlg, IDC_SSTOP), FALSE);
- hListBox = GetDlgItem(hDlg, IDL_SERVICES);
- nItem = SendMessage(hListBox, LB_GETCURSEL, 0, 0);
+ hListBox = GetDlgItem(hDlg, IDL_SERVICES);
+ nItem = SendMessage(hListBox, LB_GETCURSEL, 0, 0);
if (nItem != LB_ERR) {
- SendMessage(hDlg, WM_MANAGEMESSAGE, nItem,
+ SendMessage(hDlg, WM_MANAGEMESSAGE, nItem,
SERVICE_CONTROL_STOP);
}
Button_Enable(GetDlgItem(hDlg, IDC_SSTOP), TRUE);
return TRUE;
- case IDC_SRESTART:
+ case IDC_SRESTART:
Button_Enable(GetDlgItem(hDlg, IDC_SRESTART), FALSE);
- hListBox = GetDlgItem(hDlg, IDL_SERVICES);
- nItem = SendMessage(hListBox, LB_GETCURSEL, 0, 0);
+ hListBox = GetDlgItem(hDlg, IDL_SERVICES);
+ nItem = SendMessage(hListBox, LB_GETCURSEL, 0, 0);
if (nItem != LB_ERR) {
- SendMessage(hDlg, WM_MANAGEMESSAGE, nItem,
+ SendMessage(hDlg, WM_MANAGEMESSAGE, nItem,
SERVICE_APACHE_RESTART);
}
Button_Enable(GetDlgItem(hDlg, IDC_SRESTART), TRUE);
return TRUE;
- case IDC_SMANAGER:
+ case IDC_SMANAGER:
if (g_dwOSVersion >= OS_VERSION_WIN2K) {
ShellExecute(hDlg, "open", "services.msc", "/s",
NULL, SW_NORMAL);
@@ -1409,19 +1409,19 @@
}
return TRUE;
- case IDC_SEXIT:
+ case IDC_SEXIT:
EndDialog(hDlg, TRUE);
SendMessage(g_hwndMain, WM_COMMAND, (WPARAM)IDM_EXIT, 0);
return TRUE;
- case IDC_SCONNECT:
+ case IDC_SCONNECT:
DialogBox(g_hInstance, MAKEINTRESOURCE(IDD_DLGCONNECT),
hDlg, (DLGPROC)ConnectDlgProc);
return TRUE;
- case IDC_SDISCONN:
- hListBox = GetDlgItem(hDlg, IDL_SERVICES);
- nItem = SendMessage(hListBox, LB_GETCURSEL, 0, 0);
+ case IDC_SDISCONN:
+ hListBox = GetDlgItem(hDlg, IDL_SERVICES);
+ nItem = SendMessage(hListBox, LB_GETCURSEL, 0, 0);
if (nItem != LB_ERR) {
am_DisconnectComputer(g_stServices[nItem].szComputerName);
SendMessage(g_hwndMain, WM_TIMER, WM_TIMER_RESCAN, 0);
@@ -1431,17 +1431,17 @@
break;
case WM_SIZE:
- switch (LOWORD(wParam))
- {
+ switch (LOWORD(wParam))
+ {
case SIZE_MINIMIZED:
- EndDialog(hDlg, TRUE);
- return TRUE;
+ EndDialog(hDlg, TRUE);
+ return TRUE;
break;
}
break;
case WM_QUIT:
- case WM_CLOSE:
+ case WM_CLOSE:
EndDialog(hDlg, TRUE);
return TRUE;
@@ -1461,7 +1461,7 @@
ShowNotifyIcon(hWnd, NIM_ADD);
return DefWindowProc(hWnd, message, wParam, lParam);
}
- switch (message)
+ switch (message)
{
case WM_CREATE:
GetApacheServicesStatus();
@@ -1565,33 +1565,33 @@
case WM_COMMAND:
if ((LOWORD(wParam) & IDM_SM_START) == IDM_SM_START)
{
- ApacheManageService(g_stServices[LOWORD(wParam)
+ ApacheManageService(g_stServices[LOWORD(wParam)
- IDM_SM_START].szServiceName,
- g_stServices[LOWORD(wParam)
+ g_stServices[LOWORD(wParam)
- IDM_SM_START].szImagePath,
- g_stServices[LOWORD(wParam)
+ g_stServices[LOWORD(wParam)
- IDM_SM_START].szComputerName,
SERVICE_CONTROL_CONTINUE);
return TRUE;
}
else if ((LOWORD(wParam) & IDM_SM_STOP) == IDM_SM_STOP)
{
- ApacheManageService(g_stServices[LOWORD(wParam)
+ ApacheManageService(g_stServices[LOWORD(wParam)
- IDM_SM_STOP].szServiceName,
- g_stServices[LOWORD(wParam)
+ g_stServices[LOWORD(wParam)
- IDM_SM_STOP].szImagePath,
- g_stServices[LOWORD(wParam)
+ g_stServices[LOWORD(wParam)
- IDM_SM_STOP].szComputerName,
SERVICE_CONTROL_STOP);
return TRUE;
}
else if ((LOWORD(wParam) & IDM_SM_RESTART) == IDM_SM_RESTART)
{
- ApacheManageService(g_stServices[LOWORD(wParam)
+ ApacheManageService(g_stServices[LOWORD(wParam)
- IDM_SM_RESTART].szServiceName,
- g_stServices[LOWORD(wParam)
+ g_stServices[LOWORD(wParam)
- IDM_SM_RESTART].szImagePath,
- g_stServices[LOWORD(wParam)
+ g_stServices[LOWORD(wParam)
- IDM_SM_RESTART].szComputerName,
SERVICE_APACHE_RESTART);
return TRUE;
@@ -1612,7 +1612,7 @@
}
break;
- case IDC_SMANAGER:
+ case IDC_SMANAGER:
if (g_dwOSVersion >= OS_VERSION_WIN2K) {
ShellExecute(NULL, "open", "services.msc", "/s",
NULL, SW_NORMAL);
@@ -1648,7 +1648,7 @@
return hWnd;
}
- wcex.cbSize = sizeof(WNDCLASSEX);
+ wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)WndProc;
@@ -1711,17 +1711,17 @@
IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
g_icoRun = LoadImage(hInstance, MAKEINTRESOURCE(IDI_ICORUN),
IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
- g_hCursorHourglass = LoadImage(NULL, MAKEINTRESOURCE(OCR_WAIT),
- IMAGE_CURSOR, LR_DEFAULTSIZE,
+ g_hCursorHourglass = LoadImage(NULL, MAKEINTRESOURCE(OCR_WAIT),
+ IMAGE_CURSOR, LR_DEFAULTSIZE,
LR_DEFAULTSIZE, LR_SHARED);
- g_hCursorArrow = LoadImage(NULL, MAKEINTRESOURCE(OCR_NORMAL),
- IMAGE_CURSOR, LR_DEFAULTSIZE,
+ g_hCursorArrow = LoadImage(NULL, MAKEINTRESOURCE(OCR_NORMAL),
+ IMAGE_CURSOR, LR_DEFAULTSIZE,
LR_DEFAULTSIZE, LR_SHARED);
g_hBmpStart = LoadImage(hInstance, MAKEINTRESOURCE(IDB_BMPRUN),
- IMAGE_BITMAP, XBITMAP, YBITMAP,
+ IMAGE_BITMAP, XBITMAP, YBITMAP,
LR_DEFAULTCOLOR);
g_hBmpStop = LoadImage(hInstance, MAKEINTRESOURCE(IDB_BMPSTOP),
- IMAGE_BITMAP, XBITMAP, YBITMAP,
+ IMAGE_BITMAP, XBITMAP, YBITMAP,
LR_DEFAULTCOLOR);
hMutex = CreateMutex(NULL, FALSE, "APSRVMON_MUTEX");
@@ -1744,7 +1744,7 @@
g_hwndServiceDlg = NULL;
if (g_hwndMain != NULL)
{
- while (GetMessage(&msg, NULL, 0, 0) == TRUE)
+ while (GetMessage(&msg, NULL, 0, 0) == TRUE)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
@@ -1758,8 +1758,8 @@
DestroyIcon(g_icoRun);
DestroyCursor(g_hCursorHourglass);
DestroyCursor(g_hCursorArrow);
- DeleteObject(g_hBmpStart);
- DeleteObject(g_hBmpStop);
+ DeleteObject(g_hBmpStart);
+ DeleteObject(g_hBmpStop);
CoUninitialize();
return 0;
}
Modified: httpd/httpd/branches/2.2.x/support/win32/wintty.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/support/win32/wintty.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/support/win32/wintty.c (original)
+++ httpd/httpd/branches/2.2.x/support/win32/wintty.c Thu Nov 10 07:20:05 2005
@@ -16,7 +16,7 @@
/* --------------------------------------------------------------------
*
- * wintty : a Apache/WinNT support utility for monitoring and
+ * wintty : a Apache/WinNT support utility for monitoring and
* reflecting user feedback from the Apache process via
* stdin/stdout, even as running within the service context.
*
@@ -30,7 +30,7 @@
*
* Also note the isservice detection semantics, which far exceed any
* mechanism we have discovered thus far.
- *
+ *
* --------------------------------------------------------------------
*/
@@ -39,7 +39,7 @@
#include <stdlib.h>
#include <stdio.h>
-const char *options =
+const char *options =
"\nwintty: a utility for echoing the stdin stream to a new console window,\n"
"\teven when invoked from within a service (such as the Apache server.)\n"
"\tAlso reflects the console input back to the stdout stream, allowing\n"
@@ -56,7 +56,7 @@
BOOL verbose = FALSE;
-void printerr(char *fmt, ...)
+void printerr(char *fmt, ...)
{
char str[1024];
va_list args;
@@ -124,7 +124,7 @@
}
else {
timeout = 0;
- }
+ }
break;
case 'v':
verbose = TRUE;
@@ -163,46 +163,46 @@
hstdin = GetStdHandle(STD_INPUT_HANDLE);
if (!hstdin || hstdin == INVALID_HANDLE_VALUE) {
- printerr("GetStdHandle(STD_INPUT_HANDLE) failed (%d)\n",
+ printerr("GetStdHandle(STD_INPUT_HANDLE) failed (%d)\n",
GetLastError());
}
- else if (DuplicateHandle(hproc, hstdin, hproc, &hdup, 0,
+ else if (DuplicateHandle(hproc, hstdin, hproc, &hdup, 0,
isservice, DUPLICATE_SAME_ACCESS)) {
CloseHandle(hstdin);
hstdin = hdup;
}
else {
- printerr("DupHandle(stdin [%x]) failed (%d)\n",
+ printerr("DupHandle(stdin [%x]) failed (%d)\n",
hstdin, GetLastError());
}
hstdout = GetStdHandle(STD_OUTPUT_HANDLE);
if (!hstdout || hstdout == INVALID_HANDLE_VALUE) {
- printerr("GetStdHandle(STD_OUTPUT_HANDLE) failed (%d)\n",
+ printerr("GetStdHandle(STD_OUTPUT_HANDLE) failed (%d)\n",
GetLastError());
}
- else if (DuplicateHandle(hproc, hstdout, hproc, &hdup, 0,
+ else if (DuplicateHandle(hproc, hstdout, hproc, &hdup, 0,
isservice, DUPLICATE_SAME_ACCESS)) {
CloseHandle(hstdout);
hstdout = hdup;
}
else {
- printerr("DupHandle(stdout [%x]) failed (%d)\n",
+ printerr("DupHandle(stdout [%x]) failed (%d)\n",
hstdout, GetLastError());
}
hstderr = GetStdHandle(STD_ERROR_HANDLE);
if (!hstderr || hstderr == INVALID_HANDLE_VALUE) {
- printerr("GetStdHandle(STD_ERROR_HANDLE) failed (%d)\n",
+ printerr("GetStdHandle(STD_ERROR_HANDLE) failed (%d)\n",
GetLastError());
}
- else if (DuplicateHandle(hproc, hstderr, hproc, &hdup, 0,
+ else if (DuplicateHandle(hproc, hstderr, hproc, &hdup, 0,
isservice, DUPLICATE_SAME_ACCESS)) {
CloseHandle(hstderr);
hstderr = hdup;
}
else {
- printerr("DupHandle(stderr [%x]) failed (%d)\n",
+ printerr("DupHandle(stderr [%x]) failed (%d)\n",
hstderr, GetLastError());
}
@@ -211,7 +211,7 @@
*/
if (!FreeConsole())
printerr("FreeConsole() failed (%d)\n", GetLastError());
-
+
if (isservice) {
#ifdef WE_EVER_FIGURE_OUT_WHY_THIS_DOESNT_WORK
hsavedesk = GetThreadDesktop(GetCurrentThreadId());
@@ -229,7 +229,7 @@
hdesk = OpenDesktop("Default", 0, TRUE, MAXIMUM_ALLOWED);
if (!hdesk || hdesk == INVALID_HANDLE_VALUE) {
printerr("OpenDesktop(Default) failed (%d)\n", GetLastError());
- }
+ }
else if (!SetThreadDesktop(hdesk)) {
printerr("SetThreadDesktop(Default) failed (%d)\n", GetLastError());
}
@@ -240,11 +240,11 @@
char appbuff[MAX_PATH];
char *appname = NULL;
char *cmdline = GetCommandLine();
-
+
if (!GetModuleFileName(NULL, appbuff, sizeof(appbuff))) {
appname = appbuff;
}
-
+
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
si.dwFlags = STARTF_USESHOWWINDOW
@@ -262,7 +262,7 @@
* receive their EOF notification.
*/
if (CreateProcess(appname, cmdline, NULL, NULL, TRUE,
- CREATE_SUSPENDED | CREATE_NEW_CONSOLE,
+ CREATE_SUSPENDED | CREATE_NEW_CONSOLE,
NULL, NULL, &si, &pi)) {
CloseHandle(si.hStdInput);
CloseHandle(si.hStdOutput);
@@ -286,8 +286,8 @@
printerr("SetConsoleTitle() failed (%d)\n", GetLastError());
}
- conout = CreateFile("CONOUT$", GENERIC_READ | GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
+ conout = CreateFile("CONOUT$", GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
FALSE, OPEN_EXISTING, 0, NULL);
if (!conout || conout == INVALID_HANDLE_VALUE) {
printerr("CreateFile(CONOUT$) failed (%d)\n", GetLastError());
@@ -297,12 +297,12 @@
}
else if (!SetConsoleMode(conout, conmode = ((conmode | newoutmode)
& ~notoutmode))) {
- printerr("SetConsoleMode(CONOUT, 0x%x) failed (%d)\n",
+ printerr("SetConsoleMode(CONOUT, 0x%x) failed (%d)\n",
conmode, GetLastError());
}
- conin = CreateFile("CONIN$", GENERIC_READ | GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
+ conin = CreateFile("CONIN$", GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
FALSE, OPEN_EXISTING, 0, NULL);
if (!conin || conin == INVALID_HANDLE_VALUE) {
printerr("CreateFile(CONIN$) failed (%d)\n", GetLastError());
@@ -310,9 +310,9 @@
else if (!GetConsoleMode(conin, &conmode)) {
printerr("GetConsoleMode(CONIN) failed (%d)\n", GetLastError());
}
- else if (!SetConsoleMode(conin, conmode = ((conmode | newinmode)
+ else if (!SetConsoleMode(conin, conmode = ((conmode | newinmode)
& ~notinmode))) {
- printerr("SetConsoleMode(CONIN, 0x%x) failed (%d)\n",
+ printerr("SetConsoleMode(CONIN, 0x%x) failed (%d)\n",
conmode, GetLastError());
}
Modified: httpd/httpd/branches/2.2.x/test/cls.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/test/cls.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/test/cls.c (original)
+++ httpd/httpd/branches/2.2.x/test/cls.c Thu Nov 10 07:20:05 2005
@@ -27,7 +27,7 @@
* # - lowercase letter
* & - hex digit
* # - digit
- * * - swallow remaining characters
+ * * - swallow remaining characters
* <x> - exact match for any other character
*/
static int checkmask(const char *data, const char *mask)
Modified: httpd/httpd/branches/2.2.x/test/test_find.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/test/test_find.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/test/test_find.c (original)
+++ httpd/httpd/branches/2.2.x/test/test_find.c Thu Nov 10 07:20:05 2005
@@ -23,7 +23,7 @@
-DSOLARIS2=250 -Wall -DALLOC_DEBUG -DPOOL_DEBUG \
../main/alloc.o ../main/buff.o ../main/util.o \
../ap/libap.a -lsocket -lnsl test_find.c
- *
+ *
* Roy Fielding, 1999
*/
#include <stdio.h>
@@ -73,6 +73,6 @@
? "Yes" : "No");
printf("Enter search item:\n");
}
-
+
exit(0);
}
Modified: httpd/httpd/branches/2.2.x/test/test_limits.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/test/test_limits.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/test/test_limits.c (original)
+++ httpd/httpd/branches/2.2.x/test/test_limits.c Thu Nov 10 07:20:05 2005
@@ -8,17 +8,17 @@
*
* FreeBSD 2.2.x, FreeBSD 3.0, IRIX 5.3, IRIX 6.2:
* gcc -o test_limits test_limits.c
- *
+ *
* Solaris 2.5.1:
* gcc -o test_limits test_limits.c -lsocket -lnsl
- *
+ *
*
* Message-ID: <86...@niobe.ewox.org>
* Date: Fri, 7 Aug 1998 19:04:27 +0200
* Sender: Bugtraq List <BU...@netspace.org>
* From: Dag-Erling Coidan =?ISO-8859-1?Q?Sm=F8rgrav?= <fi...@EWOX.ORG>
* Subject: YA Apache DoS attack
- *
+ *
* Copyright (c) 1998 Dag-Erling Codan Smrgrav
* All rights reserved.
*
Modified: httpd/httpd/branches/2.2.x/test/test_parser.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/test/test_parser.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/test/test_parser.c (original)
+++ httpd/httpd/branches/2.2.x/test/test_parser.c Thu Nov 10 07:20:05 2005
@@ -23,7 +23,7 @@
-DSOLARIS2=250 -Wall -DALLOC_DEBUG -DPOOL_DEBUG \
../main/alloc.o ../main/buff.o ../main/util.o \
../ap/libap.a -lsocket -lnsl test_parser.c
- *
+ *
* Roy Fielding, 1999
*/
#include <stdio.h>
@@ -70,6 +70,6 @@
while ((newstr = ap_get_list_item(p, &field)) != NULL)
printf(" <%s> ..\n", newstr);
}
-
+
exit(0);
}
Modified: httpd/httpd/branches/2.2.x/test/time-sem.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/test/time-sem.c?rev=332309&r1=332308&r2=332309&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/test/time-sem.c (original)
+++ httpd/httpd/branches/2.2.x/test/time-sem.c Thu Nov 10 07:20:05 2005
@@ -111,7 +111,7 @@
void accept_mutex_on(void)
{
int ret;
-
+
while ((ret = fcntl(fcntl_fd, F_SETLKW, &lock_it)) < 0 && errno == EINTR)
continue;
@@ -172,7 +172,7 @@
void accept_mutex_on(void)
{
int ret;
-
+
while ((ret = flock(flock_fd, LOCK_EX)) < 0 && errno == EINTR)
continue;