comparison src/http/ngx_http_request.c @ 5547:2e40188f83ef

Fixed a compile warning introduced by 01e2a5bcdd8f. On systems with OpenSSL that has NPN support but lacks ALPN support, some compilers emitted a warning about possibly uninitialized "data" variable.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 30 Jan 2014 19:13:12 +0400
parents 01e2a5bcdd8f
children 4d47722d76b2
comparison
equal deleted inserted replaced
5546:f385349d584b 5547:2e40188f83ef
711 { 711 {
712 unsigned int len; 712 unsigned int len;
713 const unsigned char *data; 713 const unsigned char *data;
714 static const ngx_str_t spdy = ngx_string(NGX_SPDY_NPN_NEGOTIATED); 714 static const ngx_str_t spdy = ngx_string(NGX_SPDY_NPN_NEGOTIATED);
715 715
716 len = 0;
717
718 #ifdef TLSEXT_TYPE_application_layer_protocol_negotiation 716 #ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
719 SSL_get0_alpn_selected(c->ssl->connection, &data, &len); 717 SSL_get0_alpn_selected(c->ssl->connection, &data, &len);
720 #endif
721 718
722 #ifdef TLSEXT_TYPE_next_proto_neg 719 #ifdef TLSEXT_TYPE_next_proto_neg
723 if (len == 0) { 720 if (len == 0) {
724 SSL_get0_next_proto_negotiated(c->ssl->connection, &data, &len); 721 SSL_get0_next_proto_negotiated(c->ssl->connection, &data, &len);
725 } 722 }
723 #endif
724
725 #else /* TLSEXT_TYPE_next_proto_neg */
726 SSL_get0_next_proto_negotiated(c->ssl->connection, &data, &len);
726 #endif 727 #endif
727 728
728 if (len == spdy.len && ngx_strncmp(data, spdy.data, spdy.len) == 0) { 729 if (len == spdy.len && ngx_strncmp(data, spdy.data, spdy.len) == 0) {
729 ngx_http_spdy_init(c->read); 730 ngx_http_spdy_init(c->read);
730 return; 731 return;