Mercurial > hg > nginx-quic
view auto/cc/clang @ 5058:f25d0bbc4392 stable-1.2
Merge of r5004, r5019-r5025: ssl fixes.
*) SSL: speedup loading of configs with many ssl servers. The patch
saves one EC_KEY_generate_key() call per server{} block by informing
OpenSSL about SSL_OP_SINGLE_ECDH_USE we are going to use before
the SSL_CTX_set_tmp_ecdh() call.
For a configuration file with 10k simple server{} blocks with SSL
enabled this change reduces startup time from 18s to 5s on a slow
test box here.
*) SSL: removed conditions that always hold true.
*) SSL: resetting of flush flag after the data was written. There is
no need to flush next chunk of data if it does not contain a buffer
with the flush or last_buf flags set.
*) SSL: preservation of flush flag for buffered data. Previously,
if SSL buffer was not sent we lost information that the data
must be flushed.
*) SSL: calculation of buffer size moved closer to its usage.
No functional changes.
*) SSL: avoid calling SSL_write() with zero data size. According to
documentation, calling SSL_write() with num=0 bytes to be sent
results in undefined behavior.
We don't currently call ngx_ssl_send_chain() with empty chain and
buffer. This check handles the case of a chain with total data size
that is a multiple of NGX_SSL_BUFSIZE, and with the special buffer
at the end.
In practice such cases resulted in premature connection close and
critical error "SSL_write() failed (SSL:)" in the error log.
*) SSL: take into account data in the buffer while limiting output.
In some rare cases this can result in a more smooth sending rate.
*) SSL: fixed ngx_ssl_handshake() with level-triggered event methods.
Missing calls to ngx_handle_write_event() and ngx_handle_read_event()
resulted in a CPU hog during SSL handshake if an level-triggered event
method (e.g. select) was used.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 11 Feb 2013 15:12:06 +0000 |
parents | 24f2b8495f7d |
children | f1daa0356a1d |
line wrap: on
line source
# Copyright (C) Nginx, Inc. # clang NGX_CLANG_VER=`$CC -v 2>&1 | grep 'clang version' 2>&1 \ | sed -e 's/^.*clang version \(.*\)/\1/'` echo " + clang version: $NGX_CLANG_VER" have=NGX_COMPILER value="\"clang $NGX_CLANG_VER\"" . auto/define CC_TEST_FLAGS="-pipe" # optimizations #NGX_CLANG_OPT="-O2" #NGX_CLANG_OPT="-Oz" NGX_CLANG_OPT="-O" case $CPU in pentium) # optimize for Pentium CPU_OPT="-march=pentium" NGX_CPU_CACHE_LINE=32 ;; pentiumpro | pentium3) # optimize for Pentium Pro, Pentium II and Pentium III CPU_OPT="-march=pentiumpro" NGX_CPU_CACHE_LINE=32 ;; pentium4) # optimize for Pentium 4 CPU_OPT="-march=pentium4" NGX_CPU_CACHE_LINE=128 ;; athlon) # optimize for Athlon CPU_OPT="-march=athlon" NGX_CPU_CACHE_LINE=64 ;; opteron) # optimize for Opteron CPU_OPT="-march=opteron" NGX_CPU_CACHE_LINE=64 ;; esac CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT" CFLAGS="$CFLAGS -pipe $CPU_OPT" if [ ".$PCRE_OPT" = "." ]; then PCRE_OPT="-O2 -pipe $CPU_OPT" else PCRE_OPT="$PCRE_OPT -pipe" fi if [ ".$MD5_OPT" = "." ]; then MD5_OPT="-O2 -pipe $CPU_OPT" else MD5_OPT="$MD5_OPT -pipe" fi if [ ".$ZLIB_OPT" = "." ]; then ZLIB_OPT="-O2 -pipe $CPU_OPT" else ZLIB_OPT="$ZLIB_OPT -pipe" fi # warnings CFLAGS="$CFLAGS $NGX_CLANG_OPT -Wall -Wextra -Wpointer-arith" #CFLAGS="$CFLAGS -Wmissing-prototypes" # we have a lot of unused function arguments CFLAGS="$CFLAGS -Wno-unused-parameter" # stop on warning #CFLAGS="$CFLAGS -Werror" # debug CFLAGS="$CFLAGS -g" if [ ".$CPP" = "." ]; then CPP="$CC -E" fi