diff options
author | Justin Clark-Casey (justincc) | 2012-06-19 01:53:50 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-06-19 01:53:50 +0100 |
commit | 8e7032ece87d3e0e75f091ea84d482151e90795e (patch) | |
tree | c795302648f04b883558756327035e5dc35f9c97 /OpenSim/Region/ScriptEngine/XEngine | |
parent | Change read config paramter from max_urls_per_simulator to max_external_urls_... (diff) | |
download | opensim-SC_OLD-8e7032ece87d3e0e75f091ea84d482151e90795e.zip opensim-SC_OLD-8e7032ece87d3e0e75f091ea84d482151e90795e.tar.gz opensim-SC_OLD-8e7032ece87d3e0e75f091ea84d482151e90795e.tar.bz2 opensim-SC_OLD-8e7032ece87d3e0e75f091ea84d482151e90795e.tar.xz |
minor: Add a little more detail to IOException logging in XEngine.SetXMLState()
Also removes superflous Close() commands for statements taking place within using() constructs
Also adds some comment out debug log messages for future use.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index a9b6e67..35c338d 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -1743,6 +1743,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1743 | 1743 | ||
1744 | public bool SetXMLState(UUID itemID, string xml) | 1744 | public bool SetXMLState(UUID itemID, string xml) |
1745 | { | 1745 | { |
1746 | // m_log.DebugFormat("[XEngine]: Writing state for script item with ID {0}", itemID); | ||
1747 | |||
1746 | if (xml == String.Empty) | 1748 | if (xml == String.Empty) |
1747 | return false; | 1749 | return false; |
1748 | 1750 | ||
@@ -1803,14 +1805,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1803 | { | 1805 | { |
1804 | using (FileStream fs = File.Create(path)) | 1806 | using (FileStream fs = File.Create(path)) |
1805 | { | 1807 | { |
1808 | // m_log.DebugFormat("[XEngine]: Writing assembly file {0}", path); | ||
1809 | |||
1806 | fs.Write(filedata, 0, filedata.Length); | 1810 | fs.Write(filedata, 0, filedata.Length); |
1807 | fs.Close(); | ||
1808 | } | 1811 | } |
1809 | } | 1812 | } |
1810 | catch (IOException ex) | 1813 | catch (IOException ex) |
1811 | { | 1814 | { |
1812 | // if there already exists a file at that location, it may be locked. | 1815 | // if there already exists a file at that location, it may be locked. |
1813 | m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", path, ex.Message); | 1816 | m_log.ErrorFormat("[XEngine]: Error whilst writing assembly file {0}, {1}", path, ex.Message); |
1814 | } | 1817 | } |
1815 | 1818 | ||
1816 | string textpath = path + ".text"; | 1819 | string textpath = path + ".text"; |
@@ -1820,16 +1823,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1820 | { | 1823 | { |
1821 | using (StreamWriter sw = new StreamWriter(fs)) | 1824 | using (StreamWriter sw = new StreamWriter(fs)) |
1822 | { | 1825 | { |
1826 | // m_log.DebugFormat("[XEngine]: Writing .text file {0}", textpath); | ||
1827 | |||
1823 | sw.Write(base64); | 1828 | sw.Write(base64); |
1824 | sw.Close(); | ||
1825 | } | 1829 | } |
1826 | fs.Close(); | ||
1827 | } | 1830 | } |
1828 | } | 1831 | } |
1829 | catch (IOException ex) | 1832 | catch (IOException ex) |
1830 | { | 1833 | { |
1831 | // if there already exists a file at that location, it may be locked. | 1834 | // if there already exists a file at that location, it may be locked. |
1832 | m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", textpath, ex.Message); | 1835 | m_log.ErrorFormat("[XEngine]: Error whilst writing .text file {0}, {1}", textpath, ex.Message); |
1833 | } | 1836 | } |
1834 | } | 1837 | } |
1835 | } | 1838 | } |
@@ -1843,16 +1846,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1843 | { | 1846 | { |
1844 | using (StreamWriter ssw = new StreamWriter(sfs)) | 1847 | using (StreamWriter ssw = new StreamWriter(sfs)) |
1845 | { | 1848 | { |
1849 | // m_log.DebugFormat("[XEngine]: Writing state file {0}", statepath); | ||
1850 | |||
1846 | ssw.Write(stateE.OuterXml); | 1851 | ssw.Write(stateE.OuterXml); |
1847 | ssw.Close(); | ||
1848 | } | 1852 | } |
1849 | sfs.Close(); | ||
1850 | } | 1853 | } |
1851 | } | 1854 | } |
1852 | catch (IOException ex) | 1855 | catch (IOException ex) |
1853 | { | 1856 | { |
1854 | // if there already exists a file at that location, it may be locked. | 1857 | // if there already exists a file at that location, it may be locked. |
1855 | m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", statepath, ex.Message); | 1858 | m_log.ErrorFormat("[XEngine]: Error whilst writing state file {0}, {1}", statepath, ex.Message); |
1856 | } | 1859 | } |
1857 | 1860 | ||
1858 | XmlNodeList mapL = rootE.GetElementsByTagName("LineMap"); | 1861 | XmlNodeList mapL = rootE.GetElementsByTagName("LineMap"); |
@@ -1869,16 +1872,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1869 | { | 1872 | { |
1870 | using (StreamWriter msw = new StreamWriter(mfs)) | 1873 | using (StreamWriter msw = new StreamWriter(mfs)) |
1871 | { | 1874 | { |
1875 | // m_log.DebugFormat("[XEngine]: Writing linemap file {0}", mappath); | ||
1876 | |||
1872 | msw.Write(mapE.InnerText); | 1877 | msw.Write(mapE.InnerText); |
1873 | msw.Close(); | ||
1874 | } | 1878 | } |
1875 | mfs.Close(); | ||
1876 | } | 1879 | } |
1877 | } | 1880 | } |
1878 | catch (IOException ex) | 1881 | catch (IOException ex) |
1879 | { | 1882 | { |
1880 | // if there already exists a file at that location, it may be locked. | 1883 | // if there already exists a file at that location, it may be locked. |
1881 | m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", mappath, ex.Message); | 1884 | m_log.ErrorFormat("[XEngine]: Linemap file {0} already exists! {1}", mappath, ex.Message); |
1882 | } | 1885 | } |
1883 | } | 1886 | } |
1884 | 1887 | ||