Re: [PATCH 3/3] uclient-fetch: Support for WebDAV methods

2023-04-08 Thread Sergey Ponomarev
-declared inside of the uclient and ideally this should be changed to be more flexible. But this may break backward compatibility. On Sat, Apr 8, 2023 at 1:00 AM Elliott Mitchell wrote: > > On Fri, Apr 07, 2023 at 12:39:09AM +0300, Sergey Ponomarev wrote: > > The WebDAV is an extens

[PATCH 2/3] uclient-fetch: Simplify uclient_request_supports_body()

2023-04-06 Thread Sergey Ponomarev
Only GET and HEAD shouldn't have a body Signed-off-by: Sergey Ponomarev --- uclient-http.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/uclient-http.c b/uclient-http.c index 80d4495..02bb7c2 100644 --- a/uclient-http.c +++ b/uclient-http.c @@ -292,14 +292,7

[PATCH 1/3] uclient-fetch: Make request_types sorted to optimize search

2023-04-06 Thread Sergey Ponomarev
Signed-off-by: Sergey Ponomarev --- uclient-http.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/uclient-http.c b/uclient-http.c index c2bba6b..80d4495 100644 --- a/uclient-http.c +++ b/uclient-http.c @@ -40,11 +40,11 @@ enum auth_type { }; enum

[PATCH 3/3] uclient-fetch: Support for WebDAV methods

2023-04-06 Thread Sergey Ponomarev
The WebDAV is an extension for HTTP for shared folders. In order to make wget working with it we have to declare the missing constants with methods. They don't take part in a logic except of OPTIONS methods that can't have a body. Signed-off-by: Sergey Ponomarev --- uclient-http.c | 18

[PATCH 1/5] uclient-fetch: --header: handle alloc error

2023-04-06 Thread Sergey Ponomarev
Signed-off-by: Sergey Ponomarev --- uclient-fetch.c | 5 + 1 file changed, 5 insertions(+) diff --git a/uclient-fetch.c b/uclient-fetch.c index f9f0174..30440b3 100644 --- a/uclient-fetch.c +++ b/uclient-fetch.c @@ -650,6 +650,11 @@ int main(int argc, char **argv

Re: [PATCH 1/4] uclient-fetch: --header option to pass additional raw HTTP headers

2022-06-24 Thread Sergey Ponomarev
in this version: it makes code slightly complicated and slower. But you can achieve your goal by doing --method=POST --post-data="OLOLO" --header 'Content-type: foo/bar' On Thu, 23 Jun 2022 at 09:20, Andre Heider wrote: > > On 22/06/2022 12:26, Sergey Ponomarev wrote: > > H

Re: [PATCH 1/4] uclient-fetch: --header option to pass additional raw HTTP headers

2022-06-22 Thread Sergey Ponomarev
; > > > a minor nitpick inline below. > > > > On 5/9/22 11:59 PM, Sergey Ponomarev wrote: > >> You can add a custom HTTP header(s) to request: > >> > >> wget --header='Authorization: Bearer TOKEN' \ > >> --header='If-Modified-Since: W

[PATCH 4/4] uclient-fetch: Support of --method, --body-data and --body-file

2022-05-09 Thread Sergey Ponomarev
ers like Authorization and Host. For me this seems like a dangerous practice. If someone wants to send a POST request with a custom CT then instead of --post-data and --header they should use --method=POST --body-data and --header. This will make the request explicit. Signed-o

[PATCH 3/4] uclient-fetch: Use HEAD for --spider

2022-05-09 Thread Sergey Ponomarev
s behaviour later. [1] https://www.gnu.org/software/wget/manual/wget.html#index-spider [2] https://httpwg.org/specs/rfc7231.html#HEAD [3] https://git.savannah.gnu.org/cgit/wget.git/tree/src/http.c#n4304 [4] https://savannah.gnu.org/bugs/index.php?56808 Signed-off-by: Sergey Ponomarev --- ucli

[PATCH 1/4] uclient-fetch: --header option to pass additional raw HTTP headers

2022-05-09 Thread Sergey Ponomarev
may override them but it's a protection from user itself. To keep code concise the logic omitted. Signed-off-by: Sergey Ponomarev --- tests/cram/test-san_uclient-fetch.t | 1 + tests/cram/test_uclient-fetch.t | 1 + uclient-fetch.c | 16 +++ uclient-http.c

[PATCH 0/3] Make wget useful for API calls i.e. goodbye curl.

2022-05-09 Thread Sergey Ponomarev
: allow to overwrite Content-Type header for POST * 2016-06-17 [LEDE-DEV,uclient] enable --post-file, use "Content-Length" instead of chunked encoding I added peoples from that discussions so they can review. Sergey Ponomarev (2): uclient-fetch: Extract opt_post variable uclient-fetc

[PATCH 2/4] uclient-fetch: Extract opt_post variable

2022-05-09 Thread Sergey Ponomarev
The var means that ether --post-data or --post-file was set. Remove duplicated code to set header "Content-Type: application/x-www-form-urlencoded" Signed-off-by: Sergey Ponomarev --- uclient-fetch.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/uclie

[PATCH] uclient-fetch: Support of --server-response [Draft/WIP/Help needed]

2022-05-09 Thread Sergey Ponomarev
The -S is useful for debugging. With --spider or --method=HEAD it allows check size before download by Content-Length header. TODO currently the uclient-http must somehow to call a callback to print. Signed-off-by: Sergey Ponomarev --- uclient-fetch.c | 12 +++- uclient-http.c | 3

Re: Re: Pre-install MiniUPnPd on OpenWrt by default

2022-01-29 Thread Sergey Ponomarev
As a follow up I asked in a dev chat: Hi, Is there any process of deciding what to include into OpenWrt builds by default? I sent a letter to devlist "Pre-install MiniUPnPd on OpenWrt by default" but it seems not interesting in the context of devlist which is used mostly for patches. stokito:

Re: Re: Switch issues and CI to GitHub

2022-01-26 Thread Sergey Ponomarev
-censorship-in-russia/ I think that in many other countries they are already blocked. On Wed, 26 Jan 2022 at 09:01, Sam Kuper wrote: > > On Tue, Jan 25, 2022 at 09:45:52PM +0200, Sergey Ponomarev wrote: > > Well, we may *speculate* and try to minimise risks but that's what I > >

Re: Re: Switch issues and CI to GitHub

2022-01-25 Thread Sergey Ponomarev
lem at all. It's fair to use GH or any other hosting even if it will be accessible only from Germany :) On Tue, 25 Jan 2022 at 20:31, Sam Kuper wrote: > > On Tue, Jan 25, 2022 at 06:56:04PM +0200, Sergey Ponomarev wrote: > > Speaking about GitHub and access to it from

Re: Re: Switch issues and CI to GitHub

2022-01-25 Thread Sergey Ponomarev
+1 for a GitHub +1 for GitLab +1 for a self hosting GitLab +1 for joining to any existing OS hosting -1 for plain emails. As a contributor but not a core developer I would like to ask. Please tell me honestly. Is the send-patch approach just an IQ test? Because I failed it :) My few patches that

Re: Pre-install MiniUPnPd on OpenWrt by default

2022-01-25 Thread Sergey Ponomarev
or a sysadmin, as opposed to the Regular User, must know about UPnP and can disable it and create forwarding manually. The world is dangerous but we may make it slightly comfortable. On Tue, 25 Jan 2022 at 15:51, Stijn Segers wrote: > > Hi Sergey, > > Op dinsdag 25 januari 2022 om 15u27

Pre-install MiniUPnPd on OpenWrt by default

2022-01-25 Thread Sergey Ponomarev
Hi, Most routers support port forwarding via UPnP IDG or/and NAT-PMP/PCP. And many vendors use the MiniUPnPd http://miniupnp.free.fr This daemon is kind of standard de-facto. This is necessary for any p2p application but OpenWrt builds don't have it pre-installed and pre-configured. While it's

Re: Re: coreutils

2022-01-24 Thread Sergey Ponomarev
If you are talking about the https://github.com/uutils/coreutils project then it's far from completion. Also the Rust compiler is not so good for MIPS targets which are used by most routers. OpenWrt is based on BusyBox utils which is a clone of coreutils but with many options stripped to keep

Re: [PATCH] --header option to pass additional raw HTTP headers

2021-05-09 Thread Sergey Ponomarev
a new PR or patchwork. So please change the commit description yourself. On Sun, 9 May 2021 at 10:24, Petr Štetiar wrote: > > Sergey Ponomarev [2021-05-08 22:23:43]: > > As stated in https://openwrt.org/submitting-patches your v2 should look like: > > Subject: [PATCH uclient]

[PATCH] --header option to pass additional raw HTTP headers

2021-05-08 Thread Sergey Ponomarev
Signed-off-by: Sergey Ponomarev --- tests/cram/test-san_uclient-fetch.t | 1 + tests/cram/test_uclient-fetch.t | 1 + uclient-fetch.c | 16 +++ uclient-http.c | 31 + uclient.h | 1

[PATCH 5/6] jshn.c: add_json_element():

2021-02-23 Thread Sergey Ponomarev
Extract variable to store json_object_get_type() Replace switch with json_type_to_name() Signed-off-by: Sergey Ponomarev --- jshn.c | 32 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/jshn.c b/jshn.c index 43a82e0..6490fbc 100644 --- a/jshn.c

[PATCH 6/6] jshn.c: getenv_avl(): var->val is always not NULL

2021-02-23 Thread Sergey Ponomarev
Signed-off-by: Sergey Ponomarev --- jshn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jshn.c b/jshn.c index 6490fbc..979182f 100644 --- a/jshn.c +++ b/jshn.c @@ -170,7 +170,7 @@ static int jshn_parse(const char *str) static char *getenv_avl(const char *key

[PATCH 4/6] jshn.c: use size_t instead of int

2021-02-23 Thread Sergey Ponomarev
This fixes Clang-Tidy warnings Signed-off-by: Sergey Ponomarev --- jshn.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jshn.c b/jshn.c index 7a2f935..43a82e0 100644 --- a/jshn.c +++ b/jshn.c @@ -36,7 +36,7 @@ static struct avl_tree env_vars; static struct

[PATCH 2/3] jshn.c: load envs only when -w

2021-02-22 Thread Sergey Ponomarev
Envs are needed only for jshn_format(). But jshn anyway loads them even if jshn_parse() called. This makes JSON reading slower. The patch extract a new func load_vars_from_envs() that is called directly from jshn_format() Signed-off-by: Sergey Ponomarev --- jshn.c | 87

[PATCH 0/3] jshn: load envs only on formatting

2021-02-22 Thread Sergey Ponomarev
is to port jshn to as many platforms as possible. Currently I just created Ubuntu PPA package. I'll appretiate any comments and thought on this. Sergey Ponomarev (3): jshn.c: remove old unsupported json lib jshn.c: load envs only when -w jshn.c: write_key_string(): extract var jshn.c | 99

[PATCH 1/3] jshn.c: remove old unsupported json lib

2021-02-22 Thread Sergey Ponomarev
Related to 791a361ad1b08fa56e554654109122b828657a2b Signed-off-by: Sergey Ponomarev --- jshn.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/jshn.c b/jshn.c index 1b685e5..061fc7f 100644 --- a/jshn.c +++ b/jshn.c @@ -13,11 +13,7 @@ * ACTION OF CONTRACT, NEGLIGENCE

[PATCH 3/3] jshn.c: write_key_string(): extract var

2021-02-22 Thread Sergey Ponomarev
This makes code cleaner and helps compiler to optimize Signed-off-by: Sergey Ponomarev --- jshn.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jshn.c b/jshn.c index 8fdd290..7a2f935 100644 --- a/jshn.c +++ b/jshn.c @@ -96,8 +96,10 @@ static void add_json_string

[PATCH] rpcd CMakeLists.txt: install unauthenticated.json

2021-01-18 Thread Sergey Ponomarev
When installing rpcd directly from CMake then the file is missing. Signed-off-by: Sergey Ponomarev --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 266dbe4..213b4ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,3 +69,6

[PATCH] rpcd CMakeLists.txt: drop legacy json-c support

2021-01-18 Thread Sergey Ponomarev
cbf80de7f4df61960f386cb01a899cf4228d38f3 Signed-off-by: Sergey Ponomarev --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 26e011e..266dbe4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ FIND_LIBRARY(uci NAMES uci

[PATCH] examples: drop legacy json-c support

2021-01-18 Thread Sergey Ponomarev
The cmake logic is wrong (E.G. PKG_CHECK_FOR_MODULES fails unless all modules are found), and the legacy libjson.so name is also used by the other libjson (http://sourceforge.net/projects/libjson/) which provides an incompatible API, so just drop it. Backported from

[PATCH 2/2] CMakeLists.txt: use CMAKE_CURRENT_LIST_DIR

2021-01-18 Thread Sergey Ponomarev
When building with debuild/fakeroot the build folder is different from sources Signed-off-by: Sergey Ponomarev --- CMakeLists.txt | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dbfbf5d..44ebe3e 100644 --- a/CMakeLists.txt

[PATCH 1/2] jsonfilter: drop legacy json-c support

2021-01-18 Thread Sergey Ponomarev
cbf80de7f4df61960f386cb01a899cf4228d38f3 Signed-off-by: Sergey Ponomarev --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7361eb2..dbfbf5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,14 +7,12 @@ IF(NOT APPLE) SET

[PATCH 2/2] Generate ETag similar to Nginx and BusyBox HTTPD

2021-01-12 Thread Sergey Ponomarev
Thus user run Luci on them and all cached files will work as previous because ETag is the same. --- file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/file.c b/file.c index 759ffd6..e0a4fb3 100644 --- a/file.c +++ b/file.c @@ -300,8 +300,9 @@ static const char *

[PATCH 1/2] Make ETag load balancer friendly

2021-01-12 Thread Sergey Ponomarev
Current ETag contains file's INODE which is always different on machines even if content of the file the same. When you made a sysupgrade i.e. changed file system then on next visit to web page all files will be downloaded again because their ETag was changed even if not all files actually were

[PATCH 0/2] uhttpd: Generate ETag similar to Nginx and BusyBox HTTPD

2021-01-12 Thread Sergey Ponomarev
LightHttpd which anyway uses bad ETag with loosed entropy. See https://stackoverflow.com/questions/47512043/how-etags-are-generated-and-configured/62996104#62996104 Sergey Ponomarev (2): Make ETag load balancer friendly Generate ETag similar to Nginx and BusyBox HTTPD file.c | 5 +++-- 1 file

[OpenWrt-Devel] [PATCH] uhttpd: serve precompressed files

2020-06-08 Thread Sergey Ponomarev
Follow up on this patch: 1. The patch it was tested and accepted into ArednMesh.org because they works with distant networks https://github.com/aredn/aredn_ar71xx/pull/276. The same problem is actual for a regular WiFi networks e.g. trying to login into Luci

Re: [OpenWrt-Devel] uclient-fetch add ability to pass custom http headers

2020-01-28 Thread Sergey Ponomarev
that it will be processed correctly I regenerated it with git format-patch: >From 8a9562d89891ec886192d7693e60065d0985fedd Mon Sep 17 00:00:00 2001 From: Sergey Ponomarev Date: Mon, 27 Jan 2020 03:27:50 +0200 Subject: [PATCH] Add --header option to pass additional raw HTTP headers Signed-off-by: Ser

[OpenWrt-Devel] uclient-fetch add ability to pass custom http headers

2020-01-26 Thread Sergey Ponomarev
Hi, I making a package that internally will perform a HTTP call to OAuth service and I need to pass `Authorization: Barer token` as a header. The wget clone uclient-fetch doesn't have such functionality to pass an additional header while original wget have it. I can use curl but it uses too much

Re: [OpenWrt-Devel] [RFC] stop accepting 4/32M board patches

2018-12-06 Thread Sergey Ponomarev
. At least I would like to donate. So I understand that if core developers don't wont to spend their time for this then that's ok. I just want to say that anyway it will be a lot of users who still needs this. Regards, Sergey Ponomarev ___ ope

Re: [OpenWrt-Devel] [PATCH 0/1] libubox installs incorrectly on Ubuntu due to incorrect LUAPATH

2018-11-29 Thread Sergey Ponomarev
returns /usr/local as first path. What I get from documentation this is properly behavior. So I just decided to set LUAPATH manually and I think that would be ok. Thank you On 11/29/18 6:17 PM, Petr Štetiar wrote: > Sergey Ponomarev [2018-11-29 17:20:07]: > > Hi, > >> I'm

[OpenWrt-Devel] [PATCH 1/1] libubox/lua/CMakeLists.txt: fix LUAPATH so it will use /usr/lib/ instead of /usr/local/lib/

2018-11-29 Thread Sergey Ponomarev
Signed-off-by: Sergey Ponomarev --- lua/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/CMakeLists.txt b/lua/CMakeLists.txt index 34c9ab1..4a114f6 100644 --- a/lua/CMakeLists.txt +++ b/lua/CMakeLists.txt @@ -17,7 +17,7 @@ ENDIF(APPLE) IF(NOT LUAPATH

[OpenWrt-Devel] [PATCH 0/1] libubox installs incorrectly on Ubuntu due to incorrect LUAPATH

2018-11-29 Thread Sergey Ponomarev
h is intended to fix that. Also the similar pathes needed for UCI and UBUS but I'll send them separately if you accept this patch. Also you can that yourself. Sergey Ponomarev (1): libubox/lua/CMakeLists.txt: fix LUAPATH so it will use /usr/lib/ instead of /usr/local/lib/ lua/CMakeLists.txt