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 [PATCH 2.0] Short list of stuff to consider pre alpha (since some is broke already)
Date Thu, 27 Apr 2000 17:59:51 GMT
Suggestions (I won't have extra time on this till next week, but really
want to see some of this in the new package, all builds, there is one
odd error left in the win32 build, relating to the poll changes, that
I don't have time to look at) -

1) create an ap_base64.h to extract those declarations from ap.h

2) CORE_PRIVATE doesn't belong in library functions, remove from ap_base64.c

3) use apr headers for declarations in ap.lib stuff
   *** why was this undone in support/htdigest.c, ryan?

4) crossed up declarations of strcasecmp fixed with proper HAVE_STRCASECMP
   declarations where that assignment is made in os/win32/os.h
   Eliminates a ton of compiler errors.

5) clean up windows headers in apr... we really need only a limited subset.
   We can restrict more later.

6) add ap_difftime... but this really points out the weakness of this type!
   I really, really believe that ap_interval_time_t must be 64 bits,
   but that's a patch in and of itself, with some cpu ramifications.

7) fix a lingering ungetch reference.

8) fix up mod_auth_digest.c - but this requires some VERY CAREFUL review.
   Not that it was any good with times before... but let's assure it is right.

9) fix up mod_isapi - lots of flakey things (setting last error to 0? ...
   I don't have time to review today, so created TODO_ERROR to mark those
   that need review.  ERROR didn't mean what the coder intended.)

Index: apache-2.0/src/include/ap_base64.h
=== Begin New File ap_base64.h ====================================
/* ====================================================================
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 2000 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by the
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Apache" and "Apache Software Foundation" must
 *    not be used to endorse or promote products derived from this
 *    software without prior written permission. For written
 *    permission, please contact apache@apache.org.
 *
 * 5. Products derived from this software may not be called "Apache",
 *    nor may "Apache" appear in their name, without prior written
 *    permission of the Apache Software Foundation.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 *
 * The ap_vsnprintf/ap_snprintf functions are based on, and used with the
 * permission of, the  SIO stdio-replacement strx_* functions by Panos
 * Tsirigotis <panos@alumni.cs.colorado.edu> for xinetd.
 */

#ifndef APACHE_BASE64_H
#define APACHE_BASE64_H

#ifdef __cplusplus
extern "C" {
#endif

/* Simple BASE64 encode/decode functions.
 * 
 * As we might encode binary strings, hence we require the length of
 * the incoming plain source. And return the length of what we decoded.
 *
 * The decoding function takes any non valid char (i.e. whitespace, \0
 * or anything non A-Z,0-9 etc as terminal.
 * 
 * plain strings/binary sequences are not assumed '\0' terminated. Encoded
 * strings are neither. But propably should.
 *
 */
API_EXPORT(int) ap_base64encode_len(int len);
API_EXPORT(int) ap_base64encode(char * coded_dst, const char *plain_src,int len_plain_src);
API_EXPORT(int) ap_base64encode_binary(char * coded_dst, const unsigned char *plain_src,int
len_plain_src);

API_EXPORT(int) ap_base64decode_len(const char * coded_src);
API_EXPORT(int) ap_base64decode(char * plain_dst, const char *coded_src);
API_EXPORT(int) ap_base64decode_binary(unsigned char * plain_dst, const char *coded_src);

#ifdef __cplusplus
}
#endif

#endif	/* !APACHE_BASE64_H */
--- End new file ap_base64.h --------------------------------------

Index: apache-2.0/src/ap/ap_base64.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/ap/ap_base64.c,v
retrieving revision 1.6
diff -u -r1.6 ap_base64.c
--- ap_base64.c	2000/04/07 02:45:11	1.6
+++ ap_base64.c	2000/04/27 15:12:57
@@ -62,12 +62,9 @@
  * ugly 'len' functions, which is quite a nasty cost.
  */
 
-#define CORE_PRIVATE
-#include <string.h>
-
 #include "ap.h"
+#include "ap_base64.h"
 
-#include "ap_config.h"
 #ifdef CHARSET_EBCDIC
 #include "ebcdic.h"
 #endif				/* CHARSET_EBCDIC */
Index: apache-2.0/src/ap/ap_sha1.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/ap/ap_sha1.c,v
retrieving revision 1.6
diff -u -r1.6 ap_sha1.c
--- ap_sha1.c	2000/03/31 07:02:31	1.6
+++ ap_sha1.c	2000/04/27 15:12:59
@@ -82,12 +82,11 @@
  *	This code is hereby placed in the public domain
  */
 
-#include <string.h>
 
-#include "ap_config.h"
-#include "httpd.h"
-#include "ap_sha1.h"
 #include "ap.h"
+#include "ap_base64.h"
+#include "ap_sha1.h"
+#include "apr_lib.h"
 #ifdef CHARSET_EBCDIC
 #include "ebcdic.h"
 #endif /*CHARSET_EBCDIC*/
Index: apache-2.0/src/include/ap.h
===================================================================
RCS file: /cvs/apache/apache-2.0/src/include/ap.h,v
retrieving revision 1.10
diff -u -r1.10 ap.h
--- ap.h	2000/03/31 07:18:46	1.10
+++ ap.h	2000/04/27 15:13:00
@@ -50,10 +50,6 @@
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
- *
- * The ap_vsnprintf/ap_snprintf functions are based on, and used with the
- * permission of, the  SIO stdio-replacement strx_* functions by Panos
- * Tsirigotis <panos@alumni.cs.colorado.edu> for xinetd.
  */
 
 #ifndef APACHE_AP_H
@@ -95,26 +91,6 @@
 #ifndef CORE_EXPORT_NONSTD
 #define CORE_EXPORT_NONSTD	API_EXPORT_NONSTD
 #endif
-
-/* Simple BASE64 encode/decode functions.
- * 
- * As we might encode binary strings, hence we require the length of
- * the incoming plain source. And return the length of what we decoded.
- *
- * The decoding function takes any non valid char (i.e. whitespace, \0
- * or anything non A-Z,0-9 etc as terminal.
- * 
- * plain strings/binary sequences are not assumed '\0' terminated. Encoded
- * strings are neither. But propably should.
- *
- */
-API_EXPORT(int) ap_base64encode_len(int len);
-API_EXPORT(int) ap_base64encode(char * coded_dst, const char *plain_src,int len_plain_src);
-API_EXPORT(int) ap_base64encode_binary(char * coded_dst, const unsigned char *plain_src,int
len_plain_src);
-
-API_EXPORT(int) ap_base64decode_len(const char * coded_src);
-API_EXPORT(int) ap_base64decode(char * plain_dst, const char *coded_src);
-API_EXPORT(int) ap_base64decode_binary(unsigned char * plain_dst, const char *coded_src);
 
 #ifdef __cplusplus
 }
Index: apache-2.0/src/main/util.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/main/util.c,v
retrieving revision 1.39
diff -u -r1.39 util.c
--- util.c	2000/04/24 12:00:43	1.39
+++ util.c	2000/04/27 15:13:11
@@ -73,6 +73,7 @@
 
 #include "ap_config.h"
 #include "ap.h"
+#include "ap_base64.h"
 #include "httpd.h"
 #include "http_main.h"
 #include "http_log.h"
Index: apache-2.0/src/modules/standard/mod_auth_digest.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/modules/standard/mod_auth_digest.c,v
retrieving revision 1.13
diff -u -r1.13 mod_auth_digest.c
--- mod_auth_digest.c	2000/04/26 07:14:37	1.13
+++ mod_auth_digest.c	2000/04/27 15:13:19
@@ -94,7 +94,7 @@
 #include "http_request.h"
 #include "http_log.h"
 #include "http_protocol.h"
-#include "ap.h"
+#include "ap_base64.h"
 #include "ap_ctype.h"
 #include "util_uri.h"
 #include "util_md5.h"
Index: apache-2.0/src/os/win32/os.h
===================================================================
RCS file: /cvs/apache/apache-2.0/src/os/win32/os.h,v
retrieving revision 1.21
diff -u -r1.21 os.h
--- os.h	2000/04/14 15:59:17	1.21
+++ os.h	2000/04/27 15:13:23
@@ -131,6 +131,10 @@
 
 #define MODULE_VAR_EXPORT   __declspec(dllexport)
 
+
+#define HAVE_STRCASECMP
+#define HAVE_STRNCASECMP
+
 #define strcasecmp(s1, s2) stricmp(s1, s2)
 #define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
 #define lstat(x, y) stat(x, y)
Index: apache-2.0/src/lib/apr/include/apr.hw
===================================================================
RCS file: /cvs/apache/apache-2.0/src/lib/apr/include/apr.hw,v
retrieving revision 1.6
diff -u -r1.6 apr.hw
--- apr.hw	2000/04/25 21:18:02	1.6
+++ apr.hw	2000/04/27 17:53:33
@@ -61,19 +61,42 @@
 #ifndef APR_H
 #define APR_H
 
+/* Has windows.h already been included?  If so, our preferences don't matter,
+ * but we will still need the winsock things no matter what was included.
+ * If not, include a restricted set of windows headers to our tastes.
+ */
+#ifndef _WINDOWS_
 #ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN
 #endif
 #ifndef _WIN32_WINNT
-/* 
- * Compile the server including all the Windows NT 4.0 header files by 
- * default.
- */
 #define _WIN32_WINNT 0x0400
 #endif
+#ifndef NOUSER
+#define NOUSER
+#endif
+#ifndef NOGDI
+#define NOGDI
+#endif
+#ifndef NONLS
+#define NONLS
+#endif
+#ifndef NOMCX
+#define NOMCX
+#endif
+#ifndef NOIME
+#define NOIME
+#endif
 #include <windows.h>
+/* The _very_few_ missing declarations from the restricted set of win headers
+ * (If this list becomes extensive, re-enable required headers above 
+ */
+#define SW_HIDE             0
+#else /* _WINDOWS_ */
 #include <winsock2.h>
 #include <mswsock.h>
+#endif /* !_WINDOWS_ */
+
 #include <sys/types.h>
 #include <stddef.h>
 #include <stdio.h>
Index: apache-2.0/src/lib/apr/include/apr_private.hw
===================================================================
RCS file: /cvs/apache/apache-2.0/src/lib/apr/include/apr_private.hw,v
retrieving revision 1.11
diff -u -r1.11 apr_private.hw
--- apr_private.hw	2000/04/23 12:06:47	1.11
+++ apr_private.hw	2000/04/27 17:53:34
@@ -65,19 +65,41 @@
 #ifndef APR_CONFIG_H
 #define APR_CONFIG_H
 
+/* Has windows.h already been included?  If so, our preferences don't matter,
+ * but if not, include a restricted set of windows headers to our tastes.
+ */
+#ifndef _WINDOWS_
 #ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN
 #endif
 #ifndef _WIN32_WINNT
-/* 
- * Compile the server including all the Windows NT 4.0 header files by 
- * default.
- */
 #define _WIN32_WINNT 0x0400
 #endif
+#ifndef NOUSER
+#define NOUSER
+#endif
+#ifndef NOGDI
+#define NOGDI
+#endif
+#ifndef NONLS
+#define NONLS
+#endif
+#ifndef NOMCX
+#define NOMCX
+#endif
+#ifndef NOIME
+#define NOIME
+#endif
 #include <windows.h>
+/* The _very_few_ missing declarations from the restricted set of win headers
+ * (If this list becomes extensive, re-enable required headers above 
+ */
+#define SW_HIDE             0
+#else /* _WINDOWS_ */
 #include <winsock2.h>
 #include <mswsock.h>
+#endif /* !_WINDOWS_ */
+
 #include <sys/types.h>
 #include <stddef.h>
 #include <stdio.h>
Index: apache-2.0/src/lib/apr/file_io/win32/pipe.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/lib/apr/file_io/win32/pipe.c,v
retrieving revision 1.15
diff -u -r1.15 pipe.c
--- pipe.c	2000/04/27 11:19:30	1.15
+++ pipe.c	2000/04/27 17:53:32
@@ -101,7 +101,6 @@
     (*in)->pipe = 1;
     (*in)->fname = ap_pstrdup(cont, "PIPE");
     (*in)->timeout = -1;
-    (*in)->ungetchar = -1;
 
     (*out) = (ap_file_t *)ap_pcalloc(cont, sizeof(ap_file_t));
     (*out)->cntxt = cont;
Index: apache-2.0/src/lib/apr/aprlib.def
===================================================================
RCS file: /cvs/apache/apache-2.0/src/lib/apr/aprlib.def,v
retrieving revision 1.24
diff -u -r1.24 aprlib.def
--- aprlib.def	2000/04/24 14:57:53	1.24
+++ aprlib.def	2000/04/27 17:53:30
@@ -249,3 +249,4 @@
 	ap_generate_random_bytes @228
 	ap_strnatcmp @229
 	ap_strnatcasecmp @230
+	ap_difftime @231
Index: apache-2.0/src/lib/apr/include/apr_time.h
===================================================================
RCS file: /cvs/apache/apache-2.0/src/lib/apr/include/apr_time.h,v
retrieving revision 1.18
diff -u -r1.18 apr_time.h
--- apr_time.h	2000/04/16 04:46:56	1.18
+++ apr_time.h	2000/04/27 17:53:34
@@ -71,6 +71,8 @@
 /* intervals for I/O timeouts, in microseconds */
 typedef ap_int32_t ap_interval_time_t;
 
