aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXabier Oneca <xoneca@gmail.com>2020-10-06 02:32:12 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2020-10-06 02:36:06 +0200
commit535a509846be5087ddd0d6e8fc6399f919942639 (patch)
tree2b464935efd3931b14af5fa6bbfcfb3d6d1ccab9
parenteecd6f7a6c44af48f1c70d383ac87e3200dc1233 (diff)
downloadbusybox-w32-535a509846be5087ddd0d6e8fc6399f919942639.tar.gz
busybox-w32-535a509846be5087ddd0d6e8fc6399f919942639.tar.bz2
busybox-w32-535a509846be5087ddd0d6e8fc6399f919942639.zip
httpd: code shrink
Use decode_base64() from uuencode.c when uudecode/base64 applets are included. That function is bigger than httpd's decodeBase64(), so we use the old one when those applets are disabled. Bloat-o-meter when one of those is enabled: function old new delta handle_incoming_and_exit 2371 2265 -106 Signed-off-by: Xabier Oneca <xoneca@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/httpd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/networking/httpd.c b/networking/httpd.c
index 2946b2a54..961f8cab4 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -1017,6 +1017,12 @@ static char *encodeString(const char *string)
1017 */ 1017 */
1018static void decodeBase64(char *Data) 1018static void decodeBase64(char *Data)
1019{ 1019{
1020# if ENABLE_BASE64 || ENABLE_UUDECODE
1021 /* Call decode_base64() from uuencode.c */
1022 char *eptr = Data;
1023 decode_base64(&eptr, Data);
1024 *eptr = '\0';
1025# else
1020 const unsigned char *in = (const unsigned char *)Data; 1026 const unsigned char *in = (const unsigned char *)Data;
1021 /* The decoded size will be at most 3/4 the size of the encoded */ 1027 /* The decoded size will be at most 3/4 the size of the encoded */
1022 unsigned ch = 0; 1028 unsigned ch = 0;
@@ -1050,6 +1056,7 @@ static void decodeBase64(char *Data)
1050 } 1056 }
1051 } 1057 }
1052 *Data = '\0'; 1058 *Data = '\0';
1059# endif
1053} 1060}
1054#endif 1061#endif
1055 1062