Skip to Content.
Sympa Menu

shibboleth-dev - Re: shib origin installation

Subject: Shibboleth Developers

List archive

Re: shib origin installation


Chronological Thread 
  • From: Walter Hoehn <>
  • To: Barbara Jensen <>
  • Cc:
  • Subject: Re: shib origin installation
  • Date: Sat, 27 Apr 2002 14:58:10 -0400

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
-------------------------



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>");



Archive powered by MHonArc 2.6.16.

Top of Page