Commit Graph

21 Commits

Author SHA1 Message Date
Alejandro Colomar
1b05161107 Removed the unsafe nxt_memcmp() wrapper for memcmp(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-11-04 00:30:27 +01:00
Andrew Clayton
4418f99cd4 Constified numerous function parameters.
As was pointed out by the cppcheck[0] static code analysis utility we
can mark numerous function parameters as 'const'. This acts as a hint to
the compiler about our intentions and the compiler will tell us when we
deviate from them.

[0]: https://cppcheck.sourceforge.io/
2022-06-22 00:30:44 +02:00
Valentin Bartenev
7bf6253941 Custom implementation of Base64 decoding function.
Compared to the previous implementation based on OpenSSL, the new implementation
has these advantages:

 1. Strict and reliable detection of invalid strings, including strings with
    less than 4 bytes of garbage at the end;

 2. Allows to use Base64 strings without '=' padding.
2021-10-26 15:43:44 +03:00
Axel Duch
ee1e248f4b Router: decode uri and args. 2020-05-14 12:29:06 +02:00
Valentin Bartenev
68c6b67ffc Configuration: support for rational numbers. 2020-03-30 19:37:58 +03:00
Valentin Bartenev
35d6f84426 Added nxt_is_complex_uri_encoded()/nxt_encode_complex_uri(). 2020-03-27 17:22:52 +03:00
Valentin Bartenev
d4b4cb0438 Updated URI escaping table for better conformity with RFC 3986.
Now '>', '<', '"', '^', '\', '}', '|', '{', and '`' are also escaped.
2020-03-27 17:22:52 +03:00
Igor Sysoev
ec0d5c928e Changed nxt_memcasecmp() interface to avoid casts. 2019-10-10 19:37:40 +03:00
Valentin Bartenev
08a8d1510d Basic support for serving static files. 2019-09-19 02:47:09 +03:00
Valentin Bartenev
64be8717bd Configuration: added ability to access object members with slashes.
Now URI encoding can be used to escape "/" in the request path:

  GET /config/listeners/unix:%2Fpath%2Fto%2Fsocket/
2019-09-16 20:17:42 +03:00
Igor Sysoev
95c9bba33b Introduced nxt_memcpy_upcase(). 2019-02-26 19:48:44 +03:00
Igor Sysoev
606eda045b Removed '\r' and '\n' artifact macros. 2018-06-25 16:56:45 +03:00
Valentin Bartenev
39fd38a948 Fixed matching of empty version. 2017-10-19 17:26:56 +03:00
Valentin Bartenev
93438a0d9e Fixed building with old GCC after the previous change. 2017-10-05 17:31:41 +03:00
Valentin Bartenev
096562c0b1 Improved applications versions handling. 2017-10-05 16:46:18 +03:00
Igor Sysoev
949548da29 The new module configuration interface.
Configuration and building example:

  ./configure
  ./configure python
  ./configure php
  ./configure go
  make all

or

  ./configure
  make nginext
  ./configure python
  make python
  ./configure php
  make php
  ./configure go
  make go

Modules configuration options and building examples:

  ./configure python --module=python2 --config=python2.7-config
  make python2

  ./configure php --module=php7 --config=php7.0-config
                  --lib-path=/usr/local/php7.0
  make php7

  ./configure go --go=go1.6 --go-path=${HOME}/go1.6
  make go1.6
2017-08-17 21:47:19 +03:00
Valentin Bartenev
2dd8048bf9 Renamed nxt_str_copy() to nxt_str_cstrz(). 2017-08-16 15:43:02 +03:00
Valentin Bartenev
dfd3cc8c0e Applied nxt_pointer_to() and nxt_value_at() where possible. 2017-06-27 17:27:18 +03:00
Igor Sysoev
f888a5310c Using new memory pool implementation. 2017-06-20 19:49:17 +03:00
Igor Sysoev
6e67bee0f4 nxt_str_t changes. 2017-02-01 19:20:07 +03:00
Igor Sysoev
16cbf3c076 Initial version. 2017-01-17 20:00:00 +03:00