Skip to Content.
Sympa Menu

shibboleth-dev - Re: shib origin installation

Subject: Shibboleth Developers

List archive

Re: shib origin installation


Chronological Thread 
  • From: Barbara Jensen <>
  • To:
  • Subject: Re: shib origin installation
  • Date: Sat, 27 Apr 2002 18:06:31 -0400

Walter,

Thanks for the threading fix.

Yes, I agree that the logic should be separate from the html
presentation in the Handle Servlet. I have no objections to you doing
this if you have the time; otherwise I will work on it.

barbara



> Barbara,
>
> I noticed a simple but nasty bug in the HS servlet that will cause any
> two queries being simultaneously processed to fail. Since servlets are
> multithreaded and there is only one instance of HandleServlet, all
> threads share access to its fields. As it stands now, each thread that
> calls doGet() will trash the other threads output stream. I have
> attached a small patch file that fixes this problem.
>
> I also noticed that some error conditions cause the HS to spit out
> malformed html. I would like to fix this, but I think it would be
> somewhat easier if the servlet were refactored to separate the logic
> from the presentation. Would you mind if I did this and sent it for
> your review?
>
> -Walter
>
> --
> -------------------------
> Walter F. Hoehn, Jr
> Systems Programmer
> Columbia University - EPIC
> -------------------------
>
>
>
>
> --------------000004010305040801030008
> Content-Type: text/plain;
> name="04.27.2002.HandleServlet.patch.txt"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline;
> filename="04.27.2002.HandleServlet.patch.txt"
>
> Index: HandleServlet.java
> ===================================================================
> RCS file: /src/cvsroot/ShibTest/HandleServlet.java,v
> retrieving revision 1.1
> diff -u -r1.1 HandleServlet.java
> --- HandleServlet.java 27 Apr 2002 18:25:48 -0000 1.1
> +++ HandleServlet.java 27 Apr 2002 18:32:32 -0000
> @@ -6,9 +6,7 @@
> import edu.internet2.middleware.shibboleth.*;
>
> public class HandleServlet extends HttpServlet {
> -
> - private PrintWriter out;
> -
> +
> private SAMLAuthenticationAssertionFactory factory;
> private HandleRepositoryFactory hrf;
>
> @@ -49,7 +47,7 @@
> {
>
> res.setContentType("text/html");
> - out = res.getWriter();
> + PrintWriter out = res.getWriter();
> HandleEntry he = null;
>
> String shireURL = req.getParameter("shire");
> @@ -123,7 +121,7 @@
> ( he.getHandle(), shireURL, clientAddress,
> he.getAuthType(), new Date(he.getAuthInstant()), null);
> byte[] buf = assertion.toBase64();
> - createForm(shireURL, targetURL, new String(buf));
> + createForm(shireURL, targetURL, new String(buf), out);
> }
> catch (SAMLException ex) {
> System.err.println(ex.getMessage());
> @@ -151,7 +149,7 @@
> }
>
>
> - private void createForm(String shireURL, String targetURL, String buf)
> + private void createForm(String shireURL, String targetURL, String
> buf, PrintWriter out)
> {
> /* print out form to html */
> out.println("<pre>");
>
> --------------000004010305040801030008--
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Barbara King Jensen _|_
>
> CMU Systems Group | http://halcyon.andrew.cmu.edu/blk/
>

------------------------------------------------------mace-shib-design-+
For list utilities, archives, subscribe, unsubscribe, etc. please visit the
ListProc web interface at

http://archives.internet2.edu/

------------------------------------------------------mace-shib-design--




Archive powered by MHonArc 2.6.16.

Top of Page