1
0

XMLRPCModule.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSimulator Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System;
  28. using System.Collections;
  29. using System.Collections.Generic;
  30. using System.Net;
  31. using System.Reflection;
  32. using System.Threading;
  33. using log4net;
  34. using Nini.Config;
  35. using Nwc.XmlRpc;
  36. using OpenMetaverse;
  37. using OpenSim.Framework;
  38. using OpenSim.Framework.Servers;
  39. using OpenSim.Framework.Servers.HttpServer;
  40. using OpenSim.Region.Framework.Interfaces;
  41. using OpenSim.Region.Framework.Scenes;
  42. using Mono.Addins;
  43. /*****************************************************
  44. *
  45. * XMLRPCModule
  46. *
  47. * Module for accepting incoming communications from
  48. * external XMLRPC client and calling a remote data
  49. * procedure for a registered data channel/prim.
  50. *
  51. *
  52. * 1. On module load, open a listener port
  53. * 2. Attach an XMLRPC handler
  54. * 3. When a request is received:
  55. * 3.1 Parse into components: channel key, int, string
  56. * 3.2 Look up registered channel listeners
  57. * 3.3 Call the channel (prim) remote data method
  58. * 3.4 Capture the response (llRemoteDataReply)
  59. * 3.5 Return response to client caller
  60. * 3.6 If no response from llRemoteDataReply within
  61. * RemoteReplyScriptTimeout, generate script timeout fault
  62. *
  63. * Prims in script must:
  64. * 1. Open a remote data channel
  65. * 1.1 Generate a channel ID
  66. * 1.2 Register primid,channelid pair with module
  67. * 2. Implement the remote data procedure handler
  68. *
  69. * llOpenRemoteDataChannel
  70. * llRemoteDataReply
  71. * remote_data(integer type, key channel, key messageid, string sender, integer ival, string sval)
  72. * llCloseRemoteDataChannel
  73. *
  74. * **************************************************/
  75. namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
  76. {
  77. [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "XMLRPCModule")]
  78. public class XMLRPCModule : ISharedRegionModule, IXMLRPC
  79. {
  80. private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
  81. private string m_name = "XMLRPCModule";
  82. // <channel id, RPCChannelInfo>
  83. private Dictionary<UUID, RPCChannelInfo> m_openChannels;
  84. private Dictionary<UUID, SendRemoteDataRequest> m_pendingSRDResponses;
  85. private int m_remoteDataPort = 0;
  86. public int Port
  87. {
  88. get { return m_remoteDataPort; }
  89. }
  90. private Dictionary<UUID, RPCRequestInfo> m_rpcPending;
  91. private Dictionary<UUID, RPCRequestInfo> m_rpcPendingResponses;
  92. private List<Scene> m_scenes = new List<Scene>();
  93. private int RemoteReplyScriptTimeout = 9000;
  94. private int RemoteReplyScriptWait = 300;
  95. private object XMLRPCListLock = new object();
  96. #region ISharedRegionModule Members
  97. public void Initialise(IConfigSource config)
  98. {
  99. // We need to create these early because the scripts might be calling
  100. // But since this gets called for every region, we need to make sure they
  101. // get called only one time (or we lose any open channels)
  102. m_openChannels = new Dictionary<UUID, RPCChannelInfo>();
  103. m_rpcPending = new Dictionary<UUID, RPCRequestInfo>();
  104. m_rpcPendingResponses = new Dictionary<UUID, RPCRequestInfo>();
  105. m_pendingSRDResponses = new Dictionary<UUID, SendRemoteDataRequest>();
  106. if (config.Configs["XMLRPC"] != null)
  107. {
  108. try
  109. {
  110. m_remoteDataPort = config.Configs["XMLRPC"].GetInt("XmlRpcPort", m_remoteDataPort);
  111. }
  112. catch (Exception)
  113. {
  114. }
  115. }
  116. }
  117. public void PostInitialise()
  118. {
  119. if (IsEnabled())
  120. {
  121. // Start http server
  122. // Attach xmlrpc handlers
  123. // m_log.InfoFormat(
  124. // "[XML RPC MODULE]: Starting up XMLRPC Server on port {0} for llRemoteData commands.",
  125. // m_remoteDataPort);
  126. IHttpServer httpServer = MainServer.GetHttpServer((uint)m_remoteDataPort);
  127. httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData);
  128. }
  129. }
  130. public void AddRegion(Scene scene)
  131. {
  132. if (!IsEnabled())
  133. return;
  134. if (!m_scenes.Contains(scene))
  135. {
  136. m_scenes.Add(scene);
  137. scene.RegisterModuleInterface<IXMLRPC>(this);
  138. }
  139. }
  140. public void RegionLoaded(Scene scene)
  141. {
  142. }
  143. public void RemoveRegion(Scene scene)
  144. {
  145. if (!IsEnabled())
  146. return;
  147. if (m_scenes.Contains(scene))
  148. {
  149. scene.UnregisterModuleInterface<IXMLRPC>(this);
  150. m_scenes.Remove(scene);
  151. }
  152. }
  153. public void Close()
  154. {
  155. }
  156. public string Name
  157. {
  158. get { return m_name; }
  159. }
  160. public Type ReplaceableInterface
  161. {
  162. get { return null; }
  163. }
  164. #endregion
  165. #region IXMLRPC Members
  166. public bool IsEnabled()
  167. {
  168. return (m_remoteDataPort > 0);
  169. }
  170. /**********************************************
  171. * OpenXMLRPCChannel
  172. *
  173. * Generate a UUID channel key and add it and
  174. * the prim id to dictionary <channelUUID, primUUID>
  175. *
  176. * A custom channel key can be proposed.
  177. * Otherwise, passing UUID.Zero will generate
  178. * and return a random channel
  179. *
  180. * First check if there is a channel assigned for
  181. * this itemID. If there is, then someone called
  182. * llOpenRemoteDataChannel twice. Just return the
  183. * original channel. Other option is to delete the
  184. * current channel and assign a new one.
  185. *
  186. * ********************************************/
  187. public UUID OpenXMLRPCChannel(uint localID, UUID itemID, UUID channelID)
  188. {
  189. UUID newChannel = UUID.Zero;
  190. // This should no longer happen, but the check is reasonable anyway
  191. if (null == m_openChannels)
  192. {
  193. m_log.Warn("[XML RPC MODULE]: Attempt to open channel before initialization is complete");
  194. return newChannel;
  195. }
  196. //Is a dupe?
  197. foreach (RPCChannelInfo ci in m_openChannels.Values)
  198. {
  199. if (ci.GetItemID().Equals(itemID))
  200. {
  201. // return the original channel ID for this item
  202. newChannel = ci.GetChannelID();
  203. break;
  204. }
  205. }
  206. if (newChannel == UUID.Zero)
  207. {
  208. newChannel = (channelID == UUID.Zero) ? UUID.Random() : channelID;
  209. RPCChannelInfo rpcChanInfo = new RPCChannelInfo(localID, itemID, newChannel);
  210. lock (XMLRPCListLock)
  211. {
  212. m_openChannels.Add(newChannel, rpcChanInfo);
  213. }
  214. }
  215. return newChannel;
  216. }
  217. // Delete channels based on itemID
  218. // for when a script is deleted
  219. public void DeleteChannels(UUID itemID)
  220. {
  221. if (m_openChannels != null)
  222. {
  223. ArrayList tmp = new ArrayList();
  224. lock (XMLRPCListLock)
  225. {
  226. foreach (RPCChannelInfo li in m_openChannels.Values)
  227. {
  228. if (li.GetItemID().Equals(itemID))
  229. {
  230. tmp.Add(itemID);
  231. }
  232. }
  233. IEnumerator tmpEnumerator = tmp.GetEnumerator();
  234. while (tmpEnumerator.MoveNext())
  235. m_openChannels.Remove((UUID) tmpEnumerator.Current);
  236. }
  237. }
  238. }
  239. /**********************************************
  240. * Remote Data Reply
  241. *
  242. * Response to RPC message
  243. *
  244. *********************************************/
  245. public void RemoteDataReply(string channel, string message_id, string sdata, int idata)
  246. {
  247. UUID message_key = new UUID(message_id);
  248. UUID channel_key = new UUID(channel);
  249. RPCRequestInfo rpcInfo = null;
  250. if (message_key == UUID.Zero)
  251. {
  252. foreach (RPCRequestInfo oneRpcInfo in m_rpcPendingResponses.Values)
  253. if (oneRpcInfo.GetChannelKey() == channel_key)
  254. rpcInfo = oneRpcInfo;
  255. }
  256. else
  257. {
  258. m_rpcPendingResponses.TryGetValue(message_key, out rpcInfo);
  259. }
  260. if (rpcInfo != null)
  261. {
  262. rpcInfo.SetStrRetval(sdata);
  263. rpcInfo.SetIntRetval(idata);
  264. rpcInfo.SetProcessed(true);
  265. m_rpcPendingResponses.Remove(message_key);
  266. }
  267. else
  268. {
  269. m_log.Warn("[XML RPC MODULE]: Channel or message_id not found");
  270. }
  271. }
  272. /**********************************************
  273. * CloseXMLRPCChannel
  274. *
  275. * Remove channel from dictionary
  276. *
  277. *********************************************/
  278. public void CloseXMLRPCChannel(UUID channelKey)
  279. {
  280. if (m_openChannels.ContainsKey(channelKey))
  281. m_openChannels.Remove(channelKey);
  282. }
  283. public bool hasRequests()
  284. {
  285. lock (XMLRPCListLock)
  286. {
  287. if (m_rpcPending != null)
  288. return (m_rpcPending.Count > 0);
  289. else
  290. return false;
  291. }
  292. }
  293. public IXmlRpcRequestInfo GetNextCompletedRequest()
  294. {
  295. if (m_rpcPending != null)
  296. {
  297. lock (XMLRPCListLock)
  298. {
  299. foreach (UUID luid in m_rpcPending.Keys)
  300. {
  301. RPCRequestInfo tmpReq;
  302. if (m_rpcPending.TryGetValue(luid, out tmpReq))
  303. {
  304. if (!tmpReq.IsProcessed()) return tmpReq;
  305. }
  306. }
  307. }
  308. }
  309. return null;
  310. }
  311. public void RemoveCompletedRequest(UUID id)
  312. {
  313. lock (XMLRPCListLock)
  314. {
  315. RPCRequestInfo tmp;
  316. if (m_rpcPending.TryGetValue(id, out tmp))
  317. {
  318. m_rpcPending.Remove(id);
  319. m_rpcPendingResponses.Add(id, tmp);
  320. }
  321. else
  322. {
  323. m_log.Error("[XML RPC MODULE]: UNABLE TO REMOVE COMPLETED REQUEST");
  324. }
  325. }
  326. }
  327. public UUID SendRemoteData(uint localID, UUID itemID, string channel, string dest, int idata, string sdata)
  328. {
  329. SendRemoteDataRequest req = new SendRemoteDataRequest(
  330. localID, itemID, channel, dest, idata, sdata
  331. );
  332. m_pendingSRDResponses.Add(req.GetReqID(), req);
  333. req.Process();
  334. return req.ReqID;
  335. }
  336. public IServiceRequest GetNextCompletedSRDRequest()
  337. {
  338. if (m_pendingSRDResponses != null)
  339. {
  340. lock (XMLRPCListLock)
  341. {
  342. foreach (UUID luid in m_pendingSRDResponses.Keys)
  343. {
  344. SendRemoteDataRequest tmpReq;
  345. if (m_pendingSRDResponses.TryGetValue(luid, out tmpReq))
  346. {
  347. if (tmpReq.Finished)
  348. return tmpReq;
  349. }
  350. }
  351. }
  352. }
  353. return null;
  354. }
  355. public void RemoveCompletedSRDRequest(UUID id)
  356. {
  357. lock (XMLRPCListLock)
  358. {
  359. SendRemoteDataRequest tmpReq;
  360. if (m_pendingSRDResponses.TryGetValue(id, out tmpReq))
  361. {
  362. m_pendingSRDResponses.Remove(id);
  363. }
  364. }
  365. }
  366. public void CancelSRDRequests(UUID itemID)
  367. {
  368. if (m_pendingSRDResponses != null)
  369. {
  370. lock (XMLRPCListLock)
  371. {
  372. foreach (SendRemoteDataRequest li in m_pendingSRDResponses.Values)
  373. {
  374. if (li.ItemID.Equals(itemID))
  375. m_pendingSRDResponses.Remove(li.GetReqID());
  376. }
  377. }
  378. }
  379. }
  380. #endregion
  381. public XmlRpcResponse XmlRpcRemoteData(XmlRpcRequest request, IPEndPoint remoteClient)
  382. {
  383. XmlRpcResponse response = new XmlRpcResponse();
  384. Hashtable requestData = (Hashtable) request.Params[0];
  385. bool GoodXML = (requestData.Contains("Channel") && requestData.Contains("IntValue") &&
  386. requestData.Contains("StringValue"));
  387. if (GoodXML)
  388. {
  389. UUID channel = new UUID((string) requestData["Channel"]);
  390. RPCChannelInfo rpcChanInfo;
  391. if (m_openChannels.TryGetValue(channel, out rpcChanInfo))
  392. {
  393. string intVal = Convert.ToInt32(requestData["IntValue"]).ToString();
  394. string strVal = (string) requestData["StringValue"];
  395. RPCRequestInfo rpcInfo;
  396. lock (XMLRPCListLock)
  397. {
  398. rpcInfo =
  399. new RPCRequestInfo(rpcChanInfo.GetLocalID(), rpcChanInfo.GetItemID(), channel, strVal,
  400. intVal);
  401. m_rpcPending.Add(rpcInfo.GetMessageID(), rpcInfo);
  402. }
  403. int timeoutCtr = 0;
  404. while (!rpcInfo.IsProcessed() && (timeoutCtr < RemoteReplyScriptTimeout))
  405. {
  406. Thread.Sleep(RemoteReplyScriptWait);
  407. timeoutCtr += RemoteReplyScriptWait;
  408. }
  409. if (rpcInfo.IsProcessed())
  410. {
  411. Hashtable param = new Hashtable();
  412. param["StringValue"] = rpcInfo.GetStrRetval();
  413. param["IntValue"] = rpcInfo.GetIntRetval();
  414. ArrayList parameters = new ArrayList();
  415. parameters.Add(param);
  416. response.Value = parameters;
  417. rpcInfo = null;
  418. }
  419. else
  420. {
  421. response.SetFault(-1, "Script timeout");
  422. rpcInfo = null;
  423. }
  424. }
  425. else
  426. {
  427. response.SetFault(-1, "Invalid channel");
  428. }
  429. }
  430. return response;
  431. }
  432. }
  433. public class RPCRequestInfo: IXmlRpcRequestInfo
  434. {
  435. private UUID m_ChannelKey;
  436. private string m_IntVal;
  437. private UUID m_ItemID;
  438. private uint m_localID;
  439. private UUID m_MessageID;
  440. private bool m_processed;
  441. private int m_respInt;
  442. private string m_respStr;
  443. private string m_StrVal;
  444. public RPCRequestInfo(uint localID, UUID itemID, UUID channelKey, string strVal, string intVal)
  445. {
  446. m_localID = localID;
  447. m_StrVal = strVal;
  448. m_IntVal = intVal;
  449. m_ItemID = itemID;
  450. m_ChannelKey = channelKey;
  451. m_MessageID = UUID.Random();
  452. m_processed = false;
  453. m_respStr = String.Empty;
  454. m_respInt = 0;
  455. }
  456. public bool IsProcessed()
  457. {
  458. return m_processed;
  459. }
  460. public UUID GetChannelKey()
  461. {
  462. return m_ChannelKey;
  463. }
  464. public void SetProcessed(bool processed)
  465. {
  466. m_processed = processed;
  467. }
  468. public void SetStrRetval(string resp)
  469. {
  470. m_respStr = resp;
  471. }
  472. public string GetStrRetval()
  473. {
  474. return m_respStr;
  475. }
  476. public void SetIntRetval(int resp)
  477. {
  478. m_respInt = resp;
  479. }
  480. public int GetIntRetval()
  481. {
  482. return m_respInt;
  483. }
  484. public uint GetLocalID()
  485. {
  486. return m_localID;
  487. }
  488. public UUID GetItemID()
  489. {
  490. return m_ItemID;
  491. }
  492. public string GetStrVal()
  493. {
  494. return m_StrVal;
  495. }
  496. public int GetIntValue()
  497. {
  498. return int.Parse(m_IntVal);
  499. }
  500. public UUID GetMessageID()
  501. {
  502. return m_MessageID;
  503. }
  504. }
  505. public class RPCChannelInfo
  506. {
  507. private UUID m_ChannelKey;
  508. private UUID m_itemID;
  509. private uint m_localID;
  510. public RPCChannelInfo(uint localID, UUID itemID, UUID channelID)
  511. {
  512. m_ChannelKey = channelID;
  513. m_localID = localID;
  514. m_itemID = itemID;
  515. }
  516. public UUID GetItemID()
  517. {
  518. return m_itemID;
  519. }
  520. public UUID GetChannelID()
  521. {
  522. return m_ChannelKey;
  523. }
  524. public uint GetLocalID()
  525. {
  526. return m_localID;
  527. }
  528. }
  529. public class SendRemoteDataRequest: IServiceRequest
  530. {
  531. private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
  532. public string Channel;
  533. public string DestURL;
  534. private bool _finished;
  535. public bool Finished
  536. {
  537. get { return _finished; }
  538. set { _finished = value; }
  539. }
  540. private Thread httpThread;
  541. public int Idata;
  542. private UUID _itemID;
  543. public UUID ItemID
  544. {
  545. get { return _itemID; }
  546. set { _itemID = value; }
  547. }
  548. private uint _localID;
  549. public uint LocalID
  550. {
  551. get { return _localID; }
  552. set { _localID = value; }
  553. }
  554. private UUID _reqID;
  555. public UUID ReqID
  556. {
  557. get { return _reqID; }
  558. set { _reqID = value; }
  559. }
  560. public XmlRpcRequest Request;
  561. public int ResponseIdata;
  562. public string ResponseSdata;
  563. public string Sdata;
  564. public SendRemoteDataRequest(uint localID, UUID itemID, string channel, string dest, int idata, string sdata)
  565. {
  566. this.Channel = channel;
  567. DestURL = dest;
  568. this.Idata = idata;
  569. this.Sdata = sdata;
  570. ItemID = itemID;
  571. LocalID = localID;
  572. ReqID = UUID.Random();
  573. }
  574. public void Process()
  575. {
  576. httpThread = new Thread(SendRequest);
  577. httpThread.Name = "HttpRequestThread";
  578. httpThread.Priority = ThreadPriority.BelowNormal;
  579. httpThread.IsBackground = true;
  580. _finished = false;
  581. httpThread.Start();
  582. }
  583. /*
  584. * TODO: More work on the response codes. Right now
  585. * returning 200 for success or 499 for exception
  586. */
  587. public void SendRequest()
  588. {
  589. Hashtable param = new Hashtable();
  590. // Check if channel is an UUID
  591. // if not, use as method name
  592. UUID parseUID;
  593. string mName = "llRemoteData";
  594. if (!string.IsNullOrEmpty(Channel))
  595. if (!UUID.TryParse(Channel, out parseUID))
  596. mName = Channel;
  597. else
  598. param["Channel"] = Channel;
  599. param["StringValue"] = Sdata;
  600. param["IntValue"] = Convert.ToString(Idata);
  601. ArrayList parameters = new ArrayList();
  602. parameters.Add(param);
  603. XmlRpcRequest req = new XmlRpcRequest(mName, parameters);
  604. try
  605. {
  606. XmlRpcResponse resp = req.Send(DestURL, 30000);
  607. if (resp != null)
  608. {
  609. Hashtable respParms;
  610. if (resp.Value.GetType().Equals(typeof(Hashtable)))
  611. {
  612. respParms = (Hashtable) resp.Value;
  613. }
  614. else
  615. {
  616. ArrayList respData = (ArrayList) resp.Value;
  617. respParms = (Hashtable) respData[0];
  618. }
  619. if (respParms != null)
  620. {
  621. if (respParms.Contains("StringValue"))
  622. {
  623. Sdata = (string) respParms["StringValue"];
  624. }
  625. if (respParms.Contains("IntValue"))
  626. {
  627. Idata = Convert.ToInt32(respParms["IntValue"]);
  628. }
  629. if (respParms.Contains("faultString"))
  630. {
  631. Sdata = (string) respParms["faultString"];
  632. }
  633. if (respParms.Contains("faultCode"))
  634. {
  635. Idata = Convert.ToInt32(respParms["faultCode"]);
  636. }
  637. }
  638. }
  639. }
  640. catch (Exception we)
  641. {
  642. Sdata = we.Message;
  643. m_log.Warn("[SendRemoteDataRequest]: Request failed");
  644. m_log.Warn(we.StackTrace);
  645. }
  646. _finished = true;
  647. }
  648. public void Stop()
  649. {
  650. try
  651. {
  652. httpThread.Abort();
  653. }
  654. catch (Exception)
  655. {
  656. }
  657. }
  658. public UUID GetReqID()
  659. {
  660. return ReqID;
  661. }
  662. }
  663. }