<div dir="ltr">Then the solution is to generalize the code, not to overburden it.  If handling different URI forces dupe code then there was a very bad decision made very long ago.<div><div><br></div></div><div>I bet it is threaded crap.</div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 31, 2014 at 9:00 AM, Oren Hurvitz <span dir="ltr"><<a href="mailto:orenh@kitely.com" target="_blank">orenh@kitely.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>As this is an assets-service request, it belongs in the assets-service handlers. They already handle many different requests: data, metadata, data+metadata, store, update.<br>
<br>Creating a new handler would be easier for me at this moment, but perhaps not best for OpenSim in the longer term. First, because this request is related to the other asset requests, it makes sense to handle them together. Second, adding a new handler for every new feature isn't good because it creates a lot of duplicate code. Third, being able to determine a server's capabilities is useful.<br>

<br></div><div>There are many places in the codebase where new features were added using copy-paste-and-modify. This makes it harder to add new features, and especially hard to refactor major systems because so many places need to be changed in parallel. I would like to get away from that.<br>

</div><br>Oren<br><br><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 31, 2014 at 3:51 PM, Melanie-2 [via opensim-dev] <span dir="ltr"><<a href="http://user/SendEmail.jtp?type=node&node=7579102&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>></span> wrote:<br>

<blockquote style="border-left:2px solid #cccccc;padding:0 1em" class="gmail_quote">

        Hi Oren,
<br><br>the correct way is to create an additional post handler that is reachable at a different URL, e,g, /AssetQuery/
<br><br>Servers that don't implement it would return 404. Don't try to shoehorn this functionality into the existing post handler.
<br><br>Melanie
<br><div><div><br>On 31 Mar 2014, at 13:55, Oren Hurvitz <<a href="http://user/SendEmail.jtp?type=node&node=7579101&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>> wrote:
<br><br>I have implemented this method. I found that the Assets Service already had a
<br>method to check for assets' existence, so I just had to extend it to check
<br>multiple asset ID's at once, and make it available remotely. But now I'm not
<br>sure what to do about backwards compatibility.
<br><br>I'm sending the request using POST, because sending a lot of data is better
<br>done using POST than GET. But as it turns out, AssetServerPostHandler
<br>doesn't handle unknown requests well. First, it assumes that all requests
<br>will contain an AssetBase, but this request doesn't. Second, its try/catch
<br>clause doesn't catch the exception that is generated, because it's an
<br>InvalidOperationException and not an XmlException (which is what's currently
<br>caught). The unfortunate result is that the server doesn't send back *any*
<br>reply, which means that the caller must wait for the full timeout (100
<br>seconds!) before giving up. [BTW, I'm going to investigate this further
<br>because it may explain the 100-second timeouts users occasionally
<br>experience.]
<br><br>I've already fixed this problem in the current patch (not yet submitted), so
<br>that in the future AssetServerPostHandler will return an error code
<br>immediately for unknown requests (HTTP 400). But that won't help when
<br>connecting to old grids.
<br><br>I see two ways to fix this:
<br><br>1. Send the request using GET instead of POST. AssetServerGetHandler handles
<br>unknown requests a little better than POST: it tries to find the parameter
<br>as an Asset ID, but if not found then it just returns HTTP 404 immediately.
<br><br>2. Add a way to query the server for its capabilities, to find out if it
<br>supports this request.
<br><br>I prefer approach #2 because it can be used in the future for many other new
<br>features. How about adding a method to IGatekeeperService, something like
<br>this:
<br><br>Dictionary<string,string> GetServerCapabilities();
<br><br>In this example, the capability will be: "SupportsAssetsExist"="true"
<br><br><br><br><br></div></div>--
<br>View this message in context: <a href="http://opensim-dev.2196679.n2.nabble.com/Optimize-pushing-assets-to-other-grids-tp7579093p7579100.html" rel="nofollow" link="external" target="_blank">http://opensim-dev.2196679.n2.nabble.com/Optimize-pushing-assets-to-other-grids-tp7579093p7579100.html</a><div>

<br>Sent from the opensim-dev mailing list archive at Nabble.com.
<br>_______________________________________________
<br>Opensim-dev mailing list
<br><a href="http://user/SendEmail.jtp?type=node&node=7579101&i=1" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br><a href="https://lists.berlios.de/mailman/listinfo/opensim-dev" rel="nofollow" link="external" target="_blank">https://lists.berlios.de/mailman/listinfo/opensim-dev</a><br><br><br>_______________________________________________
<br>Opensim-dev mailing list
<br><a href="http://user/SendEmail.jtp?type=node&node=7579101&i=2" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br><a href="https://lists.berlios.de/mailman/listinfo/opensim-dev" rel="nofollow" link="external" target="_blank">https://lists.berlios.de/mailman/listinfo/opensim-dev</a><br>

        
        
        
        <br>
        <br>
        </div><hr color="#cccccc" noshade size="1">
        <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif"><div>
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                </div><a href="http://opensim-dev.2196679.n2.nabble.com/Optimize-pushing-assets-to-other-grids-tp7579093p7579101.html" rel="nofollow" link="external" target="_blank">http://opensim-dev.2196679.n2.nabble.com/Optimize-pushing-assets-to-other-grids-tp7579093p7579101.html</a>
        </div><div><div>
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from Optimize pushing assets to other grids, <a rel="nofollow" link="external">click here</a>.<br>

                <a href="http://opensim-dev.2196679.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" link="external" target="_blank">NAML</a><span class="HOEnZb"><font color="#888888">
        </font></span></div></div></div></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><div dir="ltr">Oren Hurvitz<br>VP R&D<br>Kitely Ltd.<br><br>Email: <a href="http://user/SendEmail.jtp?type=node&node=7579102&i=1" rel="nofollow" link="external" target="_blank">[hidden email]</a><a href="http://user/SendEmail.jtp?type=node&node=7579102&i=2" rel="nofollow" link="external" target="_blank">[hidden email]</a></div>


</font></span></div><span class="HOEnZb"><font color="#888888">


        
        
        
<br><hr align="left" width="300">
View this message in context: <a href="http://opensim-dev.2196679.n2.nabble.com/Optimize-pushing-assets-to-other-grids-tp7579093p7579102.html" target="_blank">Re: Optimize pushing assets to other grids</a><br>
Sent from the <a href="http://opensim-dev.2196679.n2.nabble.com/" target="_blank">opensim-dev mailing list archive</a> at Nabble.com.<br></font></span><br>_______________________________________________<br>
Opensim-dev mailing list<br>
<a href="mailto:Opensim-dev@lists.berlios.de">Opensim-dev@lists.berlios.de</a><br>
<a href="https://lists.berlios.de/mailman/listinfo/opensim-dev" target="_blank">https://lists.berlios.de/mailman/listinfo/opensim-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>No essence.  No permanence.  No perfection.  Only action.
</div>