There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-fe04cfe7-9810-41c5-94cd-9c7e9a1742ee XWIKI-23204 Open

Large attachment upload impacts XWiki responsiveness

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-eded556b-3fa5-4885-9f90-8d3e75d51107 Marius Dumitru Florea on 02/Mar/26 10:07
 

The synchronized seems to have been there since before 2008, it is not clear why it is needed.

I don't remember why I added it, but it doesn't make sense indeed.

Couldn't the code be optimized to construct the mutable servlet request only when there is actually a parameter that requires conversion?

What would we gain by this? I assume the servlet container would still have to parse all the request parameters before we can check if some parameters require conversion.

Or could we maybe apply the whole filter only to certain requests?

Yes, that filter javadoc seems to suggest it does not really make much sense in GET requests use case.

We could restrict the filter to POST requests. The content that requires conversion is most of the time large enough that it cannot fit in the URL query string. But I'm not sure if we can do it from web.xml. I don't see anything in https://docs.oracle.com/cd/E24329_01/web.1211/e21049/web_xml.htm#WBAPP517 to map the filter only to POST requests. So we might have to do it from within the filter itself. But then, I'm wondering if there is a significant benefit, since the filter is mostly checking the request parameters, which should be fast for a GET request.