httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@lnd.com>
Subject Four Apache-2.0 fixups
Date Tue, 11 Apr 2000 01:13:38 GMT
First up, 'What's up with that???' - these errors were
missing/overlapping...

--- d:apr_errno.h	Sat Apr 08 14:41:20 2000
+++ apr_errno.h	Sat Apr 08 14:09:36 2000
@@ -128,18 +128,22 @@
 #define APR_ANONYMOUS      (APR_OS_START_STATUS + 19)
 #define APR_FILEBASED      (APR_OS_START_STATUS + 20)
 #define APR_KEYBASED       (APR_OS_START_STATUS + 21)
+#define APR_ENOADDRESS     (APR_OS_START_STATUS + 22)
+#define APR_EHOSTNOTFOUND  (APR_OS_START_STATUS + 23)
+#define APR_ENORECOVERY    (APR_OS_START_STATUS + 24)
+#define APR_ENODATA        (APR_OS_START_STATUS + 25)

 /* A simple value to be used to initialze a status variable. */
-#define APR_EINIT          (APR_OS_START_STATUS + 16)
+#define APR_EINIT          (APR_OS_START_STATUS + 26)

 /* Not implemented either because we haven't gotten to it yet, or
  * because it is not possible to do correctly.
  */
-#define APR_ENOTIMPL       (APR_OS_START_STATUS + 17)
+#define APR_ENOTIMPL       (APR_OS_START_STATUS + 27)

 /* Passwords do not match.
  */
-#define APR_EMISMATCH      (APR_OS_START_STATUS + 18)
+#define APR_EMISMATCH      (APR_OS_START_STATUS + 28)

 #ifdef EACCES
 #define APR_EACCES EACCES



Next up, please save us!  For those that haven't implemented
ap_get_server_status...


--- d:mod_status.c	Fri Mar 31 11:45:43 2000
+++ mod_status.c	Sun Apr 09 19:57:00 2000
@@ -103,13 +103,19 @@
       ap_get_server_built(), "<br>\n<hr>\n", NULL);
     ap_rvputs(r, "Current Time: ",
       ap_ht_time(r->pool, ap_now(), DEFAULT_TIME_FORMAT, 0), "<br>\n",
NULL);
-    ap_rprintf(r, "\n%d connections currently being processed\n",
-               server_status->nelts);
+    if (!server_status)
+    {
+        ap_rputs("\nConnection status not available\n", r);
+    }
+    else
+    {
+        ap_rprintf(r, "\n%d connections currently being processed\n",
+                   server_status->nelts);

-    status_rows = (ap_status_table_row_t *) server_status->elts;
-    for (i = 0; i < server_status->nelts; i++) {
-	ap_rprintf(r, "<h2>Connection %ld</h2>\n", status_rows[i].conn_id);
-	    ap_table_do(print_status_value, (void *) r, status_rows[i].data,
NULL);
+	    status_rows = (ap_status_table_row_t *) server_status->elts;
+	    for (i = 0; i < server_status->nelts; i++) {
+		ap_rprintf(r, "<h2>Connection %ld</h2>\n", status_rows[i].conn_id);
+		ap_table_do(print_status_value, (void *) r, status_rows[i].data, NULL);
+	    }
     }
     ap_rputs("</body></html>\n", r);
     return 0;


Here's a quickfix for the ap_stat for Win95 folks...

--- 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;

It is not yet very elegant.  The reason - I'm looking at where to hook a
dynamic kernel32 fixup for functions that don't exist.  You can gather by
the #ifdef what needs to be done yet.

Whatever we do aught to be reasonably extendable for this situation.  I
imagine as we begin to really optimize the engine that we will see more of
these cases.


Finally for win32... I wanted to be able to toggle ONE_PROCESS to debug
without leaving and restarting the IDE...

--- 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