[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox-cvs
Subject: [git commit] httpd: code shrink
From: Denys Vlasenko <vda.linux () googlemail ! com>
Date: 2020-10-06 0:36:06
Message-ID: 20201006002651.3002A8EB80 () busybox ! osuosl ! org
[Download RAW message or body]
commit: https://git.busybox.net/busybox/commit/?id=535a509846be5087ddd0d6e8fc6399f919942639
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master
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>
---
networking/httpd.c | 7 +++++++
1 file changed, 7 insertions(+)
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)
*/
static void decodeBase64(char *Data)
{
+# if ENABLE_BASE64 || ENABLE_UUDECODE
+ /* Call decode_base64() from uuencode.c */
+ char *eptr = Data;
+ decode_base64(&eptr, Data);
+ *eptr = '\0';
+# else
const unsigned char *in = (const unsigned char *)Data;
/* The decoded size will be at most 3/4 the size of the encoded */
unsigned ch = 0;
@@ -1050,6 +1056,7 @@ static void decodeBase64(char *Data)
}
}
*Data = '\0';
+# endif
}
#endif
_______________________________________________
busybox-cvs mailing list
busybox-cvs@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic