[prev in list] [next in list] [prev in thread] [next in thread]
List: jboss-cvs-commits
Subject: [jboss-cvs] contrib/jetty/src/main/org/mortbay/http/handler ProxyHandler.java HTAccessHandler.java
From: Jules Gosnell <jules_gosnell () users ! sourceforge ! net>
Date: 2002-12-31 12:47:12
[Download RAW message or body]
User: jules_gosnell
Date: 02/12/31 04:47:12
Modified: jetty/src/main/org/mortbay/http/handler Tag: Branch_3_2
ProxyHandler.java HTAccessHandler.java
Log:
+ Fixed stop/start handling of servlet context
+ Reuse empty LogSink slots.
+ HTAccessHandler checks realm as well as htpassword.
+ Clear context listeners after stop.
+ Clear context attributes after stop.
+ Use requestedSessionId as default session ID.
+ Added MBeans for handlers
Revision Changes Path
No revision
No revision
1.15.2.5 +4 -5 contrib/jetty/src/main/org/mortbay/http/handler/ProxyHandler.java
Index: ProxyHandler.java
===================================================================
RCS file: /cvsroot/jboss/contrib/jetty/src/main/org/mortbay/http/handler/ProxyHandler.java,v
retrieving revision 1.15.2.4
retrieving revision 1.15.2.5
diff -u -r1.15.2.4 -r1.15.2.5
--- ProxyHandler.java 28 Dec 2002 15:32:12 -0000 1.15.2.4
+++ ProxyHandler.java 31 Dec 2002 12:47:11 -0000 1.15.2.5
@@ -1,6 +1,6 @@
// ========================================================================
// Copyright (c) 1999 Mort Bay Consulting (Australia) Pty. Ltd.
-// $Id: ProxyHandler.java,v 1.15.2.4 2002/12/28 15:32:12 jules_gosnell Exp $
+// $Id: ProxyHandler.java,v 1.15.2.5 2002/12/31 12:47:11 jules_gosnell Exp $
// ========================================================================
package org.mortbay.http.handler;
@@ -33,7 +33,7 @@
* <P>The HttpTunnel mechanism is also used to implement the CONNECT method.
*
*
- * @version $Id: ProxyHandler.java,v 1.15.2.4 2002/12/28 15:32:12 jules_gosnell Exp $
+ * @version $Id: ProxyHandler.java,v 1.15.2.5 2002/12/31 12:47:11 jules_gosnell Exp $
* @author Greg Wilkins (gregw)
*/
public class ProxyHandler extends AbstractHttpHandler
@@ -178,7 +178,7 @@
if (http!=null)
{
proxy_in = http.getErrorStream();
- int code=500;
+ int code=HttpResponse.__500_Internal_Server_Error;
code=http.getResponseCode();
response.setStatus(code);
@@ -220,9 +220,8 @@
Code.warning(e.toString());
Code.ignore(e);
if (!response.isCommitted())
- response.sendError(500);
+ response.sendError(HttpResponse.__400_Bad_Request);
}
-
}
/* ------------------------------------------------------------ */
1.3.2.3 +18 -10 contrib/jetty/src/main/org/mortbay/http/handler/HTAccessHandler.java
Index: HTAccessHandler.java
===================================================================
RCS file: /cvsroot/jboss/contrib/jetty/src/main/org/mortbay/http/handler/HTAccessHandler.java,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -u -r1.3.2.2 -r1.3.2.3
--- HTAccessHandler.java 15 Dec 2002 14:51:24 -0000 1.3.2.2
+++ HTAccessHandler.java 31 Dec 2002 12:47:11 -0000 1.3.2.3
@@ -15,6 +15,7 @@
import java.util.HashSet;
import java.util.Map;
import java.util.StringTokenizer;
+import org.mortbay.http.HttpContext;
import org.mortbay.http.HttpException;
import org.mortbay.http.HttpFields;
import org.mortbay.http.HttpRequest;
@@ -35,6 +36,7 @@
* @author Deville Daniel
* @author Dubois Roger
* @author Greg Wilkins
+ * @author Konstantin Metlov
*
*/
public class HTAccessHandler extends AbstractHttpHandler
@@ -158,7 +160,7 @@
}
// set required page
- if (!ht.checkAuth(user,password))
+ if (!ht.checkAuth(user,password,getHttpContext(),request))
{
Code.debug("Auth Failed");
_requireUser=true;
@@ -398,18 +400,24 @@
}
/* ------------------------------------------------------------ */
- public boolean checkAuth(String user, String pass)
+ public boolean checkAuth(String user,
+ String pass,
+ HttpContext context,
+ HttpRequest request)
{
if(_requireName == null)
return true;
-
- // Have to authenticate the user
- String code=getUserCode(user);
- if (code==null ||
- (code.equals("") && !pass.equals("")) ||
- (!code.equals(UnixCrypt.crypt(pass, code))))
- return false;
-
+
+ // Authenticate with realm
+ if (context.getRealm().authenticate(user, pass, request)==null)
+ {
+ // Have to authenticate the user with the password file
+ String code=getUserCode(user);
+ if (code==null ||
+ (code.equals("") && !pass.equals("")) ||
+ (!code.equals(UnixCrypt.crypt(pass, code))))
+ return false;
+ };
if (_requireName.equals(USER))
{
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
jboss-cvs-commits mailing list
jboss-cvs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-cvs-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic