mirror of
https://github.com/Sonarr/Sonarr
synced 2025-02-21 13:47:10 +00:00
Fixed curl multithreaded access.
This commit is contained in:
parent
7bc4249ede
commit
786e0b825a
1 changed files with 58 additions and 52 deletions
|
@ -39,6 +39,8 @@ namespace NzbDrone.Common.Http
|
|||
}
|
||||
|
||||
public HttpResponse GetResponse(HttpRequest httpRequest, HttpWebRequest webRequest)
|
||||
{
|
||||
lock (CurlGlobalHandle.Instance)
|
||||
{
|
||||
Stream responseStream = new MemoryStream();
|
||||
Stream headerStream = new MemoryStream();
|
||||
|
@ -91,6 +93,7 @@ namespace NzbDrone.Common.Http
|
|||
|
||||
return new HttpResponse(httpRequest, httpHeader, responseData, (HttpStatusCode)curlEasy.ResponseCode);
|
||||
}
|
||||
}
|
||||
|
||||
private CurlSlist SerializeHeaders(HttpWebRequest webRequest)
|
||||
{
|
||||
|
@ -205,6 +208,8 @@ namespace NzbDrone.Common.Http
|
|||
}
|
||||
|
||||
public bool Initialize()
|
||||
{
|
||||
lock (CurlGlobalHandle.Instance)
|
||||
{
|
||||
if (_initialized)
|
||||
return _available;
|
||||
|
@ -214,6 +219,7 @@ namespace NzbDrone.Common.Http
|
|||
|
||||
return _available;
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool ReleaseHandle()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue