rework newRequest

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-07-09 16:27:49 +03:00
parent 520dc29f89
commit e497b5fa89
2 changed files with 81 additions and 86 deletions

View File

@@ -21,7 +21,6 @@ type httpStream struct {
cf codec.Codec
context context.Context
request client.Request
header http.Header
closed chan bool
reader *bufio.Reader
address string
@@ -62,13 +61,11 @@ func (h *httpStream) Send(msg interface{}) error {
return errShutdown
}
hreq, err := newRequest(h.address, h.request, h.ct, h.cf, msg, h.opts)
hreq, err := newRequest(h.context, h.address, h.request, h.ct, h.cf, msg, h.opts)
if err != nil {
return err
}
hreq.Header = h.header
return hreq.Write(h.conn)
}