[PATCH] httpd: add option to send files using gzip content-encoding if available
Peter Korsgaard
jacmet at sunsite.dk
Fri Jul 23 22:23:24 UTC 2010
>>>>> "walter" == walter harms <wharms at bfs.de> writes:
Hi,
>> +#if ENABLE_FEATURE_HTTPD_GZIP
>> + if (supports_gzip) {
>> + char *gzurl;
>> +
>> + /* does <url>.gz exist? Then use it instead */
>> + gzurl = alloca(strlen(url) + strlen(".gz") + 1);
>> + sprintf(gzurl, "%s.gz", url);
walter> you could use
walter> gzurl=xasprintf(%s.gz", url);
walter> fd = open(gzurl, O_RDONLY);
walter> free(gzurl);
Ahh yes, thanks - That saves 55 bytes.
Will send updated patch.
--
Bye, Peter Korsgaard
More information about the busybox
mailing list