From 9fcd36d13ddaf2c52fef615310a9f3c013903456 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 26 Apr 2018 23:26:39 +0200 Subject: [PATCH] added visibility for upgrade Request/Response --- upgrader/public.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/upgrader/public.go b/upgrader/public.go index d082d26..b7dc28d 100644 --- a/upgrader/public.go +++ b/upgrader/public.go @@ -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) }