mirror of
https://github.com/nadoo/glider.git
synced 2025-02-23 17:35:40 +08:00
http: fixed #128
This commit is contained in:
parent
39cd60c50b
commit
ca88797df4
2
main.go
2
main.go
@ -30,7 +30,7 @@ import (
|
|||||||
_ "github.com/nadoo/glider/proxy/ws"
|
_ "github.com/nadoo/glider/proxy/ws"
|
||||||
)
|
)
|
||||||
|
|
||||||
var version = "0.9.1"
|
var version = "0.9.2"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// read configs
|
// read configs
|
||||||
|
@ -3,6 +3,7 @@ package http
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"errors"
|
||||||
"net/textproto"
|
"net/textproto"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
@ -45,7 +46,7 @@ func parseRequest(r *bufio.Reader) (*request, error) {
|
|||||||
|
|
||||||
method, uri, proto, ok := parseStartLine(line)
|
method, uri, proto, ok := parseStartLine(line)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, err
|
return nil, errors.New("error in parseStartLine")
|
||||||
}
|
}
|
||||||
|
|
||||||
header, err := tpr.ReadMIMEHeader()
|
header, err := tpr.ReadMIMEHeader()
|
||||||
|
@ -56,6 +56,7 @@ func (s *HTTP) Serve(cc net.Conn) {
|
|||||||
|
|
||||||
req, err := parseRequest(c.Reader())
|
req, err := parseRequest(c.Reader())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.F("[http] can not parse request from %s", c.RemoteAddr())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,4 +114,5 @@ func (m *Mixed) Serve(c net.Conn) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.F("[mixed] unknown request from %s, ignored", c.RemoteAddr())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user