I've revised proposed changes in a apr_uri_t structure (attached).
I think it's better to use "unsigned short" instead of "unsigned char" to store the flags - then the size of that struct is 44 bytes for both Linux (no change here when patch applied due to 4-byte alignment, so no problem with size of a request_rec structure) and NetWare target (i386 architecture). The size of the struct will be the same for NetWare target if compiled with gcc, Watcom and CodeWarrior.
If there is some reason to not confirm, let's discuss.
Thanks, Pavel
--- apr_uri.h.orig Sat Oct 27 00:20:21 2001
+++ apr_uri.h Thu Nov 22 23:59:03 2001
@@ -110,6 +110,11 @@
#define APR_URI_UNP_OMITPATHINFO (1U<<4) /* Show "scheme://[EMAIL
PROTECTED]:port" only */
#define APR_URI_UNP_OMITQUERY (1U<<5) /* Omit the "?queryarg" from
the path */
+/* Flags to set some miscelanous things in apr_uri_t structure: */
+#define APR_URI_FLAG_IS_INITIALIZED (1U<<0) /* has the structure been
initialized */
+#define APR_URI_FLAG_DNS_LOOKED_UP (1U<<1) /* has the DNS been looked up
yet */
+#define APR_URI_FLAG_DNS_RESOLVED (1U<<2) /* has the dns been resolved
yet */
+
typedef struct apr_uri_t apr_uri_t;
/**
@@ -143,12 +148,9 @@
apr_port_t port;
/** has the structure been initialized */
- unsigned is_initialized:1;
-
/** has the DNS been looked up yet */
- unsigned dns_looked_up:1;
/** has the dns been resolved yet */
- unsigned dns_resolved:1;
+ unsigned short flags;
};
/* apr_uri.c */
--- apr_uri.c.orig Sun Aug 19 18:17:42 2001
+++ apr_uri.c Fri Nov 23 00:00:57 2001
@@ -230,7 +230,7 @@
* can be called more than once per request.
*/
memset (uptr, '\0', sizeof(*uptr));
- uptr->is_initialized = 1;
+ uptr->flags = APR_URI_FLAG_IS_INITIALIZED;
/* We assume the processor has a branch predictor like most --
* it assumes forward branches are untaken and backwards are taken. That's
@@ -353,7 +353,7 @@
* can be called more than once per request.
*/
memset (uptr, '\0', sizeof(*uptr));
- uptr->is_initialized = 1;
+ uptr->is_initialized = APR_URI_FLAG_IS_INITIALIZED;
uptr->hostinfo = apr_pstrdup(p, hostinfo);
/* We expect hostinfo to point to the first character of
