added visibility for upgrade Request/Response
This commit is contained in:
parent
741a243f87
commit
9fcd36d13d
|
@ -8,8 +8,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type T struct {
|
type T struct {
|
||||||
req *request.T
|
Request *request.T
|
||||||
res *response.T
|
Response *response.T
|
||||||
}
|
}
|
||||||
|
|
||||||
func Upgrade(s net.Conn) (*T, error) {
|
func Upgrade(s net.Conn) (*T, error) {
|
||||||
|
@ -18,13 +18,13 @@ func Upgrade(s net.Conn) (*T, error) {
|
||||||
inst := new(T)
|
inst := new(T)
|
||||||
|
|
||||||
/* (2) Parse request */
|
/* (2) Parse request */
|
||||||
inst.req, _ = request.Parse(s)
|
inst.Request, _ = request.Parse(s)
|
||||||
|
|
||||||
/* (3) Build response */
|
/* (3) Build response */
|
||||||
inst.res = inst.req.BuildResponse()
|
inst.Response = inst.Request.BuildResponse()
|
||||||
|
|
||||||
/* (4) Write into socket */
|
/* (4) Write into socket */
|
||||||
_, err := inst.res.Send(s)
|
_, err := inst.Response.Send(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return inst, fmt.Errorf("Socket write error: %s", err)
|
return inst, fmt.Errorf("Socket write error: %s", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue