diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1b709df..e400cd7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,8 +38,7 @@ Format your code (the path might be slightly different): Run the following commands, and address any issues which arise: * `go vet github.com/s-rah/go-ricochet/...` -* `golint github.com/s-rah/go-ricochet` -* `golint github.com/s-rah/go-ricochet/utils` +* `/golint application/ channels/ connection/ examples/ identity/ policies/ testing/ utils` ## 4. Code Review diff --git a/connection/autoconnectionhandler.go b/connection/autoconnectionhandler.go index f8a7c3e..0407b85 100644 --- a/connection/autoconnectionhandler.go +++ b/connection/autoconnectionhandler.go @@ -34,6 +34,7 @@ func (ach *AutoConnectionHandler) OnReady(oc *Connection) { func (ach *AutoConnectionHandler) OnClosed(err error) { } +// GetSupportedChannelTypes returns a list of channel types that are registered with the handler. func (ach *AutoConnectionHandler) GetSupportedChannelTypes() []string { supported := []string{} for k := range ach.handlerMap { diff --git a/connection/connection.go b/connection/connection.go index 1c846b1..27c5a77 100644 --- a/connection/connection.go +++ b/connection/connection.go @@ -480,12 +480,16 @@ func (rc *Connection) controlPacket(handler Handler, res *Protocol_Data_Control. } } +// EnableFeatures sends an EnableFeatures messages which includes the +// list of `features` func (rc *Connection) EnableFeatures(features []string) { messageBuilder := new(utils.MessageBuilder) raw := messageBuilder.EnableFeatures(features) rc.SendRicochetPacket(rc.Conn, 0, raw) } +// traceLog is an internal function which only logs messages +// if the connection is configured to log. func (rc *Connection) traceLog(message string) { if rc.trace { log.Printf(message) diff --git a/connection/outboundconnectionhandler.go b/connection/outboundconnectionhandler.go index 44bb2f3..a84413e 100644 --- a/connection/outboundconnectionhandler.go +++ b/connection/outboundconnectionhandler.go @@ -88,7 +88,3 @@ func (och *OutboundConnectionHandler) ProcessAuthAsClient(identity identity.Iden } return false, utils.ServerRejectedClientConnectionError } - -func (och *OutboundConnectionHandler) GetSupportChannels() { - -} diff --git a/utils/networking.go b/utils/networking.go index b41018d..9eef409 100644 --- a/utils/networking.go +++ b/utils/networking.go @@ -7,7 +7,10 @@ import ( ) const ( + // InvalidPacketLengthError is returned whenever ricochet receives a packet too small or too large to conform to the spec. InvalidPacketLengthError = Error("InvalidPacketLengthError") + + // InvalidChannelIDError channels must be between 0 and 65535 InvalidChannelIDError = Error("InvalidChannelIDError") )