Commit Graph

80 Commits

Author SHA1 Message Date
Derossi Carneiro Neto
341d3e107c esp_http_client_cleanup, if client->transport_list was null, it generated an exception when calling esp_transport_list_destroy
https://github.com/espressif/esp-idf/pull/7695

Signed-off-by: Harshit Malpani <harshit.malpani@espressif.com>
2021-10-18 10:50:45 +05:30
Vikram Dattu
1c57dbcb3c esp_http_client: Fixed handling of EAGAIN return
For https connection `ESP_TLS_ERR_SSL_WANT_READ` of esp_transport_read was getting treated as error.
Treated this as a timeout to fix connection abort issue!

Also handled http connection EAGAIN with `errno == EAGAIN` check.

Signed-off-by: Vikram Dattu <vikram.dattu@espressif.com>
2021-09-07 14:33:49 +05:30
Jon Maloney
c8b7f7a5d3 esp_http_client: Support client key password for HTTPS connections.
Closes https://github.com/espressif/esp-idf/pull/7420
Closes https://github.com/espressif/esp-idf/issues/7418

Signed-off-by: Aditya Patwardhan <aditya.patwardhan@espressif.com>
2021-08-25 18:27:31 +05:30
yuanjm
fc8668a739 esp_http_client: Fix disable CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS will build error
Closes https://github.com/espressif/esp-idf/issues/7361
2021-08-17 19:53:47 +08:00
yuanjm
981287900e esp_http_client: Support HTTP_EVENT_ERROR event
Closes https://github.com/espressif/esp-idf/issues/7280
2021-08-02 14:33:50 +08:00
yuanjm
02367b44ef esp_http_client: Fix when receive FIN, close the connection in internal.
Closes https://github.com/espressif/esp-idf/issues/7036
2021-07-23 12:16:17 +08:00
Jan Brudny
967e057906 esp-tls, esp_http_client and esp_http_server: update copyright notice 2021-05-31 20:06:09 +08:00
0xFEEDC0DE64
0f3ad80a99 const corrections for esp_http_client_set_password()
Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>

Closes: https://github.com/espressif/esp-idf/pull/6941
2021-05-10 13:03:09 +05:30
yuanjm
754ec7b278 esp_http_client: Add API to set http client timeout value
Closes https://github.com/espressif/esp-idf/issues/6984
2021-05-06 13:55:12 +08:00
Shubham Kulkarni
b148433fbd esp_http_client_read: Add check for esp_http_client_is_complete_data_received before returning ESP_FAIL
Closes: https://github.com/espressif/esp-idf/issues/6772
2021-04-21 17:28:54 +05:30
Aditya Patwardhan
f66bdf1233 esp_http_client: Enable support of crt_bundle in esp_http_client 2021-04-07 05:31:21 +00:00
Shubham Kulkarni
1bacc13628 esp_http_client: Do not overwrite HTTP method in case of chunk request
Closes https://github.com/espressif/esp-idf/issues/6234
2021-03-31 10:53:36 +00:00
Shubham Kulkarni
4f6e0c1d27 esp_http_client: Add config option for HTTP Digest auth 2021-03-23 11:58:35 +05:30
0xFEEDC0DE64
a9c6fbe8d3 Added cert and key length options
Closes https://github.com/espressif/esp-idf/pull/6556

Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>
2021-03-23 11:58:35 +05:30
yuanjm
c79a907e4f components: Remove repeated keep alive function by ssl layer function
In esp_http_client and esp_websocket_client components, esp_transport_tcp_set_keep_alive has been called and keep-alive config has been saved in ssl->cfg.keep_alive_cfg,
So no need to call esp_transport_ssl_set_keep_alive again.
2021-03-10 02:19:29 +00:00
yuanjm
bead3599ab components: Support bind socket to specified interface in esp_http_client and esp_websocket_client component 2021-03-10 02:19:29 +00:00
yuanjm
e309a0ea6f esp_http_client: Optimize code structure 2021-02-23 14:09:40 +08:00
Clickau
308c31e2f1 esp_http_client: fix truncated headers
Signed-off-by: yuanjm <yuanjianmin@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/6370
2021-02-23 09:59:23 +08:00
Shubham Kulkarni
b53e46a68e Add options for esp_http_client and esp_websocket_client to support keepalive 2021-01-22 06:56:28 +00:00
Shubham Kulkarni
6337ce9c3c esp_http_client.c: Clear raw_len for response buffer after dispatching HTTP_EVENT_ON_FINISH event
Closes: https://github.com/espressif/esp-idf/issues/6146
2021-01-04 15:39:39 +05:30
Scott Shell
8c09fbf6f1 Make the UserAgent string in esp-http-client configurable
Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/6044
2020-11-19 14:43:14 +05:30
Shubham Kulkarni
83f4ebf852 esp_http_client: Skip check for redirection counter if status code is success.
Set disable_auto_redirect in esp_http_client example to validate this condition in CI
2020-11-19 14:43:14 +05:30
Angus Gratton
66fb5a29bb Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo.

(Line endings, blank lines at end of file, trailing whitespace)
2020-11-11 07:36:35 +00:00
Shubham Kulkarni
b06035443f esp_http_client: Include port in host field
Closes: https://github.com/espressif/esp-idf/issues/3628
2020-09-30 15:39:42 +05:30
boarchuz
bf942a60f3 esp_http_client: add flush response
Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>

Merges: https://github.com/espressif/esp-idf/pull/5845
Closes: https://github.com/espressif/esp-idf/issues/5814
2020-09-11 15:25:24 +05:30
Shubham Kulkarni
bb8981903e esp_http_client: Fix issue when response headers have empty value
Closes: https://github.com/espressif/esp-idf/issues/5553
2020-09-11 11:48:36 +05:30
Shubham Kulkarni
58b386bca3 Fix issue when algotithm header is not present 2020-09-03 04:32:45 +00:00
Shubham Kulkarni
1bbafb817d esp_http_client: Set user configurable authorization retries
Closes: https://github.com/espressif/esp-idf/issues/5407
2020-06-16 20:48:28 +05:30
Shubham Kulkarni
bcfd2f07ab esp_http_client: Add methods in esp_http_client_method_t required for WebDAV
Closes: https://github.com/espressif/esp-idf/issues/5402
2020-06-16 20:43:06 +05:30
Shubham Kulkarni
de5ee9cc80 esp_http_client: Add API to get chunk length in case of chunked responses
Closes: https://github.com/espressif/esp-idf/issues/5302
2020-06-05 09:57:32 +05:30
David Cermak
917192725a http-client: fix memory allocation issues found by static analyser 2020-05-13 07:16:45 +02:00
Shubham Kulkarni
890f541edf esp_http_client: Add API to get URL from client
Closes: https://github.com/espressif/esp-idf/issues/5115
2020-05-07 14:20:28 +05:30
Shubham Kulkarni
4c166085fb esp_http_client.c: In esp_http_client_read, add fix to return (-1) if esp_transport_read fails 2020-04-27 05:17:04 +00:00
Shubham Kulkarni
4858184e19 esp_http_client: Add helper API to read larger data chunks from HTTP Stream 2020-03-23 10:45:39 +05:30
Shubham Kulkarni
032a041395 Bugfix for failing OTA example
example_test.py is added to test advanced_https_ota_example and native ota_example.

Closes https://github.com/espressif/esp-idf/issues/4394
2019-12-31 14:18:16 +05:30
Axel Lin
489c815eb8 esp_http_client: add esp_http_client_set_authtype function
Since currently there are APIs to set url/username/password, it would be
good to also allow setting authtype.

Link: https://github.com/espressif/esp-idf/issues/4444
Closes https://github.com/espressif/esp-idf/pull/4454
Signed-off-by: Axel Lin <axel.lin@gmail.com>
2019-12-09 13:33:44 +05:30
Axel Lin
6fdc8d7f92 esp_http_client: fix memory leak in esp_http_client_set_username/password
Fix memory in case username/password was set before calling
esp_http_client_set_username/password.

Closes https://github.com/espressif/esp-idf/issues/4444
Fixes: 9fd16c6a5f ("fixes : set_url discards username and password")
Signed-off-by: Axel Lin <axel.lin@gmail.com>
2019-12-09 13:33:44 +05:30
Aidan Cyr
5f6fd238b6 fix: esp_http_client and esp_https_ota can follow 307 Redirects
Closes https://github.com/espressif/esp-idf/pull/4431
2019-12-09 13:33:44 +05:30
Mahavir Jain
4dcffdb0a9 esp_http_client: fix issue where http parser was not invoking message_complete callback
https://github.com/espressif/esp-idf/issues/2625
https://github.com/espressif/esp-idf/issues/4209
2019-11-04 12:15:19 +05:30
ganeshlandge
9fd16c6a5f fixes : set_url discards username and password 2019-10-04 10:42:43 +05:30
Hrudaynath Dhabe
d4091f7cda esp_http_client: Add support to check the binary length of the recieved stream and compare it with the size mentioned in the header.
While downloading OTA firmware, if their is a Origin Respnse Timeout or the binary is only partially downloaded, OTA failure is observed. Checking binary size can also be helpful for simple http client applications.

Closes https://github.com/espressif/esp-idf/issues/3004
2019-08-02 19:18:44 +08:00
Angus Gratton
c25fe765a9 Merge branch 'feature/esp_http_client_tx_buf_size' into 'master'
esp_http_client: separate buffer_size config option for transmit

See merge request espressif/esp-idf!5337
2019-07-08 15:15:14 +08:00
Oleg Antonyan
bd4591b053 esp_http_client: separate buffer_size config option for transmit
Merges https://github.com/espressif/esp-idf/pull/3528

Signed-off-by: Jitin George <jitin@espressif.com>
2019-07-05 13:04:35 +00:00
David Cermak
a001eb39bf http_client: disconnect event to read last occurred error in esp-tls 2019-07-04 20:55:10 +02:00
Jitin George
ab6dd36243 esp_http_client: Add support to disable validation of certificate's CN field 2019-06-25 23:41:33 +00:00
Angus Gratton
b6a24bbd25 Merge branch 'feature/esp-https-ota-basic-auth' into 'master'
esp_https_ota: component refactoring, bugfixes and feature additions

See merge request idf/esp-idf!4245
2019-05-10 12:39:14 +08:00
Jitin George
4e6d39f009 esp-http-client: Fix incorrect event name HTTP_EVENT_HEADER_SENT
Closes https://github.com/espressif/esp-idf/issues/3095
2019-05-02 16:15:59 +05:30
Jitin George
86e1fc564e esp_http_client: Add API for adding authorization info
There was existing support for adding authorization info in esp_http_client
but it was functional only while using `esp_http_client_perform` API. This commit just moves
existing authorization addition logic into publicly exposed API.
2019-04-29 11:44:37 +05:30
Vikram Dattu
e0d796bf33 Add a esp_http_client_set_redirection function When using direct operations instead of esp_http_client_perform, we need a way to set redirection URL when we get 30x response codes. Added the function for the same. User can now check status code and call esp_http_client_set_redirection function to enable redirection. Related change in adf: https://gitlab.espressif.cn:6688/adf/esp-adf-internal/merge_requests/187
Signed-off-by: Vikram Dattu <vikram.dattu@espressif.com>
2019-04-23 19:29:49 +05:30
Nguyễn Hồng Quân
4a6c5032f4 Fix: Lost username when setting new URL with a path.
Closes https://github.com/espressif/esp-idf/pull/3250
2019-04-16 08:58:36 +02:00