On Sun, Aug 9, 2020 at 12:24 AM Sergey Ponomarev <[email protected]> wrote:
> @@ -1071,16 +1079,18 @@ static void send_headers(unsigned responseNum)
>          * always fit into those kbytes.
>          */
>
> -       strftime(date_str, sizeof(date_str), RFC1123FMT, gmtime_r(&timer, 
> &tm));
> -       /* ^^^ using gmtime_r() instead of gmtime() to not use static data */
>         len = sprintf(iobuf,
>                         "HTTP/1.1 %u %s\r\n"
> -                       "Date: %s\r\n"
>                         "Connection: close\r\n",
> -                       responseNum, responseString,
> -                       date_str
> +                       responseNum, responseString
>         );
>
> +#if ENABLE_FEATURE_HTTPD_DATE
> +       strftime(date_str, sizeof(date_str), RFC1123FMT, gmtime_r(&timer, 
> &tm));
> +       /* ^^^ using gmtime_r() instead of gmtime() to not use static data */
> +       len += sprintf(iobuf + len, "Date: %s\r\n", date_str);
> +#endif
> +

This increases code size when FEATURE_HTTPD_DATE=y
(IOW: when functionality does not change)
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to