Skip to content

Commit bda3c9c

Browse files
committed
Start prototyping SPDY support.
POST does not work, probably tons of memory leaks and security vulnerabilities.
1 parent 60a50f7 commit bda3c9c

11 files changed

+1731
-37
lines changed

auto/modules

+4-3
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,10 @@ fi
267267
if [ $HTTP_SSL = YES ]; then
268268
USE_OPENSSL=YES
269269
have=NGX_HTTP_SSL . auto/have
270-
HTTP_MODULES="$HTTP_MODULES $HTTP_SSL_MODULE"
271-
HTTP_DEPS="$HTTP_DEPS $HTTP_SSL_DEPS"
272-
HTTP_SRCS="$HTTP_SRCS $HTTP_SSL_SRCS"
270+
have=NGX_HTTP_SPDY . auto/have
271+
HTTP_MODULES="$HTTP_MODULES $HTTP_SSL_MODULE $HTTP_SPDY_MODULE"
272+
HTTP_DEPS="$HTTP_DEPS $HTTP_SSL_DEPS $HTTP_SPDY_DEPS"
273+
HTTP_SRCS="$HTTP_SRCS $HTTP_SSL_SRCS $HTTP_SPDY_SRCS"
273274
fi
274275

275276
if [ $HTTP_PROXY = YES ]; then

auto/sources

+4
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,10 @@ HTTP_SSL_MODULE=ngx_http_ssl_module
412412
HTTP_SSL_DEPS=src/http/modules/ngx_http_ssl_module.h
413413
HTTP_SSL_SRCS=src/http/modules/ngx_http_ssl_module.c
414414

415+
HTTP_SPDY_MODULE=ngx_http_spdy_module
416+
HTTP_SPDY_DEPS=src/http/modules/ngx_http_spdy_module.h
417+
HTTP_SPDY_SRCS=src/http/modules/ngx_http_spdy_module.c
418+
415419

416420
HTTP_PROXY_MODULE=ngx_http_proxy_module
417421
HTTP_PROXY_SRCS=src/http/modules/ngx_http_proxy_module.c

src/core/ngx_connection.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ ngx_close_connection(ngx_connection_t *c)
851851
ngx_uint_t log_error, level;
852852
ngx_socket_t fd;
853853

854-
if (c->fd == -1) {
854+
if (c->unclosable != 1 && c->fd == -1) {
855855
ngx_log_error(NGX_LOG_ALERT, c->log, 0, "connection already closed");
856856
return;
857857
}
@@ -930,7 +930,7 @@ ngx_close_connection(ngx_connection_t *c)
930930
fd = c->fd;
931931
c->fd = (ngx_socket_t) -1;
932932

933-
if (ngx_close_socket(fd) == -1) {
933+
if (c->unclosable != 1 && ngx_close_socket(fd) == -1) {
934934

935935
err = ngx_socket_errno;
936936

src/core/ngx_connection.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ struct ngx_listening_s {
7979
#if (NGX_HAVE_SETFIB)
8080
int setfib;
8181
#endif
82-
8382
};
8483

8584

@@ -176,6 +175,10 @@ struct ngx_connection_s {
176175
ngx_buf_t *busy_sendfile;
177176
#endif
178177

178+
#if (NGX_HTTP_SPDY)
179+
unsigned unclosable:1;
180+
#endif
181+
179182
#if (NGX_THREADS)
180183
ngx_atomic_t lock;
181184
#endif

src/event/ngx_event_openssl.h

-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ void ngx_cdecl ngx_ssl_error(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
153153
char *fmt, ...);
154154
void ngx_ssl_cleanup_ctx(void *data);
155155

156-
157156
extern int ngx_ssl_connection_index;
158157
extern int ngx_ssl_server_conf_index;
159158
extern int ngx_ssl_session_cache_index;

0 commit comments

Comments
 (0)