Commit Graph

415 Commits

Author SHA1 Message Date
1682a2065b Remove unused function 2024-01-07 21:02:09 +01:00
cbce6da768 New function wget_queue_free_node
Introduce a new function that will free the node and its contents all at once.
2024-01-07 20:51:54 +01:00
913a1a99d2 Fix memory leaks
Fix memory leaks
2024-01-07 20:19:12 +01:00
97bbcc4d41 Parse HTTP3 headers in recv_header_cb using wget_http_parse_header_line() function [skip ci]
* Implemented http3_stream_context and passed it while sending the request.
2023-12-17 20:58:10 +01:00
54a9bc5722 Set fin flag on a per-stream basis 2023-12-17 20:58:10 +01:00
aa716b8b8a Coalesce small frames 2023-12-17 20:58:10 +01:00
162d4c2966 Remove unused wget_ssl_init_quic 2023-12-17 20:58:10 +01:00
91a39e1a2b Implement connection close 2023-12-17 20:58:10 +01:00
5e21ba09d7 * Added ssl_quic_gnutls.c in the makefile to revert unnecessary changes due to previous rebase [skip ci] 2023-12-17 20:58:10 +01:00
8c660432a7 * Documentation for functions added [skip ci] 2023-12-17 20:58:09 +01:00
a9c198fbd9 * changes made to discard wget_http3_connection and use wget_http_connection for http3 [skip ci] 2023-12-17 20:58:09 +01:00
a987ea0e76 * implemented wget_http3_close [skip ci]
* gaurded http3 functions to check availablility of nghttp3 library
* some functions renamed to keep only specific functions of http3 public
2023-12-17 20:58:09 +01:00
2564072c93 * changes made as pers suggestions [skip ci]
* restored the original signature of wget_dns_resolve
* added a check in the wget_quic_connect and wget_tcp_connect to check for respective socketypes
2023-12-17 20:58:03 +01:00
74a14d2cd1 * changes made as per suggestions [skip ci]
* wget_http3_get_response returns the data that the http3 client stream has read
* all fprintf converted into debug_printf and error_printf
* fixed issues mentioned in the thread
2023-12-17 20:12:09 +01:00
f498822fb8 * changes made in the code as per suggestions [skip ci]
* used wget_http_request to create a http3 request
* wget_http3_get_response implemented to read the response
2023-12-17 20:12:09 +01:00
988131a401 * read for http3 working
* callback functions for closing the HTTP/3 and QUIC streams to be implemented.
2023-12-17 20:12:09 +01:00
01950d5e91 * ISSUE 1: wget_dns_resolve_quic and wget_dns_resolve issue resolved [skip ci] 2023-12-17 20:12:01 +01:00
f3628ab839 * Changes internal implementation of byte to indicalte type of byte getting stored [skip ci]
* Also changes internal implementation of queue for testing a issue
* ISSUE : Example quic_read_write receives a packet twice
2023-12-17 20:08:06 +01:00
0ab20a5535 * some callback functions implemented and some improved for nghttp3 as well as ngtcp2 [skip ci]
* implemented a new function wget_quic_stream_set_stream to initialise a new stream with provided
  stream_id and add it to the wget_quic stack
2023-12-17 20:08:06 +01:00
fbe5561da7 * basic implementation of http3 stack over quic stack completed [skip ci]
* implementated very basic callback functions for http3
* implemented wget_http3_send_request to create a http3 requests
* reimplemented the internal working of wget_queue_peak_untransmitted
* example code for sending http3 request implemented
2023-12-17 20:08:06 +01:00
f667f2c826 * Changes made to fix resending of already sent data in wget_quic_write [skip ci]
* Added a bool in wget_byte struct named transmitted
* Implemented function wget_queue_peak_untransmitted_data
* This function will return first untransmitted byte
* Implemented wget_http3_deinit
2023-12-17 20:08:06 +01:00
f91c18cd8a * wget_http3_init implemented [skip ci]
* created http3.c and http3.h and implemented wget_http3_connection_st
* implemented http3 initialisation function to intialise the http3_connection struct
* shifted stream functions to a seperate stream.c file
2023-12-17 20:08:06 +01:00
6803b4aadf * Changes made as per suggestions in wget_quic_rw_once [skip ci]
* wget_quic_rw_once will do read-write cycle once
* changes made for consistency with kernel coding style
2023-12-17 20:08:06 +01:00
da4bbb6656 * wget_quic_once implemented which does a complete write and read cycle [skip ci] 2023-12-17 20:08:06 +01:00
14945f984e * wget_quic_ack implemented [skip ci]
* The motivation for implementation is multiple number of packets
  sent from server for a single packet sent from client
