Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 31 changed files with 9,383 additions and 5,924 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ before_install:
# so we can run `make`, `make test`, `make install`.

script:
- ./configure --enable-mods-static=all --with-ipv6 --with-http_spdy_module
- ./configure --enable-mods-static=all --with-ipv6 --with-http_v2_module
- make
- sudo make install
2 changes: 1 addition & 1 deletion auto/make
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ echo "creating $NGX_MAKEFILE"

mkdir -p $NGX_OBJS/src/core $NGX_OBJS/src/event $NGX_OBJS/src/event/modules \
$NGX_OBJS/src/os/unix $NGX_OBJS/src/os/win32 \
$NGX_OBJS/src/http $NGX_OBJS/src/http/modules \
$NGX_OBJS/src/http $NGX_OBJS/src/http/v2 $NGX_OBJS/src/http/modules \
$NGX_OBJS/src/http/modules/perl \
$NGX_OBJS/modules/ngx_http_lua_module/src \
$NGX_OBJS/src/http/modules/tfs \
Expand Down
18 changes: 9 additions & 9 deletions auto/modules
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ fi
# ngx_http_write_filter
# ngx_http_header_filter
# ngx_http_chunked_filter
# ngx_http_spdy_filter
# ngx_http_v2_filter
# ngx_http_range_header_filter
# ngx_http_gzip_filter
# ngx_http_postpone_filter
Expand All @@ -147,8 +147,8 @@ HTTP_FILTER_MODULES="$HTTP_WRITE_FILTER_MODULE \
$HTTP_HEADER_FILTER_MODULE \
$HTTP_CHUNKED_FILTER_MODULE"

if [ $HTTP_SPDY = YES ]; then
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_SPDY_FILTER_MODULE"
if [ $HTTP_V2 = YES ]; then
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_V2_FILTER_MODULE"
fi

HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_RANGE_HEADER_FILTER_MODULE"
Expand Down Expand Up @@ -242,12 +242,12 @@ if [ $HTTP_USERID = YES ]; then
fi


if [ $HTTP_SPDY = YES ]; then
have=NGX_HTTP_SPDY . auto/have
USE_ZLIB=YES
HTTP_MODULES="$HTTP_MODULES $HTTP_SPDY_MODULE"
HTTP_DEPS="$HTTP_DEPS $HTTP_SPDY_DEPS"
HTTP_SRCS="$HTTP_SRCS $HTTP_SPDY_SRCS"
if [ $HTTP_V2 = YES ]; then
have=NGX_HTTP_V2 . auto/have
HTTP_MODULES="$HTTP_MODULES $HTTP_V2_MODULE"
HTTP_INCS="$HTTP_INCS $HTTP_V2_INCS"
HTTP_DEPS="$HTTP_DEPS $HTTP_V2_DEPS"
HTTP_SRCS="$HTTP_SRCS $HTTP_V2_SRCS"
fi


Expand Down
12 changes: 6 additions & 6 deletions auto/options
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ HTTP_CACHE=YES
HTTP_CHARSET=YES
HTTP_GZIP=YES
HTTP_SSL=YES
HTTP_SPDY=NO
HTTP_V2=NO
HTTP_SSI=YES
HTTP_POSTPONE=NO
HTTP_REALIP=NO
Expand Down Expand Up @@ -412,7 +412,7 @@ do

--crossbuild=*) NGX_PLATFORM="$value" ;;

--build=*) NGX_BUILD="$value" ;;
--build=*) NGX_BUILD="$value" ;;
--builddir=*) NGX_OBJS="$value" ;;

--enable-mods-shared=all) NGX_SHARED_ALL_MODULES=YES ;;
Expand All @@ -430,7 +430,7 @@ do
#--with-threads) USE_THREADS="pthreads" ;;

# PROCS
--without-procs) PROCS=NO ;;
--without-procs) PROCS=NO ;;

--with-file-aio) NGX_FILE_AIO=YES ;;
--with-ipv6) NGX_IPV6=YES ;;
Expand All @@ -451,7 +451,7 @@ do
--http-scgi-temp-path=*) NGX_HTTP_SCGI_TEMP_PATH="$value" ;;

