Mercurial > hg > nginx
comparison src/stream/ngx_stream_ssl_preread_module.c @ 6728:8f75d9883730
Stream ssl_preread: fixed $ssl_preread_server_name variable.
Made sure to set the variable length only after successful SNI parsing.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 05 Oct 2016 18:11:39 +0300 |
parents | e83540f825cd |
children | 01adb18a5d23 |
comparison
equal
deleted
inserted
replaced
6727:ca709bca4b77 | 6728:8f75d9883730 |
---|---|
331 ctx->host.data = ngx_pnalloc(ctx->pool, size); | 331 ctx->host.data = ngx_pnalloc(ctx->pool, size); |
332 if (ctx->host.data == NULL) { | 332 if (ctx->host.data == NULL) { |
333 return NGX_ERROR; | 333 return NGX_ERROR; |
334 } | 334 } |
335 | 335 |
336 ctx->host.len = size; | |
337 dst = ctx->host.data; | 336 dst = ctx->host.data; |
338 break; | 337 break; |
339 | 338 |
340 case sw_sni_host: | 339 case sw_sni_host: |
340 ctx->host.len = (p[1] << 8) + p[2]; | |
341 | |
341 ngx_log_debug1(NGX_LOG_DEBUG_STREAM, ctx->log, 0, | 342 ngx_log_debug1(NGX_LOG_DEBUG_STREAM, ctx->log, 0, |
342 "ssl preread: SNI hostname \"%V\"", &ctx->host); | 343 "ssl preread: SNI hostname \"%V\"", &ctx->host); |
343 return NGX_OK; | 344 return NGX_OK; |
344 } | 345 } |
345 | 346 |