You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by pg...@apache.org on 2002/10/26 19:31:24 UTC

cvs commit: jakarta-james/src/java/org/apache/james/nntpserver NNTPHandler.java

pgoldstein    2002/10/26 10:31:24

  Modified:    src/java/org/apache/james/nntpserver NNTPHandler.java
  Log:
  Caching authenticated state in the handler to reduce required number of authentication checks.
  
  Revision  Changes    Path
  1.20      +8 -1      jakarta-james/src/java/org/apache/james/nntpserver/NNTPHandler.java
  
  Index: NNTPHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/nntpserver/NNTPHandler.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- NNTPHandler.java	26 Oct 2002 04:15:29 -0000	1.19
  +++ NNTPHandler.java	26 Oct 2002 17:31:24 -0000	1.20
  @@ -245,6 +245,12 @@
       private String password;
   
       /**
  +     * Whether the user for this session has already authenticated.
  +     * Used to optimize authentication checks
  +     */
  +    boolean isAlreadyAuthenticated = false;
  +
  +    /**
        * The watchdog being used by this handler to deal with idle timeouts.
        */
       private Watchdog theWatchdog;
  @@ -390,6 +396,7 @@
           // Clear the authentication info
           user = null;
           password = null;
  +        isAlreadyAuthenticated = false;
   
           // Clear the config data
           theConfigData = null;
  @@ -1411,7 +1418,7 @@
        * @return whether the command is authorized
        */
       private boolean isAuthorized(String command) {
  -        boolean allowed = isAuthenticated();
  +        boolean allowed = isAlreadyAuthenticated || isAuthenticated();
           if (allowed) {
               return true;
           }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>