Commit Graph
54 Commits
Author SHA1 Message Date
Andrey Vukolov a05479e2dc Merge branch 'master' into winbuild
- Built and tested on MSVC for static and dynamic builds, tested.
2025-06-17 18:59:51 +02:00
Adrien Béraud d3e2fd1099 fixes for msvc 2025-06-12 10:32:20 -04:00
Andrey Vukolov de8b441dae Merge branch 'master' into winbuild 2025-06-02 16:37:57 +02:00
Andrey Vukolov 5c21401728 constexpr fixes for preparation of MSVC build
- Addresses https://github.com/savoirfairelinux/opendht/pull/750/files#r2089281221 in #750
    - Adds infohash.cpp file for correct build of the DLL nametables in SHARED mode with MSVC
    - Reverted commits 352e36500c and 6a264d6f73
    - Fixes DLL build issues on Windows due to OPENDHT_PUBLIC definitions described in #750
    - Prepares the build system for merging changes from #750 (@aberaud)
2025-06-01 10:26:18 -04:00
Adrien Béraud c4e75ae66c update copyright year 2025-05-22 19:07:32 -04:00
Andrey Vukolov 279589fa78 Pre-master 2025-04-23 18:18:58 +02:00
Andrey Vukolov 1c1c99974a Added and tested build scenarios for Windows (MSYS2, MSVC static)
- Based on Windows build adjustment code from @novemus
	  (see his magnificient code merge request #716)
	- Determined full-static and dynamic link libraries for
	  Windows if built using MSYS2 or MSVC
	- Built without restinio and llhttp [TODO]
	- Set for automatic fetching and population from the network
	  the following libraries for MSYS2:
		- GnuTLS 3.8.4 for 64-bit Windows (tested for dynamic
		  and static builds)
			- Auto name adjustments for GnuTLS
		- GnuTLS 3.8.9 for 32-bit Windows (untested)
		- cJSON as a dependency for msgpack
		- msgpack 6.1.1
		- jsoncpp 1.9.5
		- libfmt 11.1.2
		- libasio 1.30.2
	  for MSVC:
		- cJSON (used by msgpack in dynamic builds)
		- jsoncpp 1.9.5
		- libfmt 11.1.2
	- Various build scenario fixes for MSVC dynamic builds
	- Added modular codebase for infohash.cpp to avoid header
	  treatment mismatches in MSVC when compiling DLL
	- Added convenience prints in the build scenario
	- Fixed inconvenient usage of pkgconfig in Windows, the
	  link scenarios adjusted accordingly
	- Fixed hardcoded find_library calls
	- Added standard CMake handler for Boost library using
	  BOOST_ROOT variable, including environmental definition
	- Fixed libreadline linkage on POSIX when the default link
	  point is turned off for OPENDHT_TOOLS (Mint Linux)
	- Added versioned handler for CMP0167 policy (from CMake 3.30)
	- Code fixes for compatibility headers in Windows (crypto.cpp,
	  network_utils.h, utils.h)
	- Urgent fix for improper redefinition of _WINNT_VERSION for
	  Windows 10/11
	  (https://github.com/savoirfairelinux/opendht/pull/716#issuecomment-2793129052)
	- Compile definitions fixed for opendht_EXPORTS and OPENDHT_BUILD
	  in build scenario for OPENDHT_TOOLS
	- Urgent fix for GnuTLS version handler in the code (type
	  redefinition in version 3.8.7 and later)
	  https://github.com/savoirfairelinux/opendht/pull/716#issuecomment-2792592951
	- Various fixes for proper dynamic linking in Windows
	- Built and tested in dynamic and static build scenarios under
	  MSYS2 in Windows 10 and Windows 11, proven working. The
	  static build does not seem fully static, the redevelopment
	  of the MSVC build scenario is proposed by @novemus
	- Built and tested in static mode under MSVC/Visual Studio 2022.
	  Proven working
	- Improper usage of the C's free() function is detected in GnuTLS
	  dynamically linked in Windows (shiftmedia-gnutls 3.7.2 to 3.8.7)
	- Added a MSVC-specific source hack to avoid using gnutls_free()
	  function when built in Windows using dynamic link.
	  !!! CAUTION !!!
	  This implementation should be considered as a dirty hack likely
	  leading to memory leaks! The code should be thoroughly tested
	  and refactored to avoid memory leaks, but the true origin of
	  errors is still not revealed [TODO]
	- My respect to @novemus and his works over #716
2025-04-22 14:46:41 +02:00
Adrien Béraud 352e36500c utils: make HexMap constexpr 2025-04-05 09:49:58 -04:00
Adrien Béraud c7ba7f6703 utils: use fmt::format for time 2024-11-20 11:40:12 -05:00
Adrien Béraud fafd2f0233 update copyright year 2023-06-02 23:16:04 -04:00
Adrien Béraud 6919df592f sockaddr: add fmt formatter 2023-05-18 12:31:42 -04:00
Adrien Béraud 58bc772256 NodeExport: use SockAddr, move to separate header 2023-03-23 16:50:19 -04:00
Adrien Béraud 4f9b50dd60 print_addr: use ostringstream insted of stringstream 2022-04-15 19:18:24 -04:00
Adrien Béraud c59f951e5a update copyright 2022-03-10 19:51:25 -05:00
Adrien Béraud 4587c0925f utils: always check length in findMapValue 2020-05-19 19:50:20 -04:00
Adrien Béraud f30d21e96f move bootstrap logic from DhtRunner to Dht 2020-04-24 16:32:07 -04:00
Adrien Béraud 69f8969883 utils: fix build in 32 bit 2020-03-25 23:39:54 -04:00
Adrien Béraud bc200cd76d utils: fix indentation 2020-03-25 23:08:39 -04:00
Adrien Béraud 81131f1c4e utils: check time bounds 2020-03-25 23:00:16 -04:00
Adrien Béraud 616d6fe4b8 update copyright date 2020-01-03 15:14:32 -05:00
Adrien Béraud fea736428e msgpack: take const reference in unpack 2019-12-14 13:01:24 -05:00
Adrien Béraud 2d358adf0e utils: add findMapValue(string) 2019-12-14 13:00:13 -05:00
Adrien Béraud e8b385c220 utils: optimize findMapValue 2019-12-13 23:57:22 -05:00
Adrien Béraud 150e62de0b sockaddr: fix npe if address is not set 2019-07-01 14:08:41 -04:00
Adrien Béraud 2ac5157ab8 net: attempt to use the same port for IPv4 and IPv6 if 0 2019-06-22 21:30:49 -04:00
Adrien Béraud feb498305f network engine: convert mapped IPv4 2019-06-22 18:37:58 -04:00
Adrien Béraud d438d4ef1b sockaddr: add getMappedIPv6 2019-06-21 11:00:48 -04:00
Adrien Béraud 120c017399 net: add DatagramSocket, UdpSocket transport 2019-06-07 14:14:15 -04:00
Adrien Béraud 5881c91510 utils: include config.h 2019-04-19 20:24:01 -04:00
Adrien Béraud 5257ac314f add API to retrieve version string 2019-04-14 00:19:01 -04:00
Adrien Béraud 01d8e513a1 peerdiscovery: cleanup 2019-04-08 11:34:52 -04:00
Mingrui Zhang 4240820463 peerdiscovery: add multicast node discovery mechanism 2019-04-08 11:32:08 -04:00
Adrien Béraud f418b3651f update copyright date 2019-03-16 12:37:23 -04:00
Sébastien Blin 393a403ff2 proxy_client: fix address split 2018-03-29 11:00:33 -04:00
Adrien Béraud 6e9f2cda79 SockAddr: add isMappedIPv4, getMappedIPv4 2018-01-11 13:29:18 -05:00
Adrien Béraud 6790d1ec5c SockAddr: set service to null if string is empty 2017-11-17 18:31:28 +01:00
Adrien Béraud 161769f4ec SockAddr: use host endianess for bitwise-shift operations 2017-11-10 17:48:36 -05:00
Adrien Béraud 9948079c97 SockAddr: add resolve() 2017-11-10 17:48:36 -05:00
Adrien Béraud 476fbb1160 network: use full 32-bits of transaction IDs
We used to use the first 16 bits for the message type.
2017-10-20 17:42:28 +02:00
Adrien Béraud 376486e64f node: use full range of socket IDs 2017-10-17 15:25:09 +02:00
Adrien Béraud 1c45f34262 SockAddr: use pointer to sockaddr
Save memory and reduce copies by using a pointer
to a sockaddr structure of the right size instead of
using a full sockaddr_storage structure for every address.
2017-09-26 16:30:29 +02:00
Adrien Beraud 73bcebf355 license cleanup 2017-04-10 01:43:20 +02:00
Adrien Béraud aa2227bdfc SockAddr: add utility methods 2017-02-09 23:49:06 -05:00
Simon Désaulniers b03a8b5b50 update license notice (2017) 2017-01-13 17:27:29 -05:00
Adrien Béraud 659d893dee network: transmit large values in multiple packets 2016-10-09 16:22:33 -04:00
Adrien Béraud 6d38c18572 introduce SockAddr to store IP addresses 2016-09-15 01:38:26 -04:00
Simon Désaulniers 07e4435a07 value: add Query relevant structures 2016-07-10 19:26:04 +02:00
Simon Désaulniers 4b13fcac70 fixing various compilation errors 2016-05-02 15:25:14 -04:00
Simon Désaulniers 0f94e0de0c moved infohash constexpr where appropriate 2016-05-02 15:25:14 -04:00
Simon Désaulniers f93fb92ff5 add NetworkEngine::processMessage 2016-05-02 15:25:14 -04:00