diff options
author | Dr Scofield | 2009-01-30 14:45:39 +0000 |
---|---|---|
committer | Dr Scofield | 2009-01-30 14:45:39 +0000 |
commit | 1b0a398763b72a37d386c649f99a7a5596a30aa0 (patch) | |
tree | 8ccc1b3d10a6f85186dbce023d1d566dcc382076 /OpenSim/Region/Environment/Modules | |
parent | Update svn properties, minor formatting cleanup. (diff) | |
download | opensim-SC_OLD-1b0a398763b72a37d386c649f99a7a5596a30aa0.zip opensim-SC_OLD-1b0a398763b72a37d386c649f99a7a5596a30aa0.tar.gz opensim-SC_OLD-1b0a398763b72a37d386c649f99a7a5596a30aa0.tar.bz2 opensim-SC_OLD-1b0a398763b72a37d386c649f99a7a5596a30aa0.tar.xz |
reporting original request URI if HttpWebRequest failed, adding
try-catch around GetRequestStream (this time for sure)
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Avatar/Concierge/ConciergeModule.cs | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Concierge/ConciergeModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Concierge/ConciergeModule.cs index 1f07355..d02f6e3 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Concierge/ConciergeModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Concierge/ConciergeModule.cs | |||
@@ -402,12 +402,19 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Concierge | |||
402 | updatePost.ContentLength = payload.Length; | 402 | updatePost.ContentLength = payload.Length; |
403 | updatePost.UserAgent = "OpenSim.Concierge"; | 403 | updatePost.UserAgent = "OpenSim.Concierge"; |
404 | 404 | ||
405 | StreamWriter payloadStream = new StreamWriter(updatePost.GetRequestStream()); | 405 | try |
406 | payloadStream.Write(payload); | 406 | { |
407 | payloadStream.Close(); | 407 | StreamWriter payloadStream = new StreamWriter(updatePost.GetRequestStream()); |
408 | payloadStream.Write(payload); | ||
409 | payloadStream.Close(); | ||
408 | 410 | ||
409 | updatePost.BeginGetResponse(UpdateBrokerDone, updatePost); | 411 | updatePost.BeginGetResponse(UpdateBrokerDone, updatePost); |
410 | _log.DebugFormat("[Concierge] async broker update to {0} started", uri); | 412 | _log.DebugFormat("[Concierge] async broker POST to {0} started", uri); |
413 | } | ||
414 | catch (WebException we) | ||
415 | { | ||
416 | _log.ErrorFormat("[Concierge] async broker POST to {0} failed: {1}", uri, we.Status); | ||
417 | } | ||
411 | } | 418 | } |
412 | 419 | ||
413 | private void UpdateBrokerDone(IAsyncResult result) | 420 | private void UpdateBrokerDone(IAsyncResult result) |
@@ -423,20 +430,20 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Concierge | |||
423 | } | 430 | } |
424 | catch (WebException we) | 431 | catch (WebException we) |
425 | { | 432 | { |
426 | _log.ErrorFormat("[Concierge] broker update to {0} failed with status {1}", _brokerURI, we.Status); | 433 | string uri = updatePost.RequestUri.OriginalString; |
434 | _log.ErrorFormat("[Concierge] broker update to {0} failed with status {1}", uri, we.Status); | ||
427 | if (null != we.Response) | 435 | if (null != we.Response) |
428 | { | 436 | { |
429 | using(HttpWebResponse resp = we.Response as HttpWebResponse) | 437 | using(HttpWebResponse resp = we.Response as HttpWebResponse) |
430 | { | 438 | { |
431 | _log.ErrorFormat("[Concierge] response from {0} request Uri: {1}", _brokerURI, updatePost.RequestUri); | 439 | _log.ErrorFormat("[Concierge] response from {0} status code: {1}", uri, resp.StatusCode); |
432 | _log.ErrorFormat("[Concierge] response from {0} status code: {1}", _brokerURI, resp.StatusCode); | 440 | _log.ErrorFormat("[Concierge] response from {0} status desc: {1}", uri, resp.StatusDescription); |
433 | _log.ErrorFormat("[Concierge] response from {0} status desc: {1}", _brokerURI, resp.StatusDescription); | 441 | _log.ErrorFormat("[Concierge] response from {0} server: {1}", uri, resp.Server); |
434 | _log.ErrorFormat("[Concierge] response from {0} server: {1}", _brokerURI, resp.Server); | ||
435 | 442 | ||
436 | if (resp.ContentLength > 0) | 443 | if (resp.ContentLength > 0) |
437 | { | 444 | { |
438 | StreamReader content = new StreamReader(resp.GetResponseStream()); | 445 | StreamReader content = new StreamReader(resp.GetResponseStream()); |
439 | _log.ErrorFormat("[Concierge] response from {0} content: {1}", _brokerURI, content.ReadToEnd()); | 446 | _log.ErrorFormat("[Concierge] response from {0} content: {1}", uri, content.ReadToEnd()); |
440 | content.Close(); | 447 | content.Close(); |
441 | } | 448 | } |
442 | } | 449 | } |