File tree Expand file tree Collapse file tree 4 files changed +9
-5
lines changed
Expand file tree Collapse file tree 4 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ func (r *rocketServerTransport) acceptLoop(ctx context.Context) error {
114114 // Read/Write calls - so that we can access ALPN value and choose the transport.
115115 tlsConn , isTLS := conn .(tlsConnectionStaterHandshaker )
116116 if isTLS {
117+ r .observer .ConnTLSAccepted ()
117118 r .stats .ConnsTLS .RecordEvent ()
118119
119120 err = tlsConn .HandshakeContext (ctx )
Original file line number Diff line number Diff line change @@ -22,8 +22,9 @@ import "time"
2222// for monitoring and troubleshooting purposes.
2323type ServerObserver interface {
2424 // Connection lifecycle events
25- ConnDropped () // server-initiated connection close
26- ConnAccepted () // new connection successfully accepted
25+ ConnDropped () // server-initiated connection close
26+ ConnAccepted () // new connection successfully accepted
27+ ConnTLSAccepted () // new TLS connection successfully accepted
2728
2829 // Request processing events
2930 TaskKilled () // request rejected due to parsing errors or shutdown
Original file line number Diff line number Diff line change @@ -34,8 +34,9 @@ func newNoopServerObserver() ServerObserver {
3434// All methods are no-op implementations
3535
3636// Connection lifecycle events
37- func (* noopServerObserver ) ConnDropped () {}
38- func (* noopServerObserver ) ConnAccepted () {}
37+ func (* noopServerObserver ) ConnDropped () {}
38+ func (* noopServerObserver ) ConnAccepted () {}
39+ func (* noopServerObserver ) ConnTLSAccepted () {}
3940
4041// Request processing events
4142func (* noopServerObserver ) TaskKilled () {}
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ func TestNoopServerObserver(t *testing.T) {
3131
3232 // Test that all methods can be called without panicking
3333 observer .ConnDropped ()
34+ observer .ConnAccepted ()
35+ observer .ConnTLSAccepted ()
3436 observer .TaskKilled ()
3537 observer .TaskTimeout ()
3638 observer .DeclaredException ()
@@ -39,6 +41,5 @@ func TestNoopServerObserver(t *testing.T) {
3941 observer .ReceivedRequest ()
4042 observer .SentReply ()
4143 observer .ActiveRequests (10 )
42- observer .ConnAccepted ()
4344 observer .ProcessTime (200 * time .Millisecond )
4445}
You can’t perform that action at this time.
0 commit comments