added visibility for upgrade Request/Response

This commit is contained in:
xdrm-brackets 2018-04-26 23:26:39 +02:00
parent 741a243f87
commit 9fcd36d13d
1 changed files with 5 additions and 5 deletions

View File

@ -8,8 +8,8 @@ import (
)
type T struct {
req *request.T
res *response.T
Request *request.T
Response *response.T
}
func Upgrade(s net.Conn) (*T, error) {
@ -18,13 +18,13 @@ func Upgrade(s net.Conn) (*T, error) {
inst := new(T)
/* (2) Parse request */
inst.req, _ = request.Parse(s)
inst.Request, _ = request.Parse(s)
/* (3) Build response */
inst.res = inst.req.BuildResponse()
inst.Response = inst.Request.BuildResponse()
/* (4) Write into socket */
_, err := inst.res.Send(s)
_, err := inst.Response.Send(s)
if err != nil {
return inst, fmt.Errorf("Socket write error: %s", err)
}