summaryrefslogtreecommitdiffhomepage
path: root/src/core/ngx_string.h (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2022-11-30Removed casts from ngx_memcmp() macro.Maxim Dounin1-1/+1
Casts are believed to be not needed, since memcmp() has "const void *" arguments since introduction of the "void" type in C89. And on pre-C89 platforms nginx is unlikely to compile without warnings anyway, as there are no casts in memcpy() and memmove() calls. These casts were added in 1648:89a47f19b9ec without any details on why they were added, and Igor does not remember details either. The most plausible explanation is that they were copied from ngx_strcmp() and were not really needed even at that time. Prodded by Alejandro Colomar.
2022-11-30Fixed alignment of ngx_memmove()/ngx_movemem() macro definitions.Maxim Dounin1-2/+2
2018-11-15Core: ngx_explicit_memzero().Maxim Dounin1-0/+2
2017-10-04Fixed handling of non-null-terminated unix sockets.Maxim Dounin1-0/+2
At least FreeBSD, macOS, NetBSD, and OpenBSD can return unix sockets with non-null-terminated sun_path. Additionally, the address may become non-null-terminated if it does not fit into the buffer provided and was truncated (may happen on macOS, NetBSD, and Solaris, which allow unix socket addresess larger than struct sockaddr_un). As such, ngx_sock_ntop() might overread the sockaddr provided, as it used "%s" format and thus assumed null-terminated string. To fix this, the ngx_strnlen() function was introduced, and it is now used to calculate correct length of sun_path.
2014-12-12Autoindex: implemented JSON output format.Valentin Bartenev1-0/+1
2014-02-04Core: added ngx_encode_base64url().Maxim Dounin1-0/+1
2013-09-23Added ngx_filename_cmp() with "/" sorted to the left.Maxim Dounin1-0/+1
This patch fixes incorrect handling of auto redirect in configurations like: location /0 { } location /a- { } location /a/ { proxy_pass ... } With previously used sorting, this resulted in the following locations tree (as "-" is less than "/"): "/a-" "/0" "/a/" and a request to "/a" didn't match "/a/" with auto_redirect, as it didn't traverse relevant tree node during lookup (it tested "/a-", then "/0", and then falled back to null location). To preserve locale use for non-ASCII characters on case-insensetive systems, libc's tolower() used.
2012-08-03Added "const" to ngx_memcpy() with NGX_MEMCPY_LIMIT defined.Maxim Dounin1-1/+1
This fixes warning produced during compilation of the ngx_http_geoip_module due to const qualifier being discarded.
2012-01-18Copyright updated.Maxim Konovalov1-0/+1
2011-10-11Autoindex: escape '?' in file names.Maxim Dounin1-6/+7
For files with '?' in their names autoindex generated links with '?' not escaped. This resulted in effectively truncated links as '?' indicates query string start. This is an updated version of the patch originally posted at [1]. It introduces generic NGX_ESCAPE_URI_COMPONENT which escapes everything but unreserved characters as per RFC 3986. This approach also renders unneeded special colon processing (as colon is percent-encoded now), it's dropped accordingly. [1] http://nginx.org/pipermail/nginx-devel/2010-February/000112.html Reported by Konstantin Leonov.
2011-04-12use memmove() in appropriate placesIgor Sysoev1-0/+4
2010-09-02new ngx_http_secure_link_module with secure_link, secure_link_md5, andIgor Sysoev1-0/+1
secure_link_expires
2010-06-24fix a bug when ngx_cpymem() returns a cast type:Igor Sysoev1-2/+2
p = (type *) ngx_cpymem(...)
2010-06-23change ngx_http_variable_value_node_t to more generic ngx_str_node_tIgor Sysoev1-0/+11
2010-05-14ngx_str_set() and ngx_str_null()Igor Sysoev1-0/+3
2010-05-14ngx_atofp()Igor Sysoev1-0/+1
2009-09-12If .domain.com, .sub.domain.com, and .domain-some.com were defined,Igor Sysoev1-0/+1
then .sub.domain.com was matched by .domain.com: wildcard names hash was built incorrectly due to sorting order issue of "." vs "-". They were sorted as com.domain com.domain-some com.domain.sub while they should be sorted as com.domain com.domain.sub com.domain-some for correct hash building
2009-04-27ngx_vslprintf(), ngx_slprintf()Igor Sysoev1-1/+5
2009-04-04ngx_strlcasestrn()Igor Sysoev1-0/+1
2008-08-26ngx_strlchr()Igor Sysoev1-1/+17
2008-08-04ngx_strlow()Igor Sysoev1-0/+2
2008-07-29rename ngx_utf_...() to ngx_utf8_...()Igor Sysoev1-3/+3
2008-07-25fix utf-8 names in autoindexIgor Sysoev1-1/+1
2008-05-15escape 0x00-0x1f, ", and \ in access log variablesIgor Sysoev1-1/+2
2008-03-24use ngx_int_t in ngx_sort() callbackIgor Sysoev1-1/+1
2007-12-17replace ngx_md5_text() with ngx_hex_dump()Igor Sysoev1-1/+1
2007-11-23update ngx_memcmp()Igor Sysoev1-1/+1
2007-10-22unescape SSI includeIgor Sysoev1-8/+9
2007-10-14fix English grammarIgor Sysoev1-1/+1
2007-10-01ngx_strnstr()Igor Sysoev1-0/+2
2007-09-27ngx_escape_html()Igor Sysoev1-0/+2
2007-09-26ngx_strstrn() and ngx_strcasestrn()Igor Sysoev1-0/+3
2007-08-20escape " ", "%", and %00-%1F in login and passwordIgor Sysoev1-0/+1
2007-07-22escape space, etc in $memcached_keyIgor Sysoev1-8/+9
2007-07-17Sun Studio on sparc uses different bit orderIgor Sysoev1-4/+15
2007-07-13msie_refresh should escape at least '"' to prevent XSSIgor Sysoev1-0/+1
2007-05-21ngx_sortIgor Sysoev1-0/+2
2007-05-19style fixIgor Sysoev1-8/+8
2007-04-02*) introduce ngx_strchr()Igor Sysoev1-0/+1
*) test server_name for '/': it's common configuration error when trailing ';' is omitted and a next directive is treated as server_name
2007-02-14ngx_strcasecmp()/ngx_strncasecmp()Igor Sysoev1-21/+7
2007-01-12ngx_strn2cmp() > ngx_memn2cmp()Igor Sysoev1-1/+1
2007-01-12ngx_strn2cmp()Igor Sysoev1-0/+1
2006-06-28nginx-0.3.50-RELEASE importrelease-0.3.50Igor Sysoev1-1/+2
*) Change: the "proxy_redirect_errors" and "fastcgi_redirect_errors" directives was renamed to the "proxy_intercept_errors" and "fastcgi_intercept_errors" directives. *) Feature: the ngx_http_charset_module supports the recoding from the single byte encodings to the UTF-8 encoding and back. *) Feature: the "X-Accel-Charset" response header line is supported in proxy and FastCGI mode. *) Bugfix: the "\" escape symbol in the "\"" and "\'" pairs in the SSI command was removed only if the command also has the "$" symbol. *) Bugfix: the "<!--" string might be added on some conditions in the SSI after inclusion. *) Bugfix: if the "Content-Length: 0" header line was in response, then in nonbuffered proxying mode the client connection was not closed.
2006-05-11nginx-0.3.46-RELEASE importrelease-0.3.46Igor Sysoev1-2/+8
*) Feature: the "proxy_hide_header", "proxy_pass_header", "fastcgi_hide_header", and "fastcgi_pass_header" directives. *) Change: the "proxy_pass_x_powered_by", "fastcgi_x_powered_by", and "proxy_pass_server" directives were canceled. *) Feature: the "X-Accel-Buffering" response header line is supported in proxy mode. *) Bugfix: the reconfiguration bug and memory leaks in the ngx_http_perl_module.
2006-01-17nginx-0.3.22-RELEASE importrelease-0.3.22Igor Sysoev1-4/+6
*) Feature: the ngx_http_perl_module supports the $r->args and $r->unescape methods. *) Feature: the method $r->query_string of ngx_http_perl_module was canceled. *) Bugfix: segmentation fault was occurred if the "none" or "blocked" values was specified in the "valid_referers" directive; the bug had appeared in 0.3.18.
2005-12-05nginx-0.3.13-RELEASE importrelease-0.3.13Igor Sysoev1-0/+9
*) Feature: the IMAP/POP3 proxy supports STARTTLS and STLS. *) Bugfix: the IMAP/POP3 proxy did not work with the select, poll, and /dev/poll methods. *) Bugfix: in SSI handling. *) Bugfix: now Solaris sendfilev() is not used to transfer the client request body to FastCGI-server via the unix domain socket. *) Bugfix: the "auth_basic" directive did not disable the authorization; the bug had appeared in 0.3.11.
2005-11-15nginx-0.3.10-RELEASE importrelease-0.3.10Igor Sysoev1-0/+1
*) Change: the "valid_referers" directive and the "$invalid_referer" variable were moved to the new ngx_http_referer_module from the ngx_http_rewrite_module. *) Change: the "$apache_bytes_sent" variable name was changed to "$body_bytes_sent". *) Feature: the "$sent_http_..." variables. *) Feature: the "if" directive supports the "=" and "!=" operations. *) Feature: the "proxy_pass" directive supports the HTTPS protocol. *) Feature: the "proxy_set_body" directive. *) Feature: the "post_action" directive. *) Feature: the ngx_http_empty_gif_module. *) Feature: the "worker_cpu_affinity" directive for Linux. *) Bugfix: the "rewrite" directive did not unescape URI part in redirect, now it is unescaped except the %00-%25 and %7F-%FF characters. *) Bugfix: nginx could not be built by the icc 9.0 compiler. *) Bugfix: if the SSI was enabled for zero size static file, then the chunked response was encoded incorrectly.
2005-11-09nginx-0.3.8-RELEASE importrelease-0.3.8Igor Sysoev1-5/+40
*) Security: nginx now checks URI got from a backend in "X-Accel-Redirect" header line or in SSI file for the "/../" paths and zeroes. *) Change: nginx now does not treat the empty user name in the "Authorization" header line as valid one. *) Feature: the "ssl_session_timeout" directives of the ngx_http_ssl_module and ngx_imap_ssl_module. *) Feature: the "auth_http_header" directive of the ngx_imap_auth_http_module. *) Feature: the "add_header" directive. *) Feature: the ngx_http_realip_module. *) Feature: the new variables to use in the "log_format" directive: $bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri, $request_time, $request_length, $upstream_status, $upstream_response_time, $gzip_ratio, $uid_got, $uid_set, $connection, $pipe, and $msec. The parameters in the "%name" form will be canceled soon. *) Change: now the false variable values in the "if" directive are the empty string "" and string starting with "0". *) Bugfix: while using proxied or FastCGI-server nginx may leave connections and temporary files with client requests in open state. *) Bugfix: the worker processes did not flush the buffered logs on graceful exit. *) Bugfix: if the request URI was changes by the "rewrite" directive and the request was proxied in location given by regular expression, then the incorrect request was transferred to backend; the bug had appeared in 0.2.6. *) Bugfix: the "expires" directive did not remove the previous "Expires" header. *) Bugfix: nginx may stop to accept requests if the "rtsig" method and several worker processes were used. *) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in SSI commands. *) Bugfix: if the response was ended just after the SSI command and gzipping was used, then the response did not transferred complete or did not transferred at all.
2005-07-08nginx-0.1.38-RELEASE importrelease-0.1.38Igor Sysoev1-0/+2
*) Feature: the "limit_rate" directive is supported in in proxy and FastCGI mode. *) Feature: the "X-Accel-Limit-Rate" response header line is supported in proxy and FastCGI mode. *) Feature: the "break" directive. *) Feature: the "log_not_found" directive. *) Bugfix: the response status code was not changed when request was redirected by the ""X-Accel-Redirect" header line. *) Bugfix: the variables set by the "set" directive could not be used in SSI. *) Bugfix: the segmentation fault may occurred if the SSI page has more than one remote subrequest. *) Bugfix: nginx treated the backend response as invalid if the status line in the header was transferred in two packets; the bug had appeared in 0.1.29. *) Feature: the "ssi_types" directive. *) Feature: the "autoindex_exact_size" directive. *) Bugfix: the ngx_http_autoindex_module did not support the long file names in UTF-8. *) Feature: the IMAP/POP3 proxy.
2005-06-15nginx-0.1.36-RELEASE importrelease-0.1.36Igor Sysoev1-1/+1
*) Change: if the request header has duplicate the "Host", "Connection", "Content-Length", or "Authorization" lines, then nginx now returns the 400 error. *) Change: the "post_accept_timeout" directive was canceled. *) Feature: the "default", "af=", "bl=", "deferred", and "bind" parameters of the "listen" directive. *) Feature: the FreeBSD accept filters support. *) Feature: the Linux TCP_DEFER_ACCEPT support. *) Bugfix: the ngx_http_autoindex_module did not support the file names in UTF-8. *) Bugfix: the new log file can be rotated by the -USR1 signal only if the reconfiguration by the -HUP signal was made twice.