Merge "Merge branch 'stable-2.13'"
This commit is contained in:
		@@ -161,6 +161,7 @@ public class ProjectQoSFilter implements Filter {
 | 
				
			|||||||
    private final Object lock = new Object();
 | 
					    private final Object lock = new Object();
 | 
				
			||||||
    private boolean done;
 | 
					    private boolean done;
 | 
				
			||||||
    private Thread worker;
 | 
					    private Thread worker;
 | 
				
			||||||
 | 
					    private String fullName;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    TaskThunk(final WorkQueue.Executor executor, final Continuation cont,
 | 
					    TaskThunk(final WorkQueue.Executor executor, final Continuation cont,
 | 
				
			||||||
        final HttpServletRequest req) {
 | 
					        final HttpServletRequest req) {
 | 
				
			||||||
@@ -219,28 +220,33 @@ public class ProjectQoSFilter implements Filter {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public String toString() {
 | 
					    public String toString() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (fullName != null) {
 | 
				
			||||||
 | 
					        return fullName;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      CurrentUser who = user.get();
 | 
				
			||||||
 | 
					      if (who.isIdentifiedUser()) {
 | 
				
			||||||
 | 
					        String username = who.asIdentifiedUser().getUserName();
 | 
				
			||||||
 | 
					        if (username != null && !username.isEmpty()) {
 | 
				
			||||||
 | 
					          fullName = name + " (" + username + ")";
 | 
				
			||||||
 | 
					          return fullName;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      return name;
 | 
					      return name;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private String generateName(HttpServletRequest req) {
 | 
					    private String generateName(HttpServletRequest req) {
 | 
				
			||||||
      String userName = "";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      CurrentUser who = user.get();
 | 
					 | 
				
			||||||
      if (who.isIdentifiedUser()) {
 | 
					 | 
				
			||||||
        String name = who.asIdentifiedUser().getUserName();
 | 
					 | 
				
			||||||
        if (name != null && !name.isEmpty()) {
 | 
					 | 
				
			||||||
          userName = " (" + name + ")";
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
      String uri = req.getServletPath();
 | 
					      String uri = req.getServletPath();
 | 
				
			||||||
      Matcher m = URI_PATTERN.matcher(uri);
 | 
					      Matcher m = URI_PATTERN.matcher(uri);
 | 
				
			||||||
      if (m.matches()) {
 | 
					      if (m.matches()) {
 | 
				
			||||||
        String path = m.group(1);
 | 
					        String path = m.group(1);
 | 
				
			||||||
        String cmd = m.group(2);
 | 
					        String cmd = m.group(2);
 | 
				
			||||||
        return cmd + " " + path + userName;
 | 
					        return cmd + " " + path;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      return req.getMethod() + " " + uri + userName;
 | 
					      return req.getMethod() + " " + uri;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user