--with-http_ssl_module) HTTP_SSL=YES ;;
--with-http_spdy_module) HTTP_SPDY=YES ;;
--with-http_v2_module) HTTP_V2=YES ;;
--with-http_realip_module) HTTP_REALIP=YES ;;
--with-http_addition_module) HTTP_ADDITION=YES
HTTP_ADDITION_SHARED=NO ;;
Expand Down Expand Up @@ -777,7 +777,7 @@ cat << END

--without-dso disable dso module load

--with-http_spdy_module enable ngx_http_spdy_module
--with-http_v2_module enable ngx_http_v2_module
--with-http_realip_module enable ngx_http_realip_module
--with-http_addition_module enable ngx_http_addition_filter_module
--with-http_xslt_module enable ngx_http_xslt_filter_module
Expand Down Expand Up @@ -1071,7 +1071,7 @@ if [ $NGX_SHARED_ALL_MODULES = YES ]; then
HTTP_REQ_STATUS=NO

elif [ $NGX_STATIC_ALL_MODULES = YES ]; then
HTTP_SPDY=YES
HTTP_HTTP2=YES
HTTP_CACHE=YES
HTTP_CHARSET=YES
HTTP_GZIP=YES
Expand Down
18 changes: 11 additions & 7 deletions auto/sources
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,17 @@ HTTP_POSTPONE_FILTER_SRCS=src/http/ngx_http_postpone_filter_module.c
HTTP_FILE_CACHE_SRCS=src/http/ngx_http_file_cache.c


HTTP_SPDY_MODULE=ngx_http_spdy_module
HTTP_SPDY_FILTER_MODULE=ngx_http_spdy_filter_module
HTTP_SPDY_DEPS="src/http/ngx_http_spdy.h \
src/http/ngx_http_spdy_module.h"
HTTP_SPDY_SRCS="src/http/ngx_http_spdy.c \
src/http/ngx_http_spdy_module.c \
src/http/ngx_http_spdy_filter_module.c"
HTTP_V2_MODULE=ngx_http_v2_module
HTTP_V2_FILTER_MODULE=ngx_http_v2_filter_module
HTTP_V2_INCS="src/http/v2"
HTTP_V2_DEPS="src/http/v2/ngx_http_v2.h \
src/http/v2/ngx_http_v2_module.h"
HTTP_V2_SRCS="src/http/v2/ngx_http_v2.c \
src/http/v2/ngx_http_v2_table.c \
src/http/v2/ngx_http_v2_huff_decode.c \
src/http/v2/ngx_http_v2_huff_encode.c \
src/http/v2/ngx_http_v2_module.c \
src/http/v2/ngx_http_v2_filter_module.c"


HTTP_CHARSET_FILTER_MODULE=ngx_http_charset_filter_module
Expand Down
67 changes: 0 additions & 67 deletions docs/modules/ngx_http_spdy_module.md

This file was deleted.

2 changes: 1 addition & 1 deletion good_configure
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/usr/local/include/luajit-2.0
make clean; CC=clang; CFLAGS="-g -O0" ./configure --prefix=$PWD/out --enable-mods-static=all --with-ld-opt="-Wl,-rpath,/usr/local/lib" --with-debug --with-http_upstream_check_module --with-http_spdy_module --with-http_dyups_module --with-http_dyups_lua_api --with-http_sysguard_module --add-module=/home/lhanjian/ali/tengine_now/ngx_devel_kit-master && make -j4
make clean; CC=clang; CFLAGS="-g -O0" ./configure --prefix=$PWD/out --enable-mods-static=all --with-ld-opt="-Wl,-rpath,/usr/local/lib" --with-debug --with-http_upstream_check_module --with-http_v2_module --with-http_dyups_module --with-http_dyups_lua_api --with-http_sysguard_module --add-module=/home/lhanjian/ali/tengine_now/ngx_devel_kit-master && make -j4
2 changes: 1 addition & 1 deletion modules/ngx_http_lua_module/util/build2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ time ngx-build $force $version \
--add-module=$root/../ndk-nginx-module \
--add-module=$root/../set-misc-nginx-module \
--with-ld-opt="-L$PCRE_LIB -Wl,-rpath,$PCRE_LIB:$LIBDRIZZLE_LIB:/usr/local/lib" \
--with-http_spdy_module \
--with-http_v2_module \
--without-mail_pop3_module \
--without-mail_imap_module \
--with-http_image_filter_module \
Expand Down
8 changes: 4 additions & 4 deletions packages/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#export DH_VERBOSE=1
CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
WITH_SPDY := $(shell printf "Source: tengine\nBuild-Depends: libssl-dev (>= 1.0.1)\n" | \
WITH_HTTP2 := $(shell printf "Source: tengine\nBuild-Depends: libssl-dev (>= 1.0.1)\n" | \
dpkg-checkbuilddeps - >/dev/null 2>&1 && \
echo "--with-http_spdy_module")
echo "--with-http_v2_module")

