You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "William A. Rowe, Jr." <wr...@rowe-clan.net> on 2001/01/20 23:02:57 UTC
RE: cvs commit: httpd-2.0/support ab.c htpasswd.c
> wrowe 01/01/20 13:42:23
>
> Modified: modules/cache mod_file_cache.c
Sorry, this should have come in multiple patches. It's a WIN32-only
artifact of adding the apr_open APR_XTHREAD argument, except the obvious
apr_stat changes.
> Log:
> The changes required for the APR_FINFO_wanted argument to
> apr_stat/lstat/getfileinfo. These are -NOT- optimal, they
> are simply the required changes to get the server working.
> The size of the patch is a warning about how we need to
> really look at what we are trying to accomplish with all
> of these stat/lstat calls.
> - if (apr_stat(&finfo, file, p) == 0) {
> + if (apr_stat(&finfo, file, APR_FINFO_NORM, p) == APR_SUCCESS) {
As you can see throughout this patch, I've used the non-optimal but
very consistent APR_FINFO_NORM flags, which include all the 'usual'
unix fields. Anywhere that APR_FINFO_NORM appears, we probably could
get away with something much simpler, sometimes nothing more than
APR_FINFO_SIZE. Anyone who wants to trim these down, be my guest.
But be very cautious if it's cached for use somewhere else. The reason
I opted for the 'easy' out was that I nearly bit it on a module that
appeared just to use the size and type in rewrite, but then I noted
we were testing ownership later :-( If you attack this, be thorough!
> Index: mod_include.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.c,v
> retrieving revision 1.88
> retrieving revision 1.89
> diff -u -r1.88 -r1.89
> --- mod_include.c 2001/01/20 05:18:04 1.88
> +++ mod_include.c 2001/01/20 21:42:18 1.89
> @@ -1268,6 +1268,7 @@
> request_rec *rr = NULL;
> int ret=0;
> char *error_fmt = NULL;
> + apr_status_t rv = APR_SUCCESS;
>
> if (!strcmp(tag, "file")) {
> /* be safe; only files in this directory or below
> allowed */
> @@ -1284,7 +1285,8 @@
>
> if (rr->status == HTTP_OK &&
> rr->finfo.protection != 0) {
> to_send = rr->filename;
> - if (apr_stat(finfo, to_send, rr->pool) !=
> APR_SUCCESS) {
> + if (apr_stat(finfo, to_send,
> + APR_FINFO_NORM, rr->pool) !=
> APR_SUCCESS) {
> error_fmt = "unable to get information
> about \"%s\" "
> "in parsed file %s";
> }
> @@ -1297,10 +1299,8 @@
>
> if (error_fmt) {
> ret = -1;
> - /* TODO: pass APLOG_NOERRNO if no apr_stat()
> failure; pass rv from apr_stat()
> - * otherwise
> - */
> - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
> error_fmt, to_send, r->filename);
> + ap_log_rerror(APLOG_MARK, APLOG_ERR | (rv ? 0
> : APLOG_NOERRNO),
> + rv, r, error_fmt, to_send, r->filename);
> }
Sorry, that bad habit of mine, the comment was legit and the patch was
very simple, so I wiped that TODO off the list.
> Index: ab.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/support/ab.c,v
> retrieving revision 1.52
> retrieving revision 1.53
> diff -u -r1.52 -r1.53
> --- ab.c 2001/01/19 07:04:36 1.52
> +++ ab.c 2001/01/20 21:42:23 1.53
> @@ -903,14 +903,14 @@
> static void copyright(void)
> {
> if (!use_html) {
> - printf("This is ApacheBench, Version %s\n",
> AB_VERSION " <$Revision: 1.52 $> apache-2.0");
> + printf("This is ApacheBench, Version %s\n",
> AB_VERSION " <$Revision: 1.53 $> apache-2.0");
> printf("Copyright (c) 1996 Adam Twiss, Zeus
> Technology Ltd, http://www.zeustech.net/\n");
> printf("Copyright (c) 1998-2000 The Apache
> Software Foundation, http://www.apache.org/\n");
> printf("\n");
> }
> else {
> printf("<p>\n");
> - printf(" This is ApacheBench, Version %s
> <i><%s></i> apache-2.0<br>\n", AB_VERSION, "$Revision: 1.52 $");
> + printf(" This is ApacheBench, Version %s
> <i><%s></i> apache-2.0<br>\n", AB_VERSION, "$Revision: 1.53 $");
> printf(" Copyright (c) 1996 Adam Twiss, Zeus
> Technology Ltd, http://www.zeustech.net/<br>\n");
> printf(" Copyright (c) 1998-2000 The Apache
> Software Foundation, http://www.apache.org/<br>\n");
> printf("</p>\n<p>\n");
Folks, what's this? Autoincremeted on CVS commits or some such?
RE: cvs commit: httpd-2.0/support ab.c htpasswd.c
Posted by Gordon Henriksen <go...@actifunds.com>.
On Sat, 20 Jan 2001, William A. Rowe, Jr. wrote:
> > - printf(" This is ApacheBench, Version %s
> > <i><%s></i> apache-2.0<br>\n", AB_VERSION, "$Revision: 1.52 $");
> > + printf(" This is ApacheBench, Version %s
> > <i><%s></i> apache-2.0<br>\n", AB_VERSION, "$Revision: 1.53 $");
>
> Folks, what's this? Autoincremeted on CVS commits or some such?
http://www.loria.fr/~molli/cvs/doc/cvs_12.html
--
Gordon Henriksen
gordon@actifunds.com