Hopefully this fixes offline messages. The problem was: the server is not setting the ContentLength of the response. That comes up to OpenSim as ContentLength=-1, which made the existing test fail.

bulletsim
Diva Canto 2011-05-12 20:48:24 -07:00
parent 1cc70df3b4
commit e39dec6f37
1 changed files with 2 additions and 7 deletions

View File

@ -964,8 +964,6 @@ namespace OpenSim.Framework
{ {
requestStream = request.GetRequestStream(); requestStream = request.GetRequestStream();
requestStream.Write(buffer.ToArray(), 0, length); requestStream.Write(buffer.ToArray(), 0, length);
m_log.DebugFormat("[XXX] Wrote to stream ok");
} }
catch (Exception e) catch (Exception e)
{ {
@ -979,13 +977,11 @@ namespace OpenSim.Framework
} }
} }
m_log.DebugFormat("[XXX] Getting response now... {0}", requestUrl);
try try
{ {
using (WebResponse resp = request.GetResponse()) using (WebResponse resp = request.GetResponse())
{ {
if (resp.ContentLength > 0) if (resp.ContentLength != 0)
{ {
Stream respStream = resp.GetResponseStream(); Stream respStream = resp.GetResponseStream();
XmlSerializer deserializer = new XmlSerializer(typeof(TResponse)); XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
@ -993,7 +989,7 @@ namespace OpenSim.Framework
respStream.Close(); respStream.Close();
} }
else else
m_log.DebugFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}, ContentLength = {2}", requestUrl, verb, resp.ContentLength); m_log.WarnFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}", requestUrl, verb);
} }
} }
@ -1007,7 +1003,6 @@ namespace OpenSim.Framework
m_log.WarnFormat("[SynchronousRestObjectRequester]: Exception on response from {0} {1}", requestUrl, e); m_log.WarnFormat("[SynchronousRestObjectRequester]: Exception on response from {0} {1}", requestUrl, e);
} }
m_log.DebugFormat("[XXX] reply is null? {0}", (deserial == null) ? "yes": "no");
return deserial; return deserial;
} }
} }