2023-12-17 20:08:06 +01:00
d53f19fc1d * Amendments made in the code as per suggestions [skip ci]
* Removed unnecessary getter-setter functions implemented
* implemented getter-setter for config in quic's ssl
2023-12-17 20:08:06 +01:00
0ec81fb379 * wget_quic_read function working [skip ci]
* quic_write_read.c file created to demonstrate the working of wget_quic_read
  and wget_quic_write hand in hand while configuring it to the QUIC ECHO server
2023-12-17 20:08:06 +01:00
3b99e07f49 * wget_quic_write function working [skip ci]
* quic_write.c file created to make provide a example of write.
* A sample string initially pushed into the stream and then the stream
  structure further utilised for sending the data over socket.
2023-12-17 20:08:06 +01:00
aad7bb1516 * Changes made in the code as per suggestions
* wget_quic_deinit added
* now the code has only wget_quic struct instead of two structs
* created new file named ssl_quic_gnutls.c
2023-12-17 20:08:06 +01:00
f8c95a9ad9 * QUIC Handshake working with QUIC Echo server [skip ci]
* Simplified the implementation of wget_quic_connect() and wget_ssl_quic_connect()
* Segregated the function wget_quic_connect into wget_quic_connect and wget_quic_handshake
2023-12-17 20:07:33 +01:00
fea161ffd1 * Added testing code to test wget_quic_connect.
* Test is failing due to retry_aead_ctx issue in handshake_read function
2023-12-17 20:06:18 +01:00
fa29a35376 * Implemented wget_quic_read. wget2 library integrated with ngtcp2 is ready for building. [skip ci] 2023-12-17 20:02:28 +01:00
12a87f748e * Changes made for building the library for testing QUIC. Not Working [skip ci] 2023-12-17 20:02:28 +01:00
f27b851a67 * wget_quic_write implemented [skip ci] 2023-12-17 20:02:28 +01:00
e3b6596af6 * Restored signatures of public functions and created seperate file for quic related function. [skip ci]
* Restored signatures of wget_ssl_open and wget_ssl_init and created new functions for quic related SSL set up.
* Moved all the quic related file to a new file named quic.c from net.c
2023-12-17 20:02:28 +01:00
853a6cf744 * Generalised function wget_ssl_init for QUIC as well as TCP. Completed the wget_quic_connect function without handshake. [skip ci] 2023-12-17 20:02:15 +01:00
b02f642f19 * Altered wget_quic struct to include DNS [skip ci]
* net.c : wget_quic_connect edited to use DNS for resolving
* dns.c : resolve and wget_dns_resolve edited to resolve for SOCK_DGRAM as well as SOCK_STREAM
2023-12-17 19:59:41 +01:00
6f3d2b0dac *Basic implementation of integration with ngtcp2 [skip ci]
*net.c : wget_quic_connet function implemented
*ssl_gnutls.c : wget_ssl_quic_open and wget_ssl_quic_open functions implemented
*queue.c: Implementation of queue using linked list
2023-12-17 19:51:55 +01:00
15ba1db248 Update copyrights 2023-08-31 12:57:30 +02:00
3595963416 Add better default cert/bundle paths for Windows
* include/wget/wget.h: New function wget_ssl_default_cert_dir,
  new function wget_ssl_default_ca_bundle_path.
* libwget/Makefile.am: Add ssl.c.
* libwget/ssl.c: New file for common ssl/tls code.
* libwget/ssl_gnutls.c (tls_init): Initialize cert paths.
* libwget/ssl_openssl.c (tls_init): Likewise.
* libwget/ssl_wolfssl.c (tls_init): Likewise.
* src/options.c (struct config): Init ca_cert,
  (init): Allocate / dup config.ca_cert.

Co-authored-by: Tim Rühsen <tim.ruehsen@gmx.d
2023-08-18 12:40:27 +02:00
0f1abaa11c Fix alternate port requests to proxies
* include/wget/wget.h (wget_http_request_to_buffer): Add param 'port'.
* libwget/http.c (wget_http_request_to_buffer): Likewise,
  (wget_http_send_request): Call wget_http_request_to_buffer with
  connection port.

Copyright-paperwork-exempt: Yes
2023-07-09 12:28:39 +02:00
68a11b7287 Add CIDR support in 'no_proxy' for IPv6
* include/wget/wget.h: Fix http_get_no_proxy -> wget_http_get_no_proxy.
* libwget/http.c: New function cidr_v6_match(),
  check for ipv6 CIDRs in wget_http_match_no_proxy().
* unit-tests/test.c (test_match_no_proxy): Add IPv6 CIDR tests.
2023-06-17 23:50:53 +02:00
6ab47257f0 CIDR support added for no_proxy
* libwget/http.c: Add function wget_http_cidr_match to support
  CIDR IP method for no_proxy
* unit-tests/test.c: Add testcases to verify the functionality
  of the above function

Fixes #615
2023-05-22 17:46:02 +00:00
84d0220e22 New option --dane
* configure.ac: Enable DANE if libgnutls-dane is installed,
  add option --without-libdane.
* docs/wget2.md: Add docs for option --dane.
* include/wget/wget.h: Add WGET_SSL_DANE.
* libwget/ssl_gnutls.c: Include include <gnutls/dane.h> if requested,
  (struct config): New member 'dane',
  (wget_ssl_set_config_int): Set value for dane via WGET_SSL_DANE,
  (wget_ssl_open): Call dane_verify_session_crt().
* src/options.c (options): Add entry for --dane,
  (init): Set config.dane via wget_ssl_set_config_int().
* src/wget_options.h (struct config): Add member 'dane'.
2023-04-23 19:49:12 +02:00
7ab64e25af Change arguments of wget_iri_compare to const
* include/wget/wget.hi (wget_iri_compare): Add 'const' to arguments.
* libwget/iri.c (wget_iri_compare): Likewise.
2022-10-15 19:41:12 +02:00
b89af6d0b8 Introduce XML function to decode entities
* include/wget/wget.h: Add wget_xml_decode_entities_inline().
* libwget/iri.c (iri_unescape_inline): Remove decoding of XML entities.
* libwget/xml.c: Add wget_xml_decode_entities_inline().
* src/wget.c (normalize_uri): Call wget_xml_decode_entities_inline().
2022-09-02 19:51:52 +02:00
2661ab6d47 Support compilation of wget.h from C++
* include/wget/wget.h: Replace restrict with __restrict

Copyright-paperwork-exempt: Yes
2022-08-14 15:07:58 +02:00
9395dd4b79 Implement --check-certificate=quiet
* include/wget/wget.h: Add WGET_SSL_REPORT_INVALID_CERT macro
* libwget/ssl_gnutls.c: Change certificate related error_printf() calls, for error_printf_check()
* libwget/ssl_openssl.c: Consider the case WGET_SSL_REPORT_INVALID_CERT in wget_ssl_set_config_int()
* libwget/ssl_wolfssl.c: Change certificate related error_printf() calls, for error_printf_check()
* src/options.c: Admit quiet as a valid value on --check-certificate
* src/wget_options.h: Move check_certificate from bool to an enum type (with enabled, disabled and log_disabled as values)
2022-07-23 16:28:22 +02:00
3dc7f71098 Update copyright year 2022-02-25 17:46:43 +01:00
20a6046fca Fix issue reported by scan-build
* include/wget/wget.h: /// -> //.
* libwget/netrc.c (unescape_password): Check wget_malloc() return against NULL.
* libwget/xml.c (wget_xml_parse_file): Likewise.
2022-02-19 14:35:40 +01:00