mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 09:37:02 +00:00
Renames, closes #69
- storage: rename StoreMessage to Message - storage: rename Message.RawReader() to Source()
This commit is contained in:
@@ -57,17 +57,17 @@ var commands = map[string]bool{
|
||||
|
||||
// Session defines an active POP3 session
|
||||
type Session struct {
|
||||
server *Server // Reference to the server we belong to
|
||||
id int // Session ID number
|
||||
conn net.Conn // Our network connection
|
||||
remoteHost string // IP address of client
|
||||
sendError error // Used to bail out of read loop on send error
|
||||
state State // Current session state
|
||||
reader *bufio.Reader // Buffered reader for our net conn
|
||||
user string // Mailbox name
|
||||
messages []storage.StoreMessage // Slice of messages in mailbox
|
||||
retain []bool // Messages to retain upon UPDATE (true=retain)
|
||||
msgCount int // Number of undeleted messages
|
||||
server *Server // Reference to the server we belong to
|
||||
id int // Session ID number
|
||||
conn net.Conn // Our network connection
|
||||
remoteHost string // IP address of client
|
||||
sendError error // Used to bail out of read loop on send error
|
||||
state State // Current session state
|
||||
reader *bufio.Reader // Buffered reader for our net conn
|
||||
user string // Mailbox name
|
||||
messages []storage.Message // Slice of messages in mailbox
|
||||
retain []bool // Messages to retain upon UPDATE (true=retain)
|
||||
msgCount int // Number of undeleted messages
|
||||
}
|
||||
|
||||
// NewSession creates a new POP3 session
|
||||
@@ -415,8 +415,8 @@ func (ses *Session) transactionHandler(cmd string, args []string) {
|
||||
}
|
||||
|
||||
// Send the contents of the message to the client
|
||||
func (ses *Session) sendMessage(msg storage.StoreMessage) {
|
||||
reader, err := msg.RawReader()
|
||||
func (ses *Session) sendMessage(msg storage.Message) {
|
||||
reader, err := msg.Source()
|
||||
if err != nil {
|
||||
ses.logError("Failed to read message for RETR command")
|
||||
ses.send("-ERR Failed to RETR that message, internal error")
|
||||
@@ -448,8 +448,8 @@ func (ses *Session) sendMessage(msg storage.StoreMessage) {
|
||||
}
|
||||
|
||||
// Send the headers plus the top N lines to the client
|
||||
func (ses *Session) sendMessageTop(msg storage.StoreMessage, lineCount int) {
|
||||
reader, err := msg.RawReader()
|
||||
func (ses *Session) sendMessageTop(msg storage.Message, lineCount int) {
|
||||
reader, err := msg.Source()
|
||||
if err != nil {
|
||||
ses.logError("Failed to read message for RETR command")
|
||||
ses.send("-ERR Failed to RETR that message, internal error")
|
||||
|
||||
Reference in New Issue
Block a user