Mercurial > hg > nginx
comparison src/http/modules/ngx_http_ssl_module.c @ 5121:c0f7b94e88ba
Preliminary experimental support for SPDY draft 2.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Wed, 20 Mar 2013 10:36:57 +0000 |
parents | afee87b8190a |
children | 0fbcfab0bfd7 |
comparison
equal
deleted
inserted
replaced
5120:7956af6b6a02 | 5121:c0f7b94e88ba |
---|---|
273 | 273 |
274 static int | 274 static int |
275 ngx_http_ssl_npn_advertised(ngx_ssl_conn_t *ssl_conn, | 275 ngx_http_ssl_npn_advertised(ngx_ssl_conn_t *ssl_conn, |
276 const unsigned char **out, unsigned int *outlen, void *arg) | 276 const unsigned char **out, unsigned int *outlen, void *arg) |
277 { | 277 { |
278 #if (NGX_DEBUG) | 278 #if (NGX_HTTP_SPDY || NGX_DEBUG) |
279 ngx_connection_t *c; | 279 ngx_connection_t *c; |
280 | 280 |
281 c = ngx_ssl_get_connection(ssl_conn); | 281 c = ngx_ssl_get_connection(ssl_conn); |
282 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "SSL NPN advertised"); | 282 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "SSL NPN advertised"); |
283 #endif | |
284 | |
285 #if (NGX_HTTP_SPDY) | |
286 { | |
287 ngx_http_connection_t *hc; | |
288 | |
289 hc = c->data; | |
290 | |
291 if (hc->addr_conf->spdy) { | |
292 *out = (unsigned char *) NGX_SPDY_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE; | |
293 *outlen = sizeof(NGX_SPDY_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE) - 1; | |
294 | |
295 return SSL_TLSEXT_ERR_OK; | |
296 } | |
297 } | |
283 #endif | 298 #endif |
284 | 299 |
285 *out = (unsigned char *) NGX_HTTP_NPN_ADVERTISE; | 300 *out = (unsigned char *) NGX_HTTP_NPN_ADVERTISE; |
286 *outlen = sizeof(NGX_HTTP_NPN_ADVERTISE) - 1; | 301 *outlen = sizeof(NGX_HTTP_NPN_ADVERTISE) - 1; |
287 | 302 |