mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
httpclient stream timout ignored under xml deserialize, so waste memory and time getting it all into mem first
This commit is contained in:
@@ -1424,15 +1424,14 @@ namespace OpenSim.Framework
|
||||
request.Content.Headers.TryAddWithoutValidation("Content-Length", sendlen.ToString());
|
||||
}
|
||||
|
||||
responseMessage = client.Send(request, HttpCompletionOption.ResponseHeadersRead);
|
||||
responseMessage = client.Send(request, HttpCompletionOption.ResponseContentRead);
|
||||
responseMessage.EnsureSuccessStatusCode();
|
||||
|
||||
int rcvlen = 0;
|
||||
if ((responseMessage.Content.Headers.ContentLength is long contentLength) && contentLength != 0)
|
||||
{
|
||||
rcvlen = (int)contentLength;
|
||||
using CancellationTokenSource cts = new(30000);
|
||||
using Stream respStream = responseMessage.Content.ReadAsStream(cts.Token);
|
||||
using Stream respStream = responseMessage.Content.ReadAsStream();
|
||||
deserial = XMLResponseHelper.LogAndDeserialize<TResponse>(
|
||||
reqnum, respStream, contentLength);
|
||||
}
|
||||
@@ -1519,15 +1518,14 @@ namespace OpenSim.Framework
|
||||
//else
|
||||
// request.Headers.TryAddWithoutValidation("Connection", "close");
|
||||
|
||||
responseMessage = client.Send(request, HttpCompletionOption.ResponseHeadersRead);
|
||||
responseMessage = client.Send(request, HttpCompletionOption.ResponseContentRead);
|
||||
responseMessage.EnsureSuccessStatusCode();
|
||||
|
||||
int rcvlen = 0;
|
||||
if ((responseMessage.Content.Headers.ContentLength is long contentLength) && contentLength != 0)
|
||||
{
|
||||
rcvlen = (int)contentLength;
|
||||
using CancellationTokenSource cts = new(30000);
|
||||
using Stream respStream = responseMessage.Content.ReadAsStream(cts.Token);
|
||||
using Stream respStream = responseMessage.Content.ReadAsStream();
|
||||
deserial = XMLResponseHelper.LogAndDeserialize<TResponse>(
|
||||
reqnum, respStream, contentLength);
|
||||
}
|
||||
|
||||
@@ -364,10 +364,10 @@
|
||||
;; you can also bypass the hostname or domain verification
|
||||
;# {NoVerifyCertHostname} {} {do not verify SSL Cert name versus peer name} {true false} true
|
||||
; NoVerifyCertHostname = true
|
||||
;; having both options true does provide encryption but with low security
|
||||
;; having both options true does provide encryption but with lower security
|
||||
;; set both true if you don't care to use SSL, they are needed to contact regions or grids that do use it.
|
||||
|
||||
;; list of stun servers, for now to tell viewers for webrtc support
|
||||
;; comma separated list of stun servers (in host:port format), for webrtc support, possible other uses in future
|
||||
StunServers = stun.l.google.com:19302, stun.cloudflare.com:3478
|
||||
|
||||
[AccessControl]
|
||||
|
||||
Reference in New Issue
Block a user