summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_sockaddr.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-11-04Removed the unsafe nxt_memchr() wrapper for memchr(3).Alejandro Colomar1-4/+4
The casts are unnecessary, since memchr(3)'s argument is 'const void *'. It might have been necessary in the times of K&R, where 'void *' didn't exist. Nowadays, it's unnecessary, and _very_ unsafe, since casts can hide all classes of bugs by silencing most compiler warnings. The changes from nxt_memchr() to memchr(3) were scripted: $ find src/ -type f \ | grep '\.[ch]$' \ | xargs sed -i 's/nxt_memchr/memchr/' Reviewed-by: Andrew Clayton <a.clayton@nginx.com> Signed-off-by: Alejandro Colomar <alx@nginx.com>
2022-11-04Removed the unsafe nxt_memcmp() wrapper for memcmp(3).Alejandro Colomar1-3/+3
The casts are unnecessary, since memcmp(3)'s arguments are 'void *'. It might have been necessary in the times of K&R, where 'void *' didn't exist. Nowadays, it's unnecessary, and _very_ unsafe, since casts can hide all classes of bugs by silencing most compiler warnings. The changes from nxt_memcmp() to memcmp(3) were scripted: $ find src/ -type f \ | grep '\.[ch]$' \ | xargs sed -i 's/nxt_memcmp/memcmp/' Reviewed-by: Andrew Clayton <a.clayton@nginx.com> Signed-off-by: Alejandro Colomar <alx@nginx.com>
2022-08-18Disallowed abstract unix socket syntax in non-Linux systems.Alejandro Colomar1-4/+5
The previous commit added/fixed support for abstract Unix domain sockets on Linux with a leading '@' or '\0'. To be consistent in all platforms, treat those prefixes as markers for abstract sockets in all platforms, and fail if abstract sockets are not supported by the platform. That will avoid mistakes when copying a config file from a Linux system and using it in non-Linux, which would surprisingly create a normal socket.
2022-08-11Removed dead code.Alejandro Colomar1-412/+0
nxt_sockaddr_ntop() stopped being used in commit (git) 029942f4eb71. It has been replaced mostly by nxt_sockaddr_text(). commit 029942f4eb7196c2cff0d0e26bc6ff274138f7d8 Author: Igor Sysoev <igor@sysoev.ru> Date: Wed Feb 22 15:09:59 2017 +0300 I/O operations refactoring. nxt_job_sockaddr_parse() stopped being used in commit (git) 794248090a74. commit 794248090a74f31cbfcf24ea8c835df2d4d21073 Author: Igor Sysoev <igor@sysoev.ru> Date: Wed Mar 4 14:04:08 2020 +0300 Legacy upstream code removed. Also, remove functions and types used only by those two functions: nxt_job_sockaddr_unix_parse() nxt_job_sockaddr_inet6_parse() nxt_job_sockaddr_inet_parse() nxt_job_sockaddr_parse_t nxt_job_resolve() nxt_job_resolve_t
2022-07-18Fixed incorrect code.Alejandro Colomar1-1/+1
The #endif was misplaced by accident during a refactor: <https://github.com/nginx/unit/commit/029942f4eb7196c2cff0d0e26bc6ff274138f7d8>. clang(1)'s -Wunreachable-code-break (implied by -Weverything) catches that, but it is only produced for code compiled without support for Unix sockets, which is probably the reason it was undetected: no-one seems to be compiling Unit without Unix sockets support (at least with clang(1)).
2022-06-22Socket: removed useless port < 1 check.Andrew Clayton1-1/+1
In src/nxt_sockaddr.c::nxt_job_sockaddr_inet_parse() there is a check that port > 0 then there is a check that port < 1 || port > 65535, well we _know_ it can't be less than 1.
2021-08-12Introduced nxt_sockaddr_parse_optport() for addresses w/o ports.Oisin Canty1-46/+110
2021-07-02Fixing crash during IPv6 text address generation.Oisin Canty1-2/+2
When the textual representation of an IPv6 nxt_sockaddr_t was being generated, a crash would occur if the address had a full IPv6 form: f607:7403:1e4b:6c66:33b2:843f:2517:da27 This was caused by a variable that tracks the location of a collapsed group ("::") that was not set to a sane default. When the address was generated, a group would be inserted when it was not necessary, thus causing an overflow. This closes #481 issue on GitHub.
2019-12-24Router: introducing routing on client address.Axel Duch1-0/+4
2019-11-14Event engine memory cache refactored.Igor Sysoev1-3/+7
2019-03-11Style.Andrey Zelenkov1-8/+8
2018-09-17Fixed typo.Igor Sysoev1-1/+1
This closes #165 issue on GitHub. Thanks to 洪志道 (Hong Zhi Dao).
2018-06-25Introduced nxt_length() macro.Valentin Bartenev1-2/+2
2018-04-04Style: capitalized letters in hexadecimal literals.Valentin Bartenev1-5/+5
2018-01-24Using size_t for the field width type of the "%*s" specifier.Sergey Kandaurov1-2/+2
2017-10-17Storing memory cache slot hint inside nxt_sockaddr_t.Igor Sysoev1-11/+9
2017-09-27Event engine memory cache for nxt_sockaddr_t.Igor Sysoev1-0/+41
Introducing event engine memory cache and using the cache for nxt_sockaddr_t structures.
2017-08-16Corrected path to nxt_socket.h in comments.Ruslan Ermilov1-3/+3
2017-06-29Fixed port processing in nxt_sockaddr_text().Igor Sysoev1-3/+4
2017-06-28Small optimization in nxt_sockaddr_text().Igor Sysoev1-13/+4
2017-06-27Fixed INET6 sockaddr processing in nxt_sockaddr_text().Igor Sysoev1-5/+8
2017-06-27Fixed Unix sockaddr processing in nxt_sockaddr_text().Igor Sysoev1-5/+2
2017-06-27nxt_sockaddr_parse() introducted.Igor Sysoev1-1/+207
2017-06-27Applied nxt_pointer_to() and nxt_value_at() where possible.Valentin Bartenev1-4/+4
2017-06-21Removed surplus type casting from nxt_memcmp() calls.Valentin Bartenev1-1/+1
2017-06-20Using new memory pool implementation.Igor Sysoev1-15/+15
2017-03-09Processes refactoring.Igor Sysoev1-1/+1
The cycle has been renamed to the runtime.
2017-02-22I/O operations refactoring.Igor Sysoev1-39/+142
2017-02-01nxt_str_t changes.Igor Sysoev1-61/+62
2017-01-27Work queues refactoring.Igor Sysoev1-1/+1
2017-01-23Introducing tasks.Igor Sysoev1-1/+1
2017-01-17Initial version.Igor Sysoev1-0/+973