summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules/ngx_http_ssl_module.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2013-03-20 10:36:57 +0000
committerValentin Bartenev <vbart@nginx.com>2013-03-20 10:36:57 +0000
commit2686cb44529462614a1846f29922bb68852dafb6 (patch)
treea46abd5e6cab450dbc23f220a424a296c0877e2b /src/http/modules/ngx_http_ssl_module.c
parentcf64a6c5361b23f1aa182e50537ebb4c6c34c453 (diff)
downloadnginx-2686cb44529462614a1846f29922bb68852dafb6.tar.gz
nginx-2686cb44529462614a1846f29922bb68852dafb6.tar.bz2
Preliminary experimental support for SPDY draft 2.
Diffstat (limited to 'src/http/modules/ngx_http_ssl_module.c')
-rw-r--r--src/http/modules/ngx_http_ssl_module.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_ssl_module.c b/src/http/modules/ngx_http_ssl_module.c
index eb1e61d2d..a6c803da0 100644
--- a/src/http/modules/ngx_http_ssl_module.c
+++ b/src/http/modules/ngx_http_ssl_module.c
@@ -275,13 +275,28 @@ static int
ngx_http_ssl_npn_advertised(ngx_ssl_conn_t *ssl_conn,
const unsigned char **out, unsigned int *outlen, void *arg)
{
-#if (NGX_DEBUG)
+#if (NGX_HTTP_SPDY || 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)
+ {
+ 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;
+
+ return SSL_TLSEXT_ERR_OK;
+ }
+ }
+#endif
+
*out = (unsigned char *) NGX_HTTP_NPN_ADVERTISE;
*outlen = sizeof(NGX_HTTP_NPN_ADVERTISE) - 1;