comparison src/http/modules/ngx_http_ssl_module.c @ 6246:257b51c37c5a

The HTTP/2 implementation (RFC 7240, 7241). The SPDY support is removed, as it's incompatible with the new module.
author Valentin Bartenev <vbart@nginx.com>
date Fri, 11 Sep 2015 20:13:06 +0300
parents b2899e7d0ef8
children 2cd019520210
comparison
equal deleted inserted replaced
6245:3cf25d33886a 6246:257b51c37c5a
324 unsigned int srvlen; 324 unsigned int srvlen;
325 unsigned char *srv; 325 unsigned char *srv;
326 #if (NGX_DEBUG) 326 #if (NGX_DEBUG)
327 unsigned int i; 327 unsigned int i;
328 #endif 328 #endif
329 #if (NGX_HTTP_SPDY) 329 #if (NGX_HTTP_V2)
330 ngx_http_connection_t *hc; 330 ngx_http_connection_t *hc;
331 #endif 331 #endif
332 #if (NGX_HTTP_SPDY || NGX_DEBUG) 332 #if (NGX_HTTP_V2 || NGX_DEBUG)
333 ngx_connection_t *c; 333 ngx_connection_t *c;
334 334
335 c = ngx_ssl_get_connection(ssl_conn); 335 c = ngx_ssl_get_connection(ssl_conn);
336 #endif 336 #endif
337 337
340 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, 340 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
341 "SSL ALPN supported by client: %*s", in[i], &in[i + 1]); 341 "SSL ALPN supported by client: %*s", in[i], &in[i + 1]);
342 } 342 }
343 #endif 343 #endif
344 344
345 #if (NGX_HTTP_SPDY) 345 #if (NGX_HTTP_V2)
346 hc = c->data; 346 hc = c->data;
347 347
348 if (hc->addr_conf->spdy) { 348 if (hc->addr_conf->http2) {
349 srv = (unsigned char *) NGX_SPDY_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE; 349 srv =
350 srvlen = sizeof(NGX_SPDY_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE) - 1; 350 (unsigned char *) NGX_HTTP_V2_ALPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE;
351 srvlen = sizeof(NGX_HTTP_V2_ALPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE) - 1;
351 352
352 } else 353 } else
353 #endif 354 #endif
354 { 355 {
355 srv = (unsigned char *) NGX_HTTP_NPN_ADVERTISE; 356 srv = (unsigned char *) NGX_HTTP_NPN_ADVERTISE;
376 377
377 static int 378 static int
378 ngx_http_ssl_npn_advertised(ngx_ssl_conn_t *ssl_conn, 379 ngx_http_ssl_npn_advertised(ngx_ssl_conn_t *ssl_conn,
379 const unsigned char **out, unsigned int *outlen, void *arg) 380 const unsigned char **out, unsigned int *outlen, void *arg)
380 { 381 {
381 #if (NGX_HTTP_SPDY || NGX_DEBUG) 382 #if (NGX_HTTP_V2 || NGX_DEBUG)
382 ngx_connection_t *c; 383 ngx_connection_t *c;
383 384
384 c = ngx_ssl_get_connection(ssl_conn); 385 c = ngx_ssl_get_connection(ssl_conn);
385 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "SSL NPN advertised"); 386 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "SSL NPN advertised");
386 #endif 387 #endif
387 388
388 #if (NGX_HTTP_SPDY) 389 #if (NGX_HTTP_V2)
389 { 390 {
390 ngx_http_connection_t *hc; 391 ngx_http_connection_t *hc;
391 392
392 hc = c->data; 393 hc = c->data;
393 394
394 if (hc->addr_conf->spdy) { 395 if (hc->addr_conf->http2) {
395 *out = (unsigned char *) NGX_SPDY_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE; 396 *out =
396 *outlen = sizeof(NGX_SPDY_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE) - 1; 397 (unsigned char *) NGX_HTTP_V2_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE;
398 *outlen = sizeof(NGX_HTTP_V2_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE) - 1;
397 399
398 return SSL_TLSEXT_ERR_OK; 400 return SSL_TLSEXT_ERR_OK;
399 } 401 }
400 } 402 }
401 #endif 403 #endif