httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <stodd...@raleigh.ibm.com>
Subject Re: Four Apache-2.0 fixups
Date Tue, 11 Apr 2000 14:12:09 GMT
Can't we just call ap_oslevel to make a runtime check?  I'd really rather
not use FindFirstFile when GetFileAttributesEx is available.  I've not
tested it, but I am reasonably sure there will be a significant performance
hit.

Bill

>
> --- d:filestat.c Wed Apr 05 09:22:24 2000
> +++ filestat.c Wed Apr 05 09:20:02 2000
> @@ -128,13 +128,29 @@
>  }
>  ap_status_t ap_stat(ap_finfo_t *finfo, const char *fname, ap_context_t
> *cont)
>  {
> + /* GetFileAttributesEx is arguably faster.  It is not in the Win95
subset.
>      WIN32_FILE_ATTRIBUTE_DATA FileInformation;
> +    is in fact an exact subset of the first entries of:
> +  */
> + WIN32_FIND_DATA FileInformation;
> + HANDLE hFind;
>
>      memset(finfo,'\0', sizeof(*finfo));
>
> +#ifdef DOTO_ByLoadLibrary_GetProcAddress_For_Win98_And_Up
>      if (!GetFileAttributesEx(fname, GetFileExInfoStandard,
> &FileInformation)) {
>          return GetLastError();
>      }
> +#else
> + /* The question is, can we assume fname is not a wildcard, must we test
> it,
> +    or should this be our opportunity to expand the short 8.3 name?
> +  */
> + hFind = FindFirstFile(fname, &FileInformation);
> +    if (hFind == INVALID_HANDLE_VALUE) {
> + return GetLastError();
> + }
> + FindClose(hFind);
> +#endif
>      /* Filetype - Directory or file? */
>      if (FileInformation.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
>          finfo->protection |= S_IFDIR;
>

I actually prefer the way it was done in Apache 1.3. Pass in a command line
option.

>
> --- d:winnt.c Wed Apr 05 23:01:36 2000
> +++ winnt.c Sun Apr 09 18:18:32 2000
> @@ -1835,6 +1835,12 @@
>      return NULL;
>  }
>
> +static const char *set_oneprocess (cmd_parms *cmd, void *dummy)
> +{
> +    one_process = -1;
> +    return NULL;
> +}
> +
>  /* Stub functions until this MPM supports the connection status API */
>
>  API_EXPORT(void) ap_update_connection_status(long conn_id, const char
*key,
> \
> @@ -1864,6 +1870,8 @@
>    "Maximum number of requests a particular child serves before dying." },
>  { "CoreDumpDirectory", set_coredumpdir, NULL, RSRC_CONF, TAKE1,
>    "The location of the directory Apache changes to before dumping
core" },
> +{ "UniProcess", set_oneprocess, NULL, RSRC_CONF, NO_ARGS,
> +  "Run a single Apache process for debugging and halt server on fatal
> error" },
>  { NULL }
>  };
>
>
> If you don't care for UniProcess choose something else.
>
> Hope someone finds them useful.
>


Mime
View raw message