httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk-Willem van Gulik <di...@webweaving.org>
Subject Re: [PHP-DEV] More on the error under FreeBSD 2.2.8/A-1.3.8/PHP3.0.12
Date Thu, 12 Aug 1999 10:47:35 GMT

What is the best approach;

	rename 'new' uu -> base64 (encode | decode)

Leave in the 
	ap_puuencode(pool, ..
	ap_puudecode(pool, ..

And (for linkers) add a glue

	ap_uuencode(), ap_uudecode()

_OR_ completely drop the 'p' pool prefix in the name, and leave it as an
'odd' one, like it always was.

I am home in a few hours. Comments appreciated as what the right route is.

Dw.

Index: ap/ap_base64.c
===================================================================
RCS file: /x3/home/cvs/apache-1.3/src/ap/ap_base64.c,v
retrieving revision 1.2
diff -u -r1.2 ap_base64.c
--- ap_base64.c	1999/08/08 17:38:45	1.2
+++ ap_base64.c	1999/08/12 10:44:39
@@ -111,7 +111,7 @@
 #endif /*CHARSET_EBCDIC*/
 };
 
-API_EXPORT(int) ap_uudecode_len(const char *bufcoded)
+API_EXPORT(int) ap_base64decode_len(const char *bufcoded)
 {
     int nbytesdecoded;
     register const unsigned char *bufin;
@@ -126,14 +126,14 @@
     return nbytesdecoded + 1;
 }
 
-API_EXPORT(int) ap_uudecode(char *bufplain, const char *bufcoded)
+API_EXPORT(int) ap_base64decode(char *bufplain, const char *bufcoded)
 {
 #ifdef CHARSET_EBCDIC
     int i;
 #endif				/* CHARSET_EBCDIC */
     int len;
     
-    len = ap_uudecode_binary((unsigned char *) bufplain, bufcoded);
+    len = ap_base64decode_binary((unsigned char *) bufplain, bufcoded);
 #ifdef CHARSET_EBCDIC
     for (i=0; i<len; i++)
 	bufplain[i] = os_toebcdic[bufplain[i]];
@@ -141,10 +141,10 @@
     return len;
 }
 
-/* This is the same as ap_uudecode() except on EBCDIC machines, where
+/* This is the same as ap_base64udecode() except on EBCDIC machines, where
  * the conversion of the output to ebcdic is left out.
  */
-API_EXPORT(int) ap_uudecode_binary(unsigned char *bufplain,
+API_EXPORT(int) ap_base64decode_binary(unsigned char *bufplain,
 				   const char *bufcoded)
 {
     int nbytesdecoded;
@@ -193,15 +193,15 @@
 static const char basis_64[] =
 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 
-API_EXPORT(int) ap_uuencode_len(int len)
+API_EXPORT(int) ap_base64encode_len(int len)
 {
     return ((len + 2) / 3 * 4) + 1;
 }
 
-API_EXPORT(int) ap_uuencode(char *encoded, const char *string, int len)
+API_EXPORT(int) ap_base64encode(char *encoded, const char *string, int len)
 {
 #ifndef CHARSET_EBCDIC
-    return ap_uuencode_binary(encoded, (const unsigned char *) string, len);
+    return ap_base64encode_binary(encoded, (const unsigned char *) string, len);
 #else				/* CHARSET_EBCDIC */
     int i;
     char *p;
@@ -231,10 +231,10 @@
 #endif				/* CHARSET_EBCDIC */
 }
 
-/* This is the same as ap_uuencode() except on EBCDIC machines, where
+/* This is the same as ap_base64encode() except on EBCDIC machines, where
  * the conversion of the input to ascii is left out.
  */
-API_EXPORT(int) ap_uuencode_binary(char *encoded, const unsigned char *string,
+API_EXPORT(int) ap_base64encode_binary(char *encoded, const unsigned char *string,
 				   int len)
 {
     int i;
Index: ap/ap_sha1.c
===================================================================
RCS file: /x3/home/cvs/apache-1.3/src/ap/ap_sha1.c,v
retrieving revision 1.7
diff -u -r1.7 ap_sha1.c
--- ap_sha1.c	1999/08/10 11:31:53	1.7
+++ ap_sha1.c	1999/08/12 10:44:41
@@ -379,7 +379,7 @@
     strcpy(out, sha1_id);
 
     /* SHA1 hash is always 20 chars */
-    l = ap_uuencode_binary(out + strlen(sha1_id), digest, sizeof(digest));
+    l = ap_base64encode_binary(out + strlen(sha1_id), digest, sizeof(digest));
     out[l + strlen(sha1_id)] = '\0';
 
     /*
Index: include/ap.h
===================================================================
RCS file: /x3/home/cvs/apache-1.3/src/include/ap.h,v
retrieving revision 1.23
diff -u -r1.23 ap.h
--- ap.h	1999/08/08 11:45:16	1.23
+++ ap.h	1999/08/12 10:44:43
@@ -171,13 +171,13 @@
  * strings are neither. But propably should.
  *
  */
-API_EXPORT(int) ap_uuencode_len(int len);
-API_EXPORT(int) ap_uuencode(char * coded_dst, const char *plain_src,int len_plain_src);
-API_EXPORT(int) ap_uuencode_binary(char * coded_dst, const unsigned char *plain_src,int len_plain_src);
+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_uudecode_len(const char * coded_src);
-API_EXPORT(int) ap_uudecode(char * plain_dst, const char *coded_src);
-API_EXPORT(int) ap_uudecode_binary(unsigned char * plain_dst, const char *coded_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);
 
 /* Password validation, as used in AuthType Basic which is able to cope
  * (based on the prexix) with the SHA1, Apache's internal MD5 and (depending
Index: include/httpd.h
===================================================================
RCS file: /x3/home/cvs/apache-1.3/src/include/httpd.h,v
retrieving revision 1.291
diff -u -r1.291 httpd.h
--- httpd.h	1999/08/09 17:46:38	1.291
+++ httpd.h	1999/08/12 10:44:49
@@ -992,6 +992,9 @@
 API_EXPORT(int) ap_strcasecmp_match(const char *str, const char *exp);
 API_EXPORT(char *) ap_puudecode(pool *, const char *);
 API_EXPORT(char *) ap_puuencode(pool *p, char *string); 
+API_EXPORT(char *) ap_uudecode(pool *, const char *);
+API_EXPORT(char *) ap_uuencode(pool *p, char *string); 
+
 #ifdef OS2
 void os2pathname(char *path);
 char *ap_double_quotes(pool *p, char *str);
Index: main/util.c
===================================================================
RCS file: /x3/home/cvs/apache-1.3/src/main/util.c,v
retrieving revision 1.169
diff -u -r1.169 util.c
--- util.c	1999/08/08 11:45:18	1.169
+++ util.c	1999/08/12 10:44:56
@@ -1964,23 +1964,34 @@
     char *decoded;
     int l;
 
-    decoded = (char *) ap_palloc(p, 1+ap_uudecode_len(bufcoded));
-    l = ap_uudecode(decoded,bufcoded);
+    decoded = (char *) ap_palloc(p, 1+ap_base64decode_len(bufcoded));
+    l = ap_base64decode(decoded,bufcoded);
     decoded[l]='\0'; /* make binary sequence into string */
 
     return decoded;
 }
 
+
 API_EXPORT(char *) ap_puuencode(pool *p, char *string) 
 { 
     char *encoded;
     int l = strlen(string);
 
-    encoded = (char *) ap_palloc(p, 1+ap_uuencode_len(l));
-    l=ap_uuencode(encoded,string,l);
+    encoded = (char *) ap_palloc(p, 1+ap_base64encode_len(l));
+    l=ap_base64encode(encoded,string,l);
     encoded[l]='\0'; /* make binary sequence into string */
 
     return encoded;
+}
+
+API_EXPORT(char *) ap_uudecode(pool *p, const char *bufcoded)
+{
+    return ap_puudecode(p,bufcoded);
+}
+
+API_EXPORT(char *) ap_uuencode(pool *p, char *string) 
+{ 
+    return ap_puuencode(p,string);
 }
 
 #ifdef OS2
Index: support/ab.c
===================================================================
RCS file: /x3/home/cvs/apache-1.3/src/support/ab.c,v
retrieving revision 1.28
diff -u -r1.28 ab.c
--- ab.c	1999/08/08 11:47:47	1.28
+++ ab.c	1999/08/12 10:45:02
@@ -1027,7 +1027,7 @@
 	     */
 	    while(isspace(*optarg))
 		optarg++;
-	    l=ap_uuencode(tmp,optarg,strlen(optarg));
+	    l=ap_base64encode(tmp,optarg,strlen(optarg));
 	    tmp[l]='\0';
 
 	    strncat(auth, "Authorization: basic ", sizeof(auth));
@@ -1040,7 +1040,7 @@
 	     */
 	    while(isspace(*optarg))
 		optarg++;
-	    l=ap_uuencode(tmp,optarg,strlen(optarg));
+	    l=ap_base64encode(tmp,optarg,strlen(optarg));
 	    tmp[l]='\0';
 
 	    strncat(auth, "Proxy-Authorization: basic ", sizeof(auth));


Mime
View raw message