Skip to content

Conversation

dejanstrbac
Copy link
Contributor

Currently imapserver will end connection if empty command is given (CR)

return nil
}

if dec.ExpectCRLF() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Expect family of functions sets the error field in the decoder. Since not getting a CRLF is valid, we should use Decoder.CRLF instead.

}

func (c *Conn) readCommand(dec *imapwire.Decoder) error {
for {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think using a for loop is necessary, plus it won't behave well regarding the command read timeout. We can just return if we got a CRLF and leave it to the caller to invoke readCommand again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants