@@ -1384,7 +1384,7 @@ func buildHTTPListener(t, s interface{}) string {
1384
1384
addrV4 = tc .Cfg .BindAddressIpv4
1385
1385
}
1386
1386
1387
- co := commonListenOptions (& tc , hostname )
1387
+ co := commonListenOptions (& tc , hostname , true )
1388
1388
1389
1389
out = append (out , httpListener (addrV4 , co , & tc )... )
1390
1390
@@ -1417,14 +1417,18 @@ func buildHTTPSListener(t, s interface{}) string {
1417
1417
return ""
1418
1418
}
1419
1419
1420
- co := commonListenOptions (& tc , hostname )
1420
+ httpsCo := commonListenOptions (& tc , hostname , true )
1421
+ quicCo := commonListenOptions (& tc , hostname , false )
1421
1422
1422
1423
addrV4 := []string {"" }
1423
1424
if len (tc .Cfg .BindAddressIpv4 ) > 0 {
1424
1425
addrV4 = tc .Cfg .BindAddressIpv4
1425
1426
}
1426
1427
1427
- out = append (out , httpsListener (addrV4 , co , & tc )... )
1428
+ out = append (out , httpsListener (addrV4 , httpsCo , & tc )... )
1429
+ if tc .IsQUICEnabled {
1430
+ out = append (out , quicListener (addrV4 , quicCo , & tc )... )
1431
+ }
1428
1432
1429
1433
if ! tc .IsIPV6Enabled {
1430
1434
return strings .Join (out , "\n " )
@@ -1435,12 +1439,15 @@ func buildHTTPSListener(t, s interface{}) string {
1435
1439
addrV6 = tc .Cfg .BindAddressIpv6
1436
1440
}
1437
1441
1438
- out = append (out , httpsListener (addrV6 , co , & tc )... )
1442
+ out = append (out , httpsListener (addrV6 , httpsCo , & tc )... )
1443
+ if tc .IsQUICEnabled {
1444
+ out = append (out , quicListener (addrV6 , quicCo , & tc )... )
1445
+ }
1439
1446
1440
1447
return strings .Join (out , "\n " )
1441
1448
}
1442
1449
1443
- func commonListenOptions (template * config.TemplateConfig , hostname string ) string {
1450
+ func commonListenOptions (template * config.TemplateConfig , hostname string , withBacklog bool ) string {
1444
1451
var out []string
1445
1452
1446
1453
if template .Cfg .UseProxyProtocol {
@@ -1459,7 +1466,9 @@ func commonListenOptions(template *config.TemplateConfig, hostname string) strin
1459
1466
out = append (out , "reuseport" )
1460
1467
}
1461
1468
1462
- out = append (out , fmt .Sprintf ("backlog=%v" , template .BacklogSize ))
1469
+ if withBacklog {
1470
+ out = append (out , fmt .Sprintf ("backlog=%v" , template .BacklogSize ))
1471
+ }
1463
1472
1464
1473
return strings .Join (out , " " )
1465
1474
}
@@ -1509,13 +1518,12 @@ func httpsListener(addresses []string, co string, tc *config.TemplateConfig) []s
1509
1518
1510
1519
out = append (out , strings .Join (lo , " " ))
1511
1520
}
1512
- if ! tc .IsQUICEnabled {
1513
- return out
1514
- }
1515
- if strings .Contains (co , "backlog=" ) {
1516
- klog .V (3 ).InfoS ("Skipping HTTP/3 because of incompatible backlog parameter" )
1517
- return out
1518
- }
1521
+
1522
+ return out
1523
+ }
1524
+
1525
+ func quicListener (addresses []string , co string , tc * config.TemplateConfig ) []string {
1526
+ out := make ([]string , 0 )
1519
1527
for _ , address := range addresses {
1520
1528
lo := []string {"listen" }
1521
1529
0 commit comments