libgit2: enforce timeouts for http transports
Attach context to HTTP requests at the transport level to honour timeouts. Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
This commit is contained in:
parent
a252532c65
commit
cd03c26083
|
@ -419,6 +419,7 @@ func (self *httpSmartSubtransportStream) sendRequest() error {
|
||||||
URL: self.req.URL,
|
URL: self.req.URL,
|
||||||
Header: self.req.Header,
|
Header: self.req.Header,
|
||||||
}
|
}
|
||||||
|
req = req.WithContext(self.owner.ctx)
|
||||||
|
|
||||||
if req.Method == "POST" {
|
if req.Method == "POST" {
|
||||||
if len(content) == 0 {
|
if len(content) == 0 {
|
||||||
|
|
Loading…
Reference in New Issue