%:
dh $@
Expand Down Expand Up @@ -48,7 +48,7 @@ override_dh_auto_build:
--with-mail \
--with-mail_ssl_module \
--with-file-aio \
$(WITH_SPDY) \
$(WITH_HTTP2) \
--with-cc-opt="$(CFLAGS)" \
--with-ld-opt="$(LDFLAGS)" \
--with-ipv6
Expand Down Expand Up @@ -85,7 +85,7 @@ configure_debug:
--with-mail \
--with-mail_ssl_module \
--with-file-aio \
$(WITH_SPDY) \
$(WITH_HTTP2) \
--with-cc-opt="$(CFLAGS)" \
--with-ld-opt="$(LDFLAGS)" \
--with-ipv6 \
Expand Down
2 changes: 1 addition & 1 deletion src/core/ngx_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ typedef enum {

#define NGX_LOWLEVEL_BUFFERED 0x0f
#define NGX_SSL_BUFFERED 0x01
#define NGX_SPDY_BUFFERED 0x02
#define NGX_HTTP_V2_BUFFERED 0x02


struct ngx_connection_s {
Expand Down
28 changes: 15 additions & 13 deletions src/http/modules/ngx_http_ssl_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include <ngx_core.h>
#include <ngx_http.h>

#if (NGX_HTTP_SPDY)
#include <ngx_http_spdy_module.h>
#if (NGX_HTTP_HTTP2)
#include <v2/ngx_http_v2_module.h>
#endif

typedef ngx_int_t (*ngx_ssl_variable_handler_pt)(ngx_connection_t *c,
Expand Down Expand Up @@ -344,10 +344,10 @@ ngx_http_ssl_alpn_select(ngx_ssl_conn_t *ssl_conn, const unsigned char **out,
#if (NGX_DEBUG)
unsigned int i;
#endif
#if (NGX_HTTP_SPDY)
#if (NGX_HTTP_V2)
ngx_http_connection_t *hc;
#endif
#if (NGX_HTTP_SPDY || NGX_DEBUG)
#if (NGX_HTTP_V2 || NGX_DEBUG)
ngx_connection_t *c;

c = ngx_ssl_get_connection(ssl_conn);
Expand All @@ -360,12 +360,13 @@ ngx_http_ssl_alpn_select(ngx_ssl_conn_t *ssl_conn, const unsigned char **out,
}
#endif

#if (NGX_HTTP_SPDY)
#if (NGX_HTTP_V2)
hc = c->data;

if (hc->addr_conf->spdy) {
srv = (unsigned char *) NGX_SPDY_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE;
srvlen = sizeof(NGX_SPDY_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE) - 1;
if (hc->addr_conf->http2) {
srv =
(unsigned char *) NGX_HTTP_V2_ALPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE;
srvlen = sizeof(NGX_HTTP_V2_ALPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE) - 1;

} else
#endif
Expand Down Expand Up @@ -396,22 +397,23 @@ static int
ngx_http_ssl_npn_advertised(ngx_ssl_conn_t *ssl_conn,
const unsigned char **out, unsigned int *outlen, void *arg)
{
#if (NGX_HTTP_SPDY || NGX_DEBUG)
#if (NGX_HTTP_V2 || NGX_DEBUG)
ngx_connection_t *c;

c = ngx_ssl_get_connection(ssl_conn);
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "SSL NPN advertised");
#endif

#if (NGX_HTTP_SPDY)
#if (NGX_HTTP_V2)
{
ngx_http_connection_t *hc;

hc = c->data;

if (hc->addr_conf->spdy) {
*out = (unsigned char *) NGX_SPDY_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE;
*outlen = sizeof(NGX_SPDY_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE) - 1;
if (hc->addr_conf->http2) {
*out =
(unsigned char *) NGX_HTTP_V2_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE;
*outlen = sizeof(NGX_HTTP_V2_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE) - 1;

return SSL_TLSEXT_ERR_OK;
}
Expand Down
Loading

0 comments on commit a0deec2

Please sign in to comment.