Don't allow socket close while writing h2 headers
This commit is contained in:
parent
3e3bbe3fd0
commit
6ec32805d0
@ -316,6 +316,10 @@ func (h *httpTransportSocket) Send(m *Message) error {
|
||||
// no op
|
||||
}
|
||||
|
||||
// we need to lock to protect the write
|
||||
h.mtx.RLock()
|
||||
defer h.mtx.RUnlock()
|
||||
|
||||
// set headers
|
||||
for k, v := range m.Header {
|
||||
h.w.Header().Set(k, v)
|
||||
|
Loading…
x
Reference in New Issue
Block a user