+#define AP_INTERVAL_TIME_MAX 2147483647
+
 #ifdef WIN32
 #define AP_USEC_PER_SEC ((LONGLONG) 1000000)
 #else
@@ -110,6 +112,19 @@
     ap_int32_t tm_isdst; /* daylight saving time */
     ap_int32_t tm_gmtoff; /* seconds east of UTC */
 } ap_exploded_time_t;
+
+/*
+
+=head1 ap_interval_time_t ap_difftime(ap_time_t start, ap_time_t end)
+
+B<return the elapsed time in usec, accurate to little more than +-35 minutes>
+
+    arg 1) the starting time
+    arg 2) the ending time
+
+=cut
+ */
+ap_interval_time_t ap_difftime(ap_time_t start, ap_time_t end);
 
 /*
 
Index: apache-2.0/src/lib/apr/time/unix/time.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/lib/apr/time/unix/time.c,v
retrieving revision 1.24
diff -u -r1.24 time.c
--- time.c	2000/04/14 15:58:53	1.24
+++ time.c	2000/04/27 17:53:36
@@ -55,6 +55,16 @@
 #include "atime.h"
 #include "apr_portable.h"
 
+ap_interval_time_t ap_difftime(ap_time_t start, ap_time_t end)
+{
+    ap_time_t diff = end - start;
+    if (diff < -(ap_time_t) AP_INTERVAL_TIME_MAX)
+        diff = -(ap_time_t) AP_INTERVAL_TIME_MAX;
+    else if (diff > (ap_time_t) AP_INTERVAL_TIME_MAX)
+        diff = (ap_time_t) AP_INTERVAL_TIME_MAX;
+    return (ap_interval_time_t) diff;    
+}
+
 ap_status_t ap_ansi_time_to_ap_time(ap_time_t *result, time_t input)
 {
     *result = (ap_time_t)input * AP_USEC_PER_SEC;
Index: apache-2.0/src/lib/apr/time/win32/time.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/lib/apr/time/win32/time.c,v
retrieving revision 1.10
diff -u -r1.10 time.c
--- time.c	2000/04/14 15:58:54	1.10
+++ time.c	2000/04/27 17:53:37
@@ -103,6 +103,16 @@
     return;
 }
 
+ap_interval_time_t ap_difftime(ap_time_t start, ap_time_t end)
+{
+    ap_time_t diff = end - start;
+    if (diff < -(ap_time_t) AP_INTERVAL_TIME_MAX)
+        diff = -(ap_time_t) AP_INTERVAL_TIME_MAX;
+    else if (diff > (ap_time_t) AP_INTERVAL_TIME_MAX)
+        diff = (ap_time_t) AP_INTERVAL_TIME_MAX;
+    return (ap_interval_time_t) diff;    
+}
+
 ap_status_t ap_ansi_time_to_ap_time(ap_time_t *result, time_t input)
 {
     *result = (ap_time_t) input * AP_USEC_PER_SEC;
Index: apache-2.0/src/modules/standard/mod_auth_digest.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/modules/standard/mod_auth_digest.c,v
retrieving revision 1.13
diff -u -r1.13 mod_auth_digest.c
--- mod_auth_digest.c	2000/04/26 07:14:37	1.13
+++ mod_auth_digest.c	2000/04/27 17:53:53
@@ -94,7 +94,7 @@
 #include "http_request.h"
 #include "http_log.h"
 #include "http_protocol.h"
-#include "ap.h"
+#include "ap_base64.h"
 #include "ap_ctype.h"
 #include "util_uri.h"
 #include "util_md5.h"
@@ -116,7 +116,7 @@
     const char  *realm;
     const char **qop_list;
     AP_SHA1_CTX  nonce_ctx;
-    long         nonce_lifetime;
+    ap_interval_time_t nonce_lifetime;
     const char  *nonce_format;
     int          check_nc;
     const char  *algorithm;
@@ -127,8 +127,8 @@
 
 #define	DFLT_ALGORITHM	"MD5"
 
-#define	DFLT_NONCE_LIFE	300000L	/* millis */
-#define NEXTNONCE_DELTA	30000	/* millis */
+#define	DFLT_NONCE_LIFE	(300 * AP_USEC_PER_SEC)	/* usec */
+#define NEXTNONCE_DELTA	(30  * AP_USEC_PER_SEC)	/* usec */
 
 
 #define NONCE_TIME_LEN	(((sizeof(ap_time_t)+2)/3)*4)
@@ -444,7 +444,7 @@
 static const char *set_qop(cmd_parms *cmd, void *config, const char *op)
 {
     digest_config_rec *conf = (digest_config_rec *) config;
-    const char **tmp;
+    char **tmp;
     int cnt;
 
     if (!strcasecmp(op, "none")) {
@@ -478,9 +478,9 @@
 				      const char *t)
 {
     char *endptr;
-    long  lifetime;
-				/* convert from seconds to millis */
-    lifetime = 1000*strtol(t, &endptr, 10); 
+    ap_interval_time_t lifetime;
+				/* convert from seconds to usec */
+    lifetime = (ap_interval_time_t)(AP_USEC_PER_SEC * strtod(t, &endptr)); 
     if (endptr < (t+strlen(t)) && !ap_isspace(*endptr))
 	return ap_pstrcat(cmd->pool, "Invalid time in AuthDigestNonceLifetime: ", t, NULL);
 
@@ -1281,7 +1281,7 @@
 static int check_nonce(request_rec *r, digest_header_rec *resp,
 		       const digest_config_rec *conf)
 {
-    double dt;
+    ap_interval_time_t dt;
     time_rec nonce_time;
     char tmp, hash[NONCE_HASH_LEN+1];
 
@@ -1308,8 +1308,7 @@
 	return AUTH_REQUIRED;
     }
 
-    dt = r->request_time - nonce_time.time;
-    /* dt = difftime(r->request_time, nonce_time.time); */
+    dt = ap_difftime(r->request_time, nonce_time.time);
     if (conf->nonce_lifetime > 0 && dt < 0) {
 	ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
 		      "Digest: invalid nonce %s received - user attempted "
@@ -1322,8 +1321,8 @@
 	if (dt > conf->nonce_lifetime) {
 	    ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0,r,
 			  "Digest: user %s: nonce expired (%.2lf seconds old - max lifetime %.2lf) - sending new
nonce", 
-			  r->user, ((double)dt)/1000, 
-			  ((double)(conf->nonce_lifetime))/1000);
+			  r->user, (double)(dt / AP_USEC_PER_SEC), 
+			  (double)(conf->nonce_lifetime / AP_USEC_PER_SEC));
 	    note_digest_auth_failure(r, conf, resp, 1);
 	    return AUTH_REQUIRED;
 	}
@@ -1783,7 +1782,7 @@
      */
     if (conf->nonce_lifetime > 0) {
 	/* send nextnonce if current nonce will expire in less than 30 secs */
-	if (difftime(r->request_time, resp->nonce_time) > (conf->nonce_lifetime-NEXTNONCE_DELTA))
{
+	if ((resp->nonce_time - r->request_time) > (conf->nonce_lifetime - NEXTNONCE_DELTA))
{
 	    nextnonce = ap_pstrcat(r->pool, ", nextnonce=\"",
 				   gen_nonce(r->pool, r->request_time,
 					     resp->opaque, r->server, conf),
Index: apache-2.0/src/os/win32/mod_isapi.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/os/win32/mod_isapi.c,v
retrieving revision 1.7
diff -u -r1.7 mod_isapi.c
--- mod_isapi.c	2000/04/15 19:23:08	1.7
+++ mod_isapi.c	2000/04/27 17:54:01
@@ -88,6 +88,10 @@
 /* We use the exact same header file as the original */
 #include <HttpExt.h>
 
+/* TODO: Unknown errors that must be researched for correct codes */
+
+#define TODO_ERROR 1
+
 /* Seems IIS does not enforce the requirement for \r\n termination on HSE_REQ_SEND_RESPONSE_HEADER,
    define this to conform */
 #define RELAX_HEADER_RULE
@@ -370,7 +374,7 @@
     }
 
     if ((writ = ap_rwrite(Buffer, *lpwdwBytes, r)) == EOF) {
-            SetLastError(ERROR); /* TODO: Find the right error code */
+            SetLastError(WSAEDISCON); /* TODO: Find the right error code */
             return FALSE;
     }
 
@@ -453,7 +457,7 @@
                 if (!lf) { /* Huh? Invalid data, I think */
                         ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
                                     "ISA sent invalid headers: %s", r->filename);
-                        SetLastError(ERROR);    /* XXX: Find right error */
+                        SetLastError(TODO_ERROR);
                         return FALSE;
                 }
 
@@ -473,7 +477,7 @@
                 }
 
                 if (!(value = strchr(data, ':'))) {
-                        SetLastError(ERROR);    /* TODO: Find right error */
+                        SetLastError(TODO_ERROR);
                         ap_log_rerror(APLOG_MARK, APLOG_ERR, SERVER_ERROR, r,
                                           "ISA sent invalid headers", r->filename);
                         return FALSE;


Mime
View raw message