Commit Graph

576 Commits

Author SHA1 Message Date
0e02af99f7 Cleanup libwget/streams.c 2024-04-21 19:58:40 +02:00
1b1041acec Removed trailing blank(s) 2024-04-21 17:12:37 +02:00
a478a1478e Changes made as per suggestions [skip ci]
* Changes made to remove all the warnings
2024-04-21 17:12:37 +02:00
8f067bb434 Removed wget_queue completely. [skip ci] 2024-04-21 17:12:37 +02:00
a2cecb3597 Replaced wget_queue with wget_list as suggested [skip ci]
* Removal of wget_queue is pending
2024-04-21 17:12:37 +02:00
c5d133ba9b Reformat libwget/queue.c 2024-04-21 17:12:37 +02:00
2bd19ddf2a Cleanup libwget/bytes.c code
* include/wget/wget.h: Remove wget_byte_get_struct_size().
* libwget/bytes.c: Remove wget_byte_get_struct_size,
  code cleanup.
* libwget/queue.c: Remove size parameter from wget_queue_enqueue().
* libwget/streams.c (libwget/streams.c): Remove using wget_byte_get_struct_size().
2024-04-21 17:12:37 +02:00
09ff32ca50 Fix syntax errors 2024-04-21 17:12:37 +02:00
b3b24b8054 Fix memory leaks
* libwget/ssl_quic_gnutls.c (wget_ssl_close_quic): new function:
   deinit gnutls_session_t object.
 * libwget/quic.c (quic_stream_mark_acked): free node after dequeue.
   (wget_quic_deinit): deinit gnutls_session_t object.
 * libwget/queue.c (wget_queue_free): remove unused function.
   (wget_queue_free_node): new function: remove a node and its inner
   contents.
   (wget_queue_dequeue_transmitted_node, wget_queue_dequeue_data_node):
   return outer node object, instead of inner data. This makes it easier
   to free the full node & its contents after inspection.
   (wget_queue_enqueue): fix: unnecessary allocation.
 * libwget/http3.c (wget_http3_send_request): fix: free vector after
   use.
   (wget_http3_get_response): free full node after use.
   (wget_http3_get_response_cb): new function.
 * libwget/bytes.c (wget_byte_new): free bytes struct on error.
 * include/wget/wget.h (wget_queue_free): remove unused function.
   (wget_queue_free_node): new function.
   (wget_queue_dequeue_transmitted_node): change return value.
   (wget_queue_dequeue_data_node): change return value.

In addition, create new function wget_queue_free_node.

Introduce a new function that will free the node and its contents all at once.
2024-04-21 17:12:36 +02:00
2fd585708f 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.
2024-04-21 17:12:36 +02:00
9a6aa561b1 Set fin flag on a per-stream basis 2024-04-21 17:12:36 +02:00
20b929f242 Coalesce small frames 2024-04-21 17:12:36 +02:00
f8029bb54b Remove unused wget_ssl_init_quic 2024-04-21 17:12:36 +02:00
e52dedf400 Implement connection close 2024-04-21 17:12:36 +02:00
5c7ed1db3e * Added ssl_quic_gnutls.c in the makefile to revert unnecessary changes due to previous rebase [skip ci] 2024-04-21 17:12:36 +02:00
e41ed7c00b * Documentation for functions added [skip ci] 2024-04-21 17:12:36 +02:00
5d669b19cf * changes made to discard wget_http3_connection and use wget_http_connection for http3 [skip ci] 2024-04-21 17:12:36 +02:00
b9353d3014 * 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
2024-04-21 17:12:36 +02:00
60b15a8284 * 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
2024-04-21 17:12:36 +02:00
fce5de3e67 * 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
2024-04-21 17:12:36 +02:00
2f7ef2c0f5 * 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
2024-04-21 17:12:36 +02:00
b7b075751a * read for http3 working
* callback functions for closing the HTTP/3 and QUIC streams to be implemented.
2024-04-21 17:12:36 +02:00
9f939bef1d * ISSUE 1: wget_dns_resolve_quic and wget_dns_resolve issue resolved [skip ci] 2024-04-21 17:12:36 +02:00
b3fb6029e3 * 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
2024-04-21 17:12:36 +02:00
652d601d26 * 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
2024-04-21 17:12:36 +02:00
206bc62335 * 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
2024-04-21 17:12:36 +02:00
291dd9f8d1 * 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
2024-04-21 17:12:36 +02:00
d7a860527b * 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
2024-04-21 17:12:36 +02:00
4132f38f99 * 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
2024-04-21 17:12:36 +02:00
637cd63d0e * wget_quic_once implemented which does a complete write and read cycle [skip ci] 2024-04-21 17:12:36 +02:00
a4ed59b1bd * 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
2024-04-21 17:12:36 +02:00
6d951c6a79 * 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
2024-04-21 17:12:36 +02:00
5639d25529 * 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
2024-04-21 17:12:36 +02:00
f9dd3033a4 * 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.
2024-04-21 17:12:36 +02:00
895ad8ae48 * 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
2024-04-21 17:12:36 +02:00
09adf0ac1a * 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
2024-04-21 17:12:36 +02:00
9fc71ab18a * Added testing code to test wget_quic_connect.
* Test is failing due to retry_aead_ctx issue in handshake_read function
2024-04-21 17:12:36 +02:00
32fae1802b * Implemented wget_quic_read. wget2 library integrated with ngtcp2 is ready for building. [skip ci] 2024-04-21 17:12:36 +02:00
6c2fc9525e * Changes made for building the library for testing QUIC. Not Working [skip ci] 2024-04-21 17:12:36 +02:00
fc5fdd5467 * wget_quic_write implemented [skip ci] 2024-04-21 17:12:36 +02:00
ead200fe98 * 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
2024-04-21 17:12:36 +02:00
a3bb5fbe14 * Generalised function wget_ssl_init for QUIC as well as TCP. Completed the wget_quic_connect function without handshake. [skip ci] 2024-04-21 17:12:36 +02:00
d331070ae1 * 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
2024-04-21 17:12:36 +02:00
8a2588bfac *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
2024-04-21 17:12:36 +02:00
188989e067 Update copyright year 2024-01-07 12:41:02 +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