mirror of
https://github.com/profullstack/agentbbs.git
synced 2026-08-13 22:37:28 +00:00
Handle repeated NNTP command whitespace (#20)
This commit is contained in:
parent
0944fa2cb4
commit
36c6e0e275
2 changed files with 96 additions and 5 deletions
|
|
@ -142,12 +142,16 @@ func (s *Server) Process(nc net.Conn) {
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
cmd := strings.Split(l, " ")
|
||||
args := []string{}
|
||||
if len(cmd) > 1 {
|
||||
args = cmd[1:]
|
||||
fields := strings.Fields(l)
|
||||
if len(fields) == 0 {
|
||||
err = handleDefault(nil, sess, c)
|
||||
} else {
|
||||
args := []string{}
|
||||
if len(fields) > 1 {
|
||||
args = fields[1:]
|
||||
}
|
||||
err = sess.dispatchCommand(fields[0], args, c)
|
||||
}
|
||||
err = sess.dispatchCommand(cmd[0], args, c)
|
||||
if err != nil {
|
||||
if _, isNNTPError := err.(*NNTPError); err == io.EOF {
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue