summaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
32 hoursutils: Correct ctype(3) usageGravatar Masatake Daimon1-1/+1
According to POSIX.1 the argument of ctype(3) functions, including toupper(3), has to either be EOF or a value representable as an unsigned char. If the argument has any other value, the behavior is undefined. This means values of signed char must first be cast to unsigned char, otherwise they will be outside the range of allowed values. glibc attempts to avoid the undefined behavior by defining the functions to work for all integer inputs representable by either an unsigned char or a signed char. NetBSD libc does not, and causes a segfault if the value is invalid.
32 hourssocket: Improve portability by replacing OS-specific macros with ↵Gravatar Masatake Daimon1-15/+19
AC_CHECK_HEADERS The primary purpose of this change is to support NetBSD. No functional changes intended.
2025-11-22Add atexit call to (empty) deinit function to prevent stripping off ↵Gravatar Nikias Bassen1-0/+8
initializer code
2025-06-29socket: Use const void* instead of void* in signature of socket_send()Gravatar Nikias Bassen1-1/+1
2025-06-04Change order of includes to prevent compiler warningGravatar Nikias Bassen1-2/+2
Otherwise _WIN32_WINNT redefined warning may occur.
2025-06-02socket: [Windows] Use inet_ntop for >= VistaGravatar Nikias Bassen1-1/+1
2025-05-17utils: Remove 'plist helper' from header commentGravatar Nikias Bassen1-1/+1
2025-05-17socket: [Windows] Use WSAAddressToStringAGravatar Nikias Bassen1-1/+1
This makes sure to always use the ANSI version of that function.
2025-05-16Use plist_new_unix_date API when availableGravatar Nikias Bassen1-2/+12
2025-03-01socket: Use a backwards-compatible way to deal with , before __VA_ARGS__Gravatar Nikias Bassen1-1/+1
2025-02-13socket: Fix error outputGravatar Nikias Bassen1-1/+1
2025-02-13socket: Allow setting debug level via environment variableGravatar Nikias Bassen1-0/+4
The value of SOCKET_DEBUG is read once during initialization (library constructor) and is expected to be a numerical value.
2025-02-13socket: WIN32: Make sure errno is set in error conditionsGravatar Nikias Bassen1-0/+9
2025-02-13socket: Update inline attributes for gcc/clangGravatar Nikias Bassen1-1/+1
2025-02-13Fix compiler warningGravatar Nikias Bassen2-1/+2
2025-02-13socket: WIN32: call WSAInit from library constructorGravatar Nikias Bassen2-35/+13
2025-02-13socket: Improve error message output/verbose loggingGravatar Nikias Bassen1-73/+112
This will make sure to not print anything by default. Verbosity needs to be at least 1 and can be set using socket_set_verbose().
2024-11-28Fix unrecognized \e escape sequenceGravatar Duncan Ogilvie1-1/+1
2024-11-28Fix compilation on MSVCGravatar Duncan Ogilvie8-79/+18
2024-11-26Switch to better initializer strategyGravatar Duncan Ogilvie1-43/+27
2024-11-26Change WIN32 to _WIN32 to check if running on WindowsGravatar Duncan Ogilvie4-50/+50
2024-10-29socket.c: define AI_NUMERICSERV if undefinedGravatar Sergey Fedorov1-0/+4
2024-10-21socket/win32: Use calloc where applicable in getifaddrs implementationGravatar Nikias Bassen1-4/+3
This should prevent crashes like the one mentioned in #12 which are caused by releasing an invalid pointer (due to uninitialized memory).
2024-10-21sha1: Remove old commented-out codeGravatar Nikias Bassen1-301/+0
2024-10-09socket: Remove greater-than check for scope_id since they might not be in orderGravatar Nikias Bassen1-10/+0
Otherwise the scope_id matching might exit the loop before reaching the interface with the actual corresponding scope_id. This only affected socket_connect_addr().
2024-06-15Add SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512 functions to interfaceGravatar Nikias Bassen5-0/+1173
2024-05-13socket: Create an IPv4 compatible IPv6 socket when NULL is passed to ↵Gravatar Nikias Bassen1-1/+2
socket_create
2024-05-13Revert "Use updated libplist 2.5.0 API"Gravatar Nikias Bassen1-2/+2
This reverts commit e61817ae57aac7252499268a9276692a32dc3e01.
2024-05-04socket: Haiku compilation fixesGravatar Jerome Duval1-3/+5
- link against libnetwork - get_primary_mac_address similar to FreeBSD
2024-05-04Use updated libplist 2.5.0 APIGravatar Nikias Bassen1-2/+2
2024-03-23Add helper code to deal with NSKeyedArchiver plist dataGravatar Nikias Bassen2-0/+1229
2024-03-06socket: Make sure errno is always set on error, and always return a ↵Gravatar Nikias Bassen1-5/+97
meaningful error code
2024-02-16Add version function to interfaceGravatar Nikias Bassen1-0/+8
2024-02-16socket: Allow NULL as address for socket_create() and socket_connect()Gravatar Nikias Bassen1-8/+0
This will connect to localhost without the need to specify localhost or 127.0.0.1 or ::1 and also makes this invulnerable to DNS rebind attacks.
2024-01-30Move LIMD_GLUE_API definitions to public headersGravatar Nikias Bassen9-71/+75
2023-12-26socket: Conditionally compile using poll or select based on availabilityGravatar Nikias Bassen1-27/+85
2023-12-26socket: Fix select failing when the process has many file descriptors by ↵Gravatar messi1-79/+100
using poll instead This happens, for example, when a process links with libusbmuxd, and the process is file descriptor heavy. Note: 'poll' means the syscall poll, not a polling approach. This patch does not add a busy wait and is not a performance regression.
2023-12-11opack: Fix parsing of 32 and 64 bit packed valuesGravatar Nikias Bassen1-2/+2
32 and 64 bit packed values were not parsed correctly due to bad pointer manipulation. Thanks to @cornejo for spotting this!
2023-12-11win32: Remove windows.h from public headersGravatar Nikias Bassen1-5/+8
2023-11-10opack: Fixed 32bit buffer overflowGravatar Nikias Bassen1-1/+1
Thanks to @cornejo for spotting this!
2023-04-19Remove plist-related code in favor of new libplist APIGravatar Nikias Bassen1-239/+1
2023-01-09Fix compilation on cygwinGravatar Josef Micka1-0/+6
2022-04-22[clang-tidy] Do not use else after return/break/continueGravatar Rosen Penev1-2/+1
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-22[clang-tidy] utils: Fix too small loop variableGravatar Rosen Penev1-1/+1
Found with bugprone-too-small-loop-variable Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-22[clang-tidy] use uppercase numeric literalsGravatar Rosen Penev1-4/+4
Found with readability-uppercase-literal-suffix Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-04utils: Close file if buffer allocation fails in buffer_read_from_filename()Gravatar Nikias Bassen1-0/+1
Thanks @demhademha for pointing this out.
2022-03-29socket: Add socket_get_socket_port functionGravatar Nikias Bassen1-0/+21
2022-02-09utils: Use libplist's plist_from_memory instead of duplicating format detectionGravatar Nikias Bassen1-5/+1
2022-02-04Add support for Apple's OPACK encoding and TLV formatGravatar Nikias Bassen3-0/+674
2022-02-04Add a simple char buffer implementationGravatar Nikias Bassen2-0/+68