31 using System.Reflection;
34 namespace OpenSim.Services.Connectors
38 private static readonly ILog m_log =
40 MethodBase.GetCurrentMethod().DeclaringType);
42 private string m_ServerURI = String.Empty;
54 if (!serverURI.EndsWith(
"="))
57 uri =
new Uri(serverURI);
58 m_ServerURI = serverURI.TrimEnd(
'/') +
"/helo/";
65 uri =
new Uri(serverURI +
"xxx");
66 if (uri.Query ==
string.Empty)
67 m_ServerURI = serverURI.TrimEnd(
'/') +
"/helo/";
70 serverURI = serverURI +
"xxx";
71 m_ServerURI = serverURI.Replace(uri.Query,
"");
72 m_ServerURI = m_ServerURI.TrimEnd(
'/') +
"/helo/";
77 catch (UriFormatException)
79 m_log.WarnFormat(
"[HELO SERVICE]: Malformed URL {0}", serverURI);
83 public virtual string Helo()
85 if (String.IsNullOrEmpty(m_ServerURI))
87 m_log.WarnFormat(
"[HELO SERVICE]: Unable to invoke HELO due to empty URL");
93 HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI);
97 using (WebResponse response = req.GetResponse())
99 if (response.Headers.Get(
"X-Handlers-Provided") == null)
101 return response.Headers.Get(
"X-Handlers-Provided");
106 m_log.DebugFormat(
"[HELO SERVICE]: Unable to perform HELO request to {0}: {1}", m_ServerURI, e.Message);
HeloServicesConnector(string serverURI)