yes, but simplifies code. I think that for those who are concerned with one additional sprintf call can just disable the header.
On Sun, 16 Aug 2020 at 00:07, Denys Vlasenko <vda.li...@googlemail.com> wrote: > On Sun, Aug 9, 2020 at 12:24 AM Sergey Ponomarev <stok...@gmail.com> > 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) > -- Sergey Ponomarev <https://linkedin.com/in/stokito>, skype:stokito
_______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox