Re: [PATCH 2/4] httpd: Don't add Date header to response

2020-08-31 Thread Sergey Ponomarev
ult but those who don't need it may disable it. On Mon, 31 Aug 2020 at 11:25, Bernd Petrovitsch wrote: > Hi all! > > On Mon, 2020-08-31 at 09:53 +0200, Guillermo Rodriguez Garcia wrote: > [...] > > El sáb., 29 ago. 2020 a las 21:37, Sergey Ponomarev > > () escribió: >

Re: [PATCH 2/4] httpd: Don't add Date header to response

2020-08-29 Thread Sergey Ponomarev
to know what people is > using it for since it is mandated by RFC2616 and thus can be assumed > to be always there. > > Guillermo > > El dom., 9 ago. 2020 a las 0:24, Sergey Ponomarev > () escribió: > > > > In RFC 2616 sec. 14.18 said that sever MUST send Date heade

Re: [PATCH 2/4] httpd: Don't add Date header to response

2020-08-15 Thread Sergey Ponomarev
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 wrote: > On Sun, Aug 9, 2020 at 12:24 AM Sergey Ponomarev > wrote: > > @@ -1071,16 +1079,18 @@ static void

[PATCH 0/4] HTTPD: Add caching

2020-08-08 Thread Sergey Ponomarev
/busybox/commits/caching Sergey Ponomarev (4): httpd: Update to HTTP/1.1 httpd: Don't add Date header to response httpd: Don't add Last-Modified header to response httpd: Support caching via ETag header networking/httpd.c | 131 ++--- 1 file changed

[PATCH 1/4] httpd: Update to HTTP/1.1

2020-08-08 Thread Sergey Ponomarev
HTTP v1.1 was released in 1999 year and it's time to update BB HTTPD. Browsers may behave badly with HTTP/1.0 E.g. Chrome not sends the If-None-Match header with ETag. Signed-off-by: Sergey Ponomarev --- networking/httpd.c | 16 1 file changed, 8 insertions(+), 8 deletions

[PATCH 2/4] httpd: Don't add Date header to response

2020-08-08 Thread Sergey Ponomarev
In RFC 2616 sec. 14.18 said that sever MUST send Date header. But in fact the header have sense only for Cache-Control and can be omitted. In the same time the Date eats power, CPU and network resources which are critical for embedded systems. Signed-off-by: Sergey Ponomarev --- networking

[PATCH 4/4] httpd: Support caching via ETag header

2020-08-08 Thread Sergey Ponomarev
t;hex(last_mod)-hex(file_size)" e.g. "5e132e20-417" (with quotes). That means that it's not completely reliable as hash functions but fair enough. The same form of ETag is used by Nginx so load balancing of static content is safe. Signed-off-by: Sergey Ponomarev --- net

[PATCH 3/4] httpd: Don't add Last-Modified header to response

2020-08-08 Thread Sergey Ponomarev
can use ETag header. This simplifies logic and the only downside is that in JavaScript the document.lastModified will return null. Signed-off-by: Sergey Ponomarev --- networking/httpd.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/networking/httpd.c

Re: [PATCH 4/5] httpd_indexcgi.c: Remove new lines in HTML

2020-07-31 Thread Sergey Ponomarev
Yes, it looks worse but you can see the resulting DOM tree instead (elements/inspector). TBH as a web developer I almost never looked into raw source and always watch the DOM tree. On Fri, Jul 31, 2020 at 19:29 Denys Vlasenko wrote: > On Fri, Jul 10, 2020 at 9:50 PM Sergey Ponomarev >

Re: [PATCH 3/5] httpd_indexcgi.c: Simplify CSS

2020-07-31 Thread Sergey Ponomarev
the colors I selected because they are shorter and simpler. We may keep hex colors instead On Fri, 31 Jul 2020 at 19:25, Denys Vlasenko wrote: > On Fri, Jul 10, 2020 at 9:50 PM Sergey Ponomarev > wrote: > > Divide table to thead, tbody and tfoot as it should be in DOM. > > A

Re: Add httpd directory list support & conspy fix

2020-07-05 Thread Sergey Ponomarev
This is an old topic where Pascal proposed a patch that allows to run a script to list the directory with httpd http://hg.slitaz.org/wok/raw-file/3dc7c4a7f5ef/busybox/stuff/busybox-1.18-httpd.u Denys said: > This is already supported: > * If directory URL is given, no index.html is found

[PATCH 4/5] httpd_indexcgi.c: Remove new lines in HTML

2020-07-10 Thread Sergey Ponomarev
Nobody sees them, source code is here, resulted DOM can be seen in web inspector Signed-off-by: Sergey Ponomarev --- networking/httpd_indexcgi.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/networking/httpd_indexcgi.c b/networking/httpd_indexcgi.c index

[PATCH 1/5] httpd_indexcgi.c: minimize style CSS

2020-07-10 Thread Sergey Ponomarev
Remove new lines \n and some semicolons ;. This minimize page style size from 655 to 604 Signed-off-by: Sergey Ponomarev --- networking/httpd_indexcgi.c | 74 ++--- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/networking/httpd_indexcgi.c b

[PATCH 0/5] Simplify httpd_indexcgi

2020-07-10 Thread Sergey Ponomarev
The httpd_indexcgi can generate more compact and proper HTML. Sergey Ponomarev (5): httpd_indexcgi.c: minimize style CSS httpd_indexcgi.c: use CSS for odd/even rows httpd_indexcgi.c: Simplify CSS httpd_indexcgi.c: Remove new lines in HTML httpd_indexcgi.c: Simplify columns CSS style

[PATCH 5/5] httpd_indexcgi.c: Simplify columns CSS style

2020-07-10 Thread Sergey Ponomarev
Colgroup is used only to group/merge columns and not needed here. Signed-off-by: Sergey Ponomarev --- networking/httpd_indexcgi.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/networking/httpd_indexcgi.c b/networking/httpd_indexcgi.c index 8978a9c1a

[PATCH 3/5] httpd_indexcgi.c: Simplify CSS

2020-07-10 Thread Sergey Ponomarev
Divide table to thead, tbody and tfoot as it should be in DOM. Add row hover style. Use short color names. Signed-off-by: Sergey Ponomarev --- networking/httpd_indexcgi.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/networking/httpd_indexcgi.c b

[PATCH 2/5] httpd_indexcgi.c: use CSS for odd/even rows

2020-07-10 Thread Sergey Ponomarev
Signed-off-by: Sergey Ponomarev --- networking/httpd_indexcgi.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/networking/httpd_indexcgi.c b/networking/httpd_indexcgi.c index f5f18959d..a94d4983e 100644 --- a/networking/httpd_indexcgi.c +++ b/networking

[PATCH 0/4] HTTPD: Add caching

2020-07-09 Thread Sergey Ponomarev
. But the logic is not implemented yes so this makes even worse and more resources are spent: browsers always invalidates their cache, date is formatted for each response and transmitted over networks twice. This set of patches implements caching in most simplest and fastest way. Sergey Ponomarev (4

[PATCH 3/4] httpd: Support caching via 'ETag:' header

2020-07-09 Thread Sergey Ponomarev
-by: Sergey Ponomarev --- networking/httpd.c | 49 +++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/networking/httpd.c b/networking/httpd.c index 97b61fb77..50a837229 100644 --- a/networking/httpd.c +++ b/networking/httpd.c @@ -214,6 +214,14

[PATCH 4/4] httpd: update to HTTP/1.1

2020-07-09 Thread Sergey Ponomarev
The ETag header was introduced in HTTP v1.1 in 1999 year. Chrome not send the If-None-Match header if server uses old HTTP/1.0 protocol. Signed-off-by: Sergey Ponomarev --- networking/httpd.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/networking

[PATCH 2/4] httpd: send ETag header instead of Last-Modified

2020-07-09 Thread Sergey Ponomarev
the last mod date can be passed via ETag header as a raw unix timestamp. This simplifies logic and the only downside is that in JavaScript the document.lastModified will return null which is not a big deal. Signed-off-by: Sergey Ponomarev --- networking/httpd.c | 11 +++ 1 file changed, 3

[PATCH 1/4] httpd: do not send useless Date header

2020-07-09 Thread Sergey Ponomarev
of cache aging and it makes sense only for generated content. We can use ETag instead. In the same time the Date eats power, CPU and network resources which are critical for embedded systems. Signed-off-by: Sergey Ponomarev --- networking/httpd.c | 6 +- 1 file changed, 1 insertion(+), 5

[PATCH v3 1/1] httpd: Support caching via 'ETag:' header

2020-07-12 Thread Sergey Ponomarev
t;hex(last_mod)-hex(file_size)" e.g. "5e132e20-417" (with quotes). That means that it's not completely reliable as hash functions but fair enough. The same form of ETag is used by Nginx so load balancing of static content is safe. Signed-off-by: Sergey Ponomarev --- net

Re: [PATCH 1/4] httpd: do not send useless Date header

2020-07-12 Thread Sergey Ponomarev
walled systems. > They would loose the ability to set their time. > http://www.vervest.org/htp/ > -- Sergey Ponomarev <https://linkedin.com/in/stokito>, skype:stokito ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox

Re: [PATCH 3/4] httpd: Support caching via 'ETag:' header

2020-07-11 Thread Sergey Ponomarev
od) { > > + send_headers_and_exit(HTTP_NOT_MODIFIED); > > + log_and_exit(); > > Here this log_and_exit() is redundant. It is already called from > send_headers_and_exit(). > > Cheers, > > Xabier Oneca_,,_ > -- Sergey Ponomarev <ht

[PATCH 5/5] httpd: Support multiple ETag in If-None-Match

2020-07-20 Thread Sergey Ponomarev
The If-None-Match header many have multiple ETags https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26 Even if httpd returns a single ETag clients may want to send few of them. Since ETags are always quoted the easiest way to check is just to check a substring. Signed-off-by: Sergey

Re: [PATCH 4/4] httpd: Support caching via ETag header

2020-08-15 Thread Sergey Ponomarev
it configurable: Subject: [PATCH] httpd: Make Deny/Allow by IP config support optional Signed-off-by: Sergey Ponomarev --- networking/httpd.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/networking/httpd.c b/networking/httpd.c index 0297cf9ec..7ddf6caaa

[PATCH 2/6] httpd: Match If-Modified-Since and Last-Modified to return 304

2021-01-09 Thread Sergey Ponomarev
. If-Modified-Since 2 Jan but Last-Modified is 1 Jan. Since we don't make an actual date comparison then server will send 200 while it might send 304. But such cases will never occur with usual browser and while this case is supported by spec we can ignore it. Signed-off-by: Sergey Ponomarev

[PATCH 3/6] httpd: Match If-Modified-Since only when If-None-Match is not present

2021-01-09 Thread Sergey Ponomarev
It doesn't make sense to check If-Modified-Since if If-None-Match has a value but wasn't matched. https://tools.ietf.org/html/rfc7232#section-3.3 Signed-off-by: Sergey Ponomarev --- networking/httpd.c | 29 ++--- 1 file changed, 18 insertions(+), 11 deletions(-) diff

[PATCH 5/6] Fix Content-type header name to Content-Type

2021-01-09 Thread Sergey Ponomarev
It's better to return header names in proper case because they may be improperly parsed on client's side e.g. it may be some case sensitive comparison in some shell script. Signed-off-by: Sergey Ponomarev --- networking/httpd.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions

[PATCH 1/6] httpd: Last-Modified optimization

2021-01-09 Thread Sergey Ponomarev
The date_str variable used for formatting both Date and Last-Modified headers. Now it only used for Date header and Last-Modified is stored in globals.last_mod_date near to ETag Signed-off-by: Sergey Ponomarev --- networking/httpd.c | 23 +-- 1 file changed, 17 insertions

[PATCH 4/6] httpd: Add Last-Modified only if resource returned with 200

2021-01-09 Thread Sergey Ponomarev
headers: * Content-Type * Accept-Ranges: bytes * Last-Modified * ETag All those headers will be stored by client and in browsers JavaScript will anyway return correct document.lastModified and document.contentType Signed-off-by: Sergey Ponomarev --- networking/httpd.c | 60

[PATCH 6/6] httpd_post_upload.cgi: use mktemp to avoid $RANDOM

2021-01-09 Thread Sergey Ponomarev
The $RANDOM variable may be disabled on ash compilation but we can safelly use mktemp instead. Signed-off-by: Sergey Ponomarev --- networking/httpd_post_upload.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/networking/httpd_post_upload.cgi b/networking

[PATCH 0/6] httpd: Match If-Modified-Since and Last-Modified to return 304

2021-01-09 Thread Sergey Ponomarev
8080 -h "$WWW_DIR" echo 'curl will return 304 Not Modified with ETag: "5fee6600-4f":' curl -s -I 'http://localhost:8080/last-mod.html' \ --header 'If-None-Match: "5fee6600-4f"' \ --header 'If-Modified-Since: Fri, 01 Jan 2021 00:00:00 GMT' The two last commits

Re: [PATCH] wget: new option FEATURE_WGET_FTP to enable/disable FTP

2021-01-17 Thread Sergey Ponomarev
anuary 18, 2021, Sergey Ponomarev wrote: > > Introduce a separate option FTPS_SUPPORTED instead of not obvious > ENABLE_FEATURE_WGET_HTTPS. > > > > I juat wonder... > If you are bothered to add FTP configure option, how about making FTPS > separate from HTTPS a

[PATCH] wget: new option FEATURE_WGET_FTP to enable/disable FTP

2021-01-17 Thread Sergey Ponomarev
-- (add/remove: 0/7 grow/shrink: 0/3 up/down: 0/-1256) Total: -1256 bytes Signed-off-by: Sergey Ponomarev --- networking/wget.c | 43 --- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/networking/wget.c b/networking/wget.c index

[PATCH 1/1] httpd_indexcgi.c and httpd_ssi.c: compile them as applets

2021-08-22 Thread Sergey Ponomarev
't contain any newline symbol. Signed-off-by: Sergey Ponomarev --- networking/httpd_indexcgi.c | 36 +++-- networking/httpd_ssi.c | 46 +++-- 2 files changed, 73 insertions(+), 9 deletions(-) diff --git a/networking/httpd_indexcgi.c b/

[PATCH 2/4] httpd_indexcgi.c and httpd_ssi.c: fix description

2021-08-23 Thread Sergey Ponomarev
Signed-off-by: Sergey Ponomarev --- networking/httpd_indexcgi.c | 12 networking/httpd_ssi.c | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/networking/httpd_indexcgi.c b/networking/httpd_indexcgi.c index 53d316d05..34429e9c5 100644 --- a/networking

[PATCH 3/4] httpd_indexcgi.c simplify style

2021-08-23 Thread Sergey Ponomarev
the first row after header white. Signed-off-by: Sergey Ponomarev --- networking/httpd_indexcgi.c | 39 ++--- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/networking/httpd_indexcgi.c b/networking/httpd_indexcgi.c index 34429e9c5..548f982ef

[PATCH 4/4] httpd_indexcgi.c fix Content-Type

2021-08-23 Thread Sergey Ponomarev
ot; header. But it will be better to include the directly into generated HTML so we won't be lost it when HTML file is saved on disk. Signed-off-by: Sergey Ponomarev --- networking/httpd_indexcgi.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/networking/httpd_indexcgi.c b/

[PATCH 2/4] Revert 2aeb201 "libbb: new option FEATURE_ETC_SERVICES"

2021-08-25 Thread Sergey Ponomarev
and telnet may do need to make the lookup. I.e. they are clients which don't know for sure which port must be used. Signed-off-by: Sergey Ponomarev --- include/libbb.h | 5 - libbb/Config.src | 12 networking/isrv_identd.c | 3 +-- networking/telnet.c | 3

[PATCH 1/4] httpd and telnetd: Make default port configurable

2021-08-25 Thread Sergey Ponomarev
l: 8 bytes textdata bss dec hex filename 1869364027 69256 260219 3f87b busybox_old 1869444027 69256 260227 3f883 busybox_unstripped Signed-off-by: Sergey Ponomarev --- networking/httpd.c | 31 ++- networking/telnetd.c | 16 +

[PATCH 4/4] bb_lookup_port(): return 0 if lookup failed

2021-08-25 Thread Sergey Ponomarev
is always zero we may remove the param Signed-off-by: Sergey Ponomarev --- include/libbb.h| 9 +++-- libbb/xconnect.c | 11 +++ networking/nc.c| 4 ++-- networking/nc_bloaty.c | 6 ++ networking/tcpudp.c| 2 +- networking/telnet.c| 2 +- 6 files

[PATCH 3/4] Don't use bb_lookup_port() for well known ports

2021-08-25 Thread Sergey Ponomarev
() is still used for nc and tcpudp because there we do expect port names. Signed-off-by: Sergey Ponomarev --- networking/ftpgetput.c | 3 ++- networking/tftp.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c index 30b3dabd1

Re: [PATCH 2/4] Revert 2aeb201 "libbb: new option FEATURE_ETC_SERVICES"

2021-09-09 Thread Sergey Ponomarev
Just do not select FEATURE_ETC_SERVICES. > > On Wed, Aug 25, 2021 at 10:14 PM Sergey Ponomarev wrote: > > > > Don't lookup /etc/services for well known ports. > > In the commit was added a new function bb_lookup_std_port(). > > The function is in fact not needed

Re: [PATCH 3/4] Don't use bb_lookup_port() for well known ports

2021-09-09 Thread Sergey Ponomarev
Vlasenko wrote: > > On Wed, Aug 25, 2021 at 10:15 PM Sergey Ponomarev wrote: > > The bb_lookup_port() function may resolve port by its name. > > But for FTP or TFTP no any names are expected because they work only with > > one protocol. > > E.g. it doesn't make any s

Re: [PATCH 4/4] bb_lookup_port(): return 0 if lookup failed

2021-09-09 Thread Sergey Ponomarev
("bad local port '%s'", str_p); Also passing a zero port into xhost2sockaddr() will also make process die On Thu, 9 Sept 2021 at 23:03, Denys Vlasenko wrote: > > On Wed, Aug 25, 2021 at 10:15 PM Sergey Ponomarev wrote: > > Unlike xatou16() the bb_lookup_port() won't e

Re: wget --spider

2021-09-30 Thread Sergey Ponomarev
ant. I've never used sed that > much but awk is a tool I use a lot; that's why I rewrote the one-liner > that way. You may have to get a newer version of BusyBox. > > Doug Clapp > > ___ > busybox mailing list > busybox@busybox.ne

Re: wget command does not work

2021-09-21 Thread Sergey Ponomarev
uld guide me with this problem, > > Regards, > Sukreet > ___ > busybox mailing list > busybox@busybox.net > http://lists.busybox.net/mailman/listinfo/busybox -- Sergey Ponomarev, skype:stokito __

[PATCH] wget: Support --user and --password options

2022-05-08 Thread Sergey Ponomarev
-- (add/remove: 0/0 grow/shrink: 8/0 up/down: 159/0) Total: 159 bytes textdata bss dec hex filename 16408837471688 169523 29633 busybox_old 16424737471688 169682 296d2 busybox_unstripped Signed-off-by: Sergey Ponomarev

[PATCH 2/2] wget: Support of --method, --body-data and --body-file

2022-05-08 Thread Sergey Ponomarev
dec hex filename 17745239711688 183111 2cb47 busybox_old 17752339711688 183182 2cb8e busybox_unstripped Signed-off-by: Sergey Ponomarev --- networking/wget.c | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/networking/wget

[PATCH 1/2] wget: Use HEAD for --spider

2022-05-08 Thread Sergey Ponomarev
  Total: 31 bytes text    data bss dec hex filename 177416    3971    1688  183075   2cb23 busybox_old 177447    3971    1688  183106   2cb42 busybox_unstripped Signed-off-by: Sergey Ponomarev --- networking/wget.c | 15 +-- 1 file changed, 13 insertions(+), 2 d