Felix Fietkau [Sat, 16 Jan 2016 22:39:10 +0000 (23:39 +0100)]
uclient-fetch: add support for setting output directory
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 22:29:51 +0000 (23:29 +0100)]
uclient-http: use blocking connect, switch to non-blocking later. fixes ipv6 -> ipv4 fallback
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 22:26:32 +0000 (23:26 +0100)]
http: detect connect failure
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 22:25:38 +0000 (23:25 +0100)]
uclient-fetch: ignore SIGPIPE
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 22:08:55 +0000 (23:08 +0100)]
uclient-fetch: add proxy support
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 22:08:46 +0000 (23:08 +0100)]
http: add proxy support
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 22:08:31 +0000 (23:08 +0100)]
core: add proxy support
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 19:13:36 +0000 (20:13 +0100)]
core: fix memory leak if url change fails
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 18:46:33 +0000 (19:46 +0100)]
uclient-http: make username/password variables local
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 18:34:22 +0000 (19:34 +0100)]
uclient-fetch: add support for resuming downloads
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 18:18:38 +0000 (19:18 +0100)]
uclient-fetch: clean up output file selection
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 17:50:22 +0000 (18:50 +0100)]
http: allow the header_done callback to reset the client state
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 12:08:45 +0000 (13:08 +0100)]
uclient-fetch: add support for --timeout
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 11:55:36 +0000 (12:55 +0100)]
uclient-fetch: add support for --spider
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 11:50:11 +0000 (12:50 +0100)]
uclient-fetch: add support for --post-data
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 11:22:00 +0000 (12:22 +0100)]
uclient-fetch: only add default CA entries if no certificate was supplied and verify was requested
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 11:20:09 +0000 (12:20 +0100)]
uclient-fetch: add support for setting the user agent
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 10:43:40 +0000 (11:43 +0100)]
uclient-fetch: add support for fetching multiple urls
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 10:01:58 +0000 (11:01 +0100)]
uclient-fetch: add user/password to command line help
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 16 Jan 2016 00:17:33 +0000 (01:17 +0100)]
uclient-fetch: load CA certificates
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Fri, 15 Jan 2016 20:30:09 +0000 (21:30 +0100)]
http: get remote address from usock instead of using getpeername
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Alexander Couzens [Thu, 6 Aug 2015 11:02:47 +0000 (13:02 +0200)]
uclient-fetch: set server_name of the ssl context to support SNI
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Felix Fietkau [Tue, 14 Apr 2015 21:04:32 +0000 (23:04 +0200)]
uclient-http: end custom header lines with CRLF
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Tue, 14 Apr 2015 21:01:53 +0000 (23:01 +0200)]
uclient-http: allow .header_done() callback to reset the connection
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Rafał Miłecki [Thu, 22 Jan 2015 10:45:13 +0000 (11:45 +0100)]
allow sending requests with DELETE method
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Rafał Miłecki [Wed, 21 Jan 2015 21:48:35 +0000 (22:48 +0100)]
use const for char buffer in uclient_write
We are not supposed to modify it and ustream accepts const already.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Rafał Miłecki [Fri, 16 Jan 2015 10:21:02 +0000 (11:21 +0100)]
support for connection timeout
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Felix Fietkau [Fri, 5 Dec 2014 10:56:18 +0000 (11:56 +0100)]
http: fix processing of digest auth parameters
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Thu, 4 Sep 2014 11:19:59 +0000 (13:19 +0200)]
http: terminate old connection in uclient_http_connect after incomplete request processing
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Thu, 4 Sep 2014 11:10:59 +0000 (13:10 +0200)]
http: do not call uclient_http_disconnect from uclient_notify_eof directly
Depending on the context, it can lead to crashes
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Jo-Philipp Wich [Mon, 28 Jul 2014 11:58:02 +0000 (13:58 +0200)]
uclient-http: only invoke data_sent callback if it is provided
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Felix Fietkau [Thu, 21 Aug 2014 19:10:30 +0000 (21:10 +0200)]
http: ignore empty lines before HTTP response
Fixes HTTP keepalive issues with some servers
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Luka Perkov [Mon, 7 Jul 2014 08:06:24 +0000 (10:06 +0200)]
fetch: fix segfault after destination was not reached
Signed-off-by: Luka Perkov <luka@openwrt.org>
Luka Perkov [Mon, 7 Jul 2014 08:11:41 +0000 (10:11 +0200)]
http: implement data_sent write callback
Signed-off-by: Luka Perkov <luka@openwrt.org>
Felix Fietkau [Wed, 28 May 2014 09:43:56 +0000 (11:43 +0200)]
http: rework authentication handling - only retry internally for GET requests
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Fri, 9 May 2014 00:16:51 +0000 (02:16 +0200)]
uclient-fetch: define _GNU_SOURCE (used for asprintf)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Thu, 8 May 2014 21:20:12 +0000 (23:20 +0200)]
fetch: print the URL while connecting
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Thu, 8 May 2014 16:51:16 +0000 (18:51 +0200)]
fetch: add support for --user and --password
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Thu, 8 May 2014 15:39:51 +0000 (17:39 +0200)]
fetch: always use O_EXCL when creating output files, use unlink if -O is specified
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Wed, 7 May 2014 23:26:38 +0000 (01:26 +0200)]
fetch: print download status
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Wed, 7 May 2014 21:21:52 +0000 (23:21 +0200)]
fetch: indicate an error if the connection was terminated prematurely
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Tue, 6 May 2014 13:03:21 +0000 (15:03 +0200)]
add uclient_get_url_filename helper function
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Tue, 6 May 2014 12:47:38 +0000 (14:47 +0200)]
fetch: print error messages on http error codes
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Tue, 6 May 2014 12:46:27 +0000 (14:46 +0200)]
fetch: remove http header output
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Tue, 6 May 2014 12:45:12 +0000 (14:45 +0200)]
rename uclient-example to uclient-fetch
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Tue, 6 May 2014 12:43:44 +0000 (14:43 +0200)]
example: rename callbacks
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Luka Perkov [Mon, 5 May 2014 00:35:11 +0000 (02:35 +0200)]
add support for PUT requests
Signed-off-by: Luka Perkov <luka@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 23:12:57 +0000 (01:12 +0200)]
example: document -q
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 18:41:22 +0000 (20:41 +0200)]
example: only close output fd after request completion if -O was not used
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 18:31:02 +0000 (20:31 +0200)]
example: handle uclient connection errors
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 18:24:18 +0000 (20:24 +0200)]
example: indicate http error presence with return code 8
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 18:17:47 +0000 (20:17 +0200)]
example: close output file
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 18:16:50 +0000 (20:16 +0200)]
example: only write output data on http 200/204
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 18:00:29 +0000 (20:00 +0200)]
example: document -O
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 17:59:25 +0000 (19:59 +0200)]
example: always exit on output file errors
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 17:54:22 +0000 (19:54 +0200)]
add uclient_disconnect() to force a disconnect without further callbacks
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 17:05:02 +0000 (19:05 +0200)]
example: write output data to a file
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 16:34:40 +0000 (18:34 +0200)]
example: create only one request
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 12:30:18 +0000 (14:30 +0200)]
example: update usage info
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 12:24:23 +0000 (14:24 +0200)]
example: add quiet flag similar to wget
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 12:21:11 +0000 (14:21 +0200)]
expose struct uclient_url
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 12:15:40 +0000 (14:15 +0200)]
example: change -c to --ca-certificate to match wget
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 12:11:40 +0000 (14:11 +0200)]
example: change -C to --no-check-certificate to match wget
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 11:59:45 +0000 (13:59 +0200)]
example: make ustream-ssl optional (load via dlopen)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 4 May 2014 11:34:40 +0000 (13:34 +0200)]
http: make ustream_ssl optional, only use provided ssl context
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Wed, 30 Apr 2014 12:50:21 +0000 (14:50 +0200)]
http: get address at initial connect time
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Mon, 7 Apr 2014 19:11:58 +0000 (21:11 +0200)]
add support for querying local/remote address
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Thu, 3 Apr 2014 09:52:52 +0000 (11:52 +0200)]
ignore empty writes
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 29 Mar 2014 22:31:54 +0000 (23:31 +0100)]
add support for 204 (no content)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 29 Mar 2014 22:29:38 +0000 (23:29 +0100)]
fix arguments to uclient_http_reset_headers
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 29 Mar 2014 19:25:30 +0000 (20:25 +0100)]
fix specifying ports in urls
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 29 Mar 2014 19:17:57 +0000 (20:17 +0100)]
avoid sending duplicate headers
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 29 Mar 2014 19:17:46 +0000 (20:17 +0100)]
properly terminate POST requests
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 29 Mar 2014 13:52:12 +0000 (14:52 +0100)]
add support for passing in auth to uclient_set_url()
Felix Fietkau [Sat, 29 Mar 2014 13:49:59 +0000 (14:49 +0100)]
split setting url from connecting
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Wed, 26 Mar 2014 19:55:18 +0000 (20:55 +0100)]
pass auth_str to uclient_new()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Tue, 25 Mar 2014 20:35:47 +0000 (21:35 +0100)]
add copyright headers
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Tue, 25 Mar 2014 14:39:58 +0000 (15:39 +0100)]
implement optional SSL certificate validation (including CN host check)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Tue, 25 Mar 2014 09:14:57 +0000 (10:14 +0100)]
fix prefix id passing
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Tue, 25 Mar 2014 09:11:36 +0000 (10:11 +0100)]
fix connect error handling
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Mon, 24 Mar 2014 13:25:14 +0000 (14:25 +0100)]
add support for passing in an external ustream_ssl context
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 23 Mar 2014 00:11:15 +0000 (01:11 +0100)]
move nc to struct uclient_http
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 23 Mar 2014 00:09:20 +0000 (01:09 +0100)]
move ssl_ctx to struct uclient_http
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sun, 23 Mar 2014 00:01:40 +0000 (01:01 +0100)]
fix positioning of the __hidden attribute
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 22 Mar 2014 23:29:31 +0000 (00:29 +0100)]
use the redirect function in the example code
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 22 Mar 2014 23:29:18 +0000 (00:29 +0100)]
add a utility function to detect redirects and handle them
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 22 Mar 2014 18:29:12 +0000 (19:29 +0100)]
add missing prototype for uclient_backend_set_error
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 22 Mar 2014 17:31:41 +0000 (18:31 +0100)]
make uclient_backend_http visible to allow the client to test for it
the struct is still opaque, it is only used for pointer tests
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 22 Mar 2014 17:30:09 +0000 (18:30 +0100)]
parse the http response code
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 22 Mar 2014 17:21:01 +0000 (18:21 +0100)]
check for length > 0 before calling ustream_write
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 22 Mar 2014 16:22:14 +0000 (17:22 +0100)]
implement digest support
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 22 Mar 2014 14:35:50 +0000 (15:35 +0100)]
pass the initial / from uclient core to the proto handler
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 22 Mar 2014 13:23:33 +0000 (14:23 +0100)]
add utilities for calculating http digest hashes
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Sat, 22 Mar 2014 13:05:05 +0000 (14:05 +0100)]
preserve the contents of the www-authenticate header and use them to detect authentication mode
preparation for adding digest authentication support
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Fri, 21 Mar 2014 23:56:16 +0000 (00:56 +0100)]
fix double / on requests to root
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Fri, 21 Mar 2014 20:58:42 +0000 (21:58 +0100)]
add support for processing the content-length header when transfer is not chunked
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Fri, 21 Mar 2014 20:43:02 +0000 (21:43 +0100)]
add support for reusing connections
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Fri, 21 Mar 2014 20:32:01 +0000 (21:32 +0100)]
set eof on HEAD requests after header end
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Fri, 21 Mar 2014 20:30:28 +0000 (21:30 +0100)]
remove debug code
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau [Fri, 21 Mar 2014 20:11:39 +0000 (21:11 +0100)]
example: use stdout instead of stderr
Signed-off-by: Felix Fietkau <nbd@openwrt.org>