MCPcopy Index your code
hub / github.com/foxcpp/maddy / NewSession

Method NewSession

internal/testutils/smtp_server.go:64–75  ·  view source on GitHub ↗
(conn *smtp.Conn)

Source from the content-addressed store, hash-verified

62}
63
64func (be *SMTPBackend) NewSession(conn *smtp.Conn) (smtp.Session, error) {
65 be.SessionCounter++
66 be.ActiveSessionsCounter.Add(1)
67 if be.SourceEndpoints == nil {
68 be.SourceEndpoints = make(map[string]struct{})
69 }
70 be.SourceEndpoints[conn.Conn().RemoteAddr().String()] = struct{}{}
71 return &session{
72 backend: be,
73 conn: conn,
74 }, nil
75}
76
77func (be *SMTPBackend) ConnectionCount() int {
78 return int(be.ActiveSessionsCounter.Load())

Callers

nothing calls this directly

Calls 4

AddMethod · 0.80
RemoteAddrMethod · 0.80
ConnMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected