Mercurial > hg > nginx
comparison src/core/ngx_connection.c @ 8813:6674a50cbb6c quic
Merged with the default branch.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 15 Jul 2021 16:28:21 +0300 |
parents | 13f7085b90d2 46815874bcc6 |
children | 486c6a9be111 |
comparison
equal
deleted
inserted
replaced
8812:e7a2d3914877 | 8813:6674a50cbb6c |
---|---|
493 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, | 493 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, |
494 ngx_socket_n " %V failed", &ls[i].addr_text); | 494 ngx_socket_n " %V failed", &ls[i].addr_text); |
495 return NGX_ERROR; | 495 return NGX_ERROR; |
496 } | 496 } |
497 | 497 |
498 if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, | 498 if (ls[i].type != SOCK_DGRAM || !ngx_test_config) { |
499 (const void *) &reuseaddr, sizeof(int)) | 499 |
500 == -1) | 500 if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, |
501 { | 501 (const void *) &reuseaddr, sizeof(int)) |
502 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, | 502 == -1) |
503 "setsockopt(SO_REUSEADDR) %V failed", | 503 { |
504 &ls[i].addr_text); | |
505 | |
506 if (ngx_close_socket(s) == -1) { | |
507 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, | 504 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, |
508 ngx_close_socket_n " %V failed", | 505 "setsockopt(SO_REUSEADDR) %V failed", |
509 &ls[i].addr_text); | 506 &ls[i].addr_text); |
510 } | 507 |
511 | 508 if (ngx_close_socket(s) == -1) { |
512 return NGX_ERROR; | 509 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, |
510 ngx_close_socket_n " %V failed", | |
511 &ls[i].addr_text); | |
512 } | |
513 | |
514 return NGX_ERROR; | |
515 } | |
513 } | 516 } |
514 | 517 |
515 #if (NGX_HAVE_REUSEPORT) | 518 #if (NGX_HAVE_REUSEPORT) |
516 | 519 |
517 if (ls[i].reuseport && !ngx_test_config) { | 520 if (ls[i].reuseport && !ngx_test_config) { |