diff options
author | Justin Clark-Casey (justincc) | 2011-12-01 23:38:25 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-12-01 23:38:25 +0000 |
commit | 1854c52ea3c60d0a47f9793a7f5ec405e15489ca (patch) | |
tree | 438ca142052d1aec019f56908e13128b873eccc8 | |
parent | refactor: Separate the upload baked texture handler out from BunchOfCaps (diff) | |
download | opensim-SC_OLD-1854c52ea3c60d0a47f9793a7f5ec405e15489ca.zip opensim-SC_OLD-1854c52ea3c60d0a47f9793a7f5ec405e15489ca.tar.gz opensim-SC_OLD-1854c52ea3c60d0a47f9793a7f5ec405e15489ca.tar.bz2 opensim-SC_OLD-1854c52ea3c60d0a47f9793a7f5ec405e15489ca.tar.xz |
Stop performing the asset save part of baked texture uploading on the UploadBakedTexture cap asynchronously.
This prevents a possible race condition where the client would be told all baked textures had updated before they were in the asset service.
The client would then trigger a set appearance which, after a delay, would send the avatar appearance out to other clients.
The race condition seems unlikely because of this delay but it's still possible.
Might help with grey avatar appearances.
-rw-r--r-- | OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs index 97b558c..b89fd6a 100644 --- a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs +++ b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs | |||
@@ -106,7 +106,7 @@ namespace OpenSim.Capabilities.Handlers | |||
106 | } | 106 | } |
107 | catch (Exception e) | 107 | catch (Exception e) |
108 | { | 108 | { |
109 | m_log.Error("[CAPS]: " + e.ToString()); | 109 | m_log.Error("[UPLOAD BAKED TEXTURE HANDLER]: " + e.ToString()); |
110 | } | 110 | } |
111 | 111 | ||
112 | return null; | 112 | return null; |
@@ -132,6 +132,8 @@ namespace OpenSim.Capabilities.Handlers | |||
132 | 132 | ||
133 | class BakedTextureUploader | 133 | class BakedTextureUploader |
134 | { | 134 | { |
135 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
136 | |||
135 | public event Action<UUID, byte[]> OnUpLoad; | 137 | public event Action<UUID, byte[]> OnUpLoad; |
136 | 138 | ||
137 | private string uploaderPath = String.Empty; | 139 | private string uploaderPath = String.Empty; |
@@ -156,10 +158,12 @@ namespace OpenSim.Capabilities.Handlers | |||
156 | public string uploaderCaps(byte[] data, string path, string param) | 158 | public string uploaderCaps(byte[] data, string path, string param) |
157 | { | 159 | { |
158 | Action<UUID, byte[]> handlerUpLoad = OnUpLoad; | 160 | Action<UUID, byte[]> handlerUpLoad = OnUpLoad; |
161 | |||
162 | // Don't do this asynchronously, otherwise it's possible for the client to send set appearance information | ||
163 | // on another thread which might send out avatar updates before the asset has been put into the asset | ||
164 | // service. | ||
159 | if (handlerUpLoad != null) | 165 | if (handlerUpLoad != null) |
160 | { | 166 | handlerUpLoad(newAssetID, data); |
161 | Util.FireAndForget(delegate(object o) { handlerUpLoad(newAssetID, data); }); | ||
162 | } | ||
163 | 167 | ||
164 | string res = String.Empty; | 168 | string res = String.Empty; |
165 | LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete(); | 169 | LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete(); |
@@ -171,7 +175,7 @@ namespace OpenSim.Capabilities.Handlers | |||
171 | 175 | ||
172 | httpListener.RemoveStreamHandler("POST", uploaderPath); | 176 | httpListener.RemoveStreamHandler("POST", uploaderPath); |
173 | 177 | ||
174 | // m_log.InfoFormat("[CAPS] baked texture upload completed for {0}",newAssetID); | 178 | // m_log.DebugFormat("[BAKED TEXTURE UPLOADER]: baked texture upload completed for {0}", newAssetID); |
175 | 179 | ||
176 | return res; | 180 | return res; |
177 | } | 181 | } |