diff --git a/HubConnection.go b/HubConnection.go index 7cb9c4f..5e6b58a 100644 --- a/HubConnection.go +++ b/HubConnection.go @@ -89,7 +89,7 @@ func (this *HubConnection) userJoined_Full(uinf *UserInfo) { } // SayRaw sends raw bytes over the TCP socket. Callers should add the protocol -// terminating character `|` themselves. +// terminating character themselves (e.g. `|` for NMDC). // Note that protocol messages are transmitted on the caller thread, not from // any internal libnmdc thread. func (this *HubConnection) SayRaw(protocolCommand string) error { @@ -185,9 +185,12 @@ func (this *HubConnection) worker() { // Attempt to parse a message block for len(fullBuffer) > 0 { + + // FIXME nmdc for len(fullBuffer) > 0 && fullBuffer[0] == '|' { fullBuffer = fullBuffer[1:] } + protocolMessage := rxProtocolMessage.FindString(fullBuffer) if len(protocolMessage) > 0 { this.proto.ProcessCommand(protocolMessage[:len(protocolMessage)-1])