use a smaller packetHandler interface

The packetHandler interface just needs two methods: one for handling
packets, and one for closing.
This commit is contained in:
Marten Seemann
2018-05-21 09:19:16 +08:00
parent ef34d9e85f
commit b3fd768a61
11 changed files with 147 additions and 142 deletions

View File

@@ -42,7 +42,7 @@ type client struct {
handshakeChan chan struct{}
session packetHandler
session quicSession
logger utils.Logger
}
@@ -483,7 +483,7 @@ func (c *client) createNewGQUICSession() (err error) {
c.mutex.Lock()
defer c.mutex.Unlock()
runner := &runner{
onHandshakeCompleteImpl: func(_ packetHandler) { close(c.handshakeChan) },
onHandshakeCompleteImpl: func(_ Session) { close(c.handshakeChan) },
removeConnectionIDImpl: func(protocol.ConnectionID) {},
}
c.session, err = newClientSession(
@@ -508,7 +508,7 @@ func (c *client) createNewTLSSession(
c.mutex.Lock()
defer c.mutex.Unlock()
runner := &runner{
onHandshakeCompleteImpl: func(_ packetHandler) { close(c.handshakeChan) },
onHandshakeCompleteImpl: func(_ Session) { close(c.handshakeChan) },
removeConnectionIDImpl: func(protocol.ConnectionID) {},
}
c.session, err = newTLSClientSession(