Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] FormAuthenticator, synchronization

Looks like the synchronization got added 5 years ago.

https://github.com/eclipse/jetty.project/commit/3a129bb90f6e025d1905aeaa79a8972282105690

As part of some rework for Servlet 3.0.
A cursory look, it appears that various session attributes fcan be modified.
So these synchronization blocks appear to be only around __J_URI access/modification (which can happen if the client is sending multiple requests concurrently in the same session)






--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts


On Thu, Dec 5, 2013 at 12:49 PM, Oliver Wulff <owulff@xxxxxxxxxx> wrote:
Hi there

In the FormAuthenticator, you synchronize on the session variable which is local. What is the purpose of the synchronization?

                    synchronized(session)
                    {
                        nuri = (String) session.getAttribute(__J_URI);

                        if (nuri == null || nuri.length() == 0)
                        {
                            nuri = request.getContextPath();
                            if (nuri.length() == 0)
                                nuri = URIUtil.SLASH;
                        }
                    }

Thanks
Oli


_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-dev



Back to the top