Tomcat Session Id generation Overriding!!

2010-01-09 Thread Arnab Ghosh
Deare Friends,

Tomcat is using ManagerBase generateSessionId() to generate session Id. But
I want a generation mechnism where each sessionId will be unique in whole
tomcat. Right now it is unique in a single context. But I want uniqueness
will be among all context running under the tomcat. How can I do that (In a
easieast way)??

Still now I have written a class which has extended the
org.apache.session.standardManager class. Then I have changed the code
slightly. But I don't know whether any sideeffect will be there or not??


I have given the code as
following


package com.myproject.session;


import java.util.HashSet;
import java.util.Set;
import org.apache.catalina.Session;
import org.apache.catalina.session.StandardManager;


public class MySessionManager extends StandardManager {

 public static Set unquieSessionIdset = new HashSet();

 @Override
 public void remove(Session session) {
   unquieSessionIdset.remove(session.getIdInternal());
   super.remove(session);
 }



 @Override
 protected synchronized String generateSessionId() {
  byte random[] = new byte[16];
  String jvmRoute = getJvmRoute();
String result = null;
// Render the result as a String of hexadecimal digits
StringBuffer buffer = new StringBuffer();
do {
int resultLenBytes = 0;
if (result != null) {
buffer = new StringBuffer();
   duplicates++;
}
while (resultLenBytes < this.sessionIdLength) {
getRandomBytes(random);
random = getDigest().digest(random);
for (int j = 0;
j < random.length && resultLenBytes < this.sessionIdLength;
j++) {
byte b1 = (byte) ((random[j] & 0xf0) >> 4);
byte b2 = (byte) (random[j] & 0x0f);
if (b1 < 10)
buffer.append((char) ('0' + b1));
else
buffer.append((char) ('A' + (b1 - 10)));
if (b2 < 10)
buffer.append((char) ('0' + b2));
else
buffer.append((char) ('A' + (b2 - 10)));
resultLenBytes++;
}
}
if (jvmRoute != null) {
buffer.append('.').append(jvmRoute);
}
result = buffer.toString();
} while (sessions.containsKey(result) ||
!unquieSessionIdset.add(result));

return (result);
 }
}


Can You please tell me whether it will have any other problem or not?? Or
can you give any alternative solution??

Actually I kept the existing code. With that I addeda a static set. And I am
keeping the generated session in set also. While generating Id I am trying
to add that to set. if successfully added then I will return that key.

Thanks
Arnab Ghosh


Re: Tomcat Session Id generation Overriding!!

2010-01-09 Thread Mark Thomas
On 09/01/2010 10:57, Arnab Ghosh wrote:
> Actually I kept the existing code. With that I addeda a static set. And I am
> keeping the generated session in set also. While generating Id I am trying
> to add that to set. if successfully added then I will return that key.

Please don't cross-post to the users and the dev list.

Please keep this thread on the users list where it belongs.

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: Removal of libtcnative-1.dll files from /dist

2010-01-09 Thread sebb
On 09/01/2010, Konstantin Kolinko  wrote:
> 2010/1/4 Konstantin Kolinko :
>
> > Hi, all!
>  >
>  > I removed the libtcnative-1.dll files of Tomcat Native 1.1.18 from
>  > www.apache.org/dist/tomcat/tomcat-connectors/native/1.1.18/binaries
>  >

Agreed.

>
> 5 days passed, and the current status is the following:
>
>  a) the libtcnative-1.dll files are still present at
>  
> http://www.apache.org/dist/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/

Agreed.

Note that the delete phase of mirroring only runs once a day (but I
agree this should have happened by now).

>  b) they are absent at mirrors

They are present at both the mirrors I checked:

http://mirrors.dedipower.com/ftp.apache.org/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/

http://mirror.ox.ac.uk/sites/rsync.apache.org/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/

>  c) they are absent at archive.apache.org
>
>
>  Reading the manual,
>  http://www.apache.org/dev/mirror-step-by-step.html
>  I should say that the host where I removed the files 5 days ago was p.a.o.
>
>  It looks like they have to be removed from www.apache.org directly.

No, the www.apache.org host is synch. from p.a.o.
However, the delete phase run separately - maybe that has been having problems.

I suggest you raise this with Infra.

>
>
>
>  I noticed one glitch with the archive.apache.org site:
>  In the binaries folder the README.html file, that mentions the APR and
>  OpenSSL versions that were used to build the binaries is neither
>  displayed on the page like on www.apache.org, nor listed among the
>  files. [1]
>
>  [1] 
> http://archive.apache.org/dist/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/
>
>  Though it is readable if I access it directly [2], so it is present there.
>
>  [2] 
> http://archive.apache.org/dist/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/README.html
>
>  Looks like some misconfiguration at archive.apache.org.
>
>
>  Best regards,
>  Konstantin Kolinko
>
>  -
>  To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>  For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48513] New: IIS Quick setup instructions

2010-01-09 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48513

   Summary: IIS Quick setup instructions
   Product: Tomcat Connectors
   Version: 1.2.28
  Platform: All
OS/Version: Windows Server 2003
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Documentation
AssignedTo: dev@tomcat.apache.org
ReportedBy: patlacha...@gmail.com


Responded to the call and I am proposing IIS quick setup instructions...
Please continue your good work!

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48513] IIS Quick setup instructions

2010-01-09 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48513

--- Comment #1 from Patrice LACHANCE  2010-01-09 
04:40:10 UTC ---
Created an attachment (id=24822)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24822)
xdocs/generic_howto/quick.xml patch

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: Removal of libtcnative-1.dll files from /dist

2010-01-09 Thread sebb
On 09/01/2010, Konstantin Kolinko  wrote:
> 2010/1/4 Konstantin Kolinko :
>
> > Hi, all!
>  >
>  > I removed the libtcnative-1.dll files of Tomcat Native 1.1.18 from
>  > www.apache.org/dist/tomcat/tomcat-connectors/native/1.1.18/binaries
>  >
>
>
> 5 days passed, and the current status is the following:
>
>  a) the libtcnative-1.dll files are still present at
>  
> http://www.apache.org/dist/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/
>
>  b) they are absent at mirrors
>
>  c) they are absent at archive.apache.org
>
>
>  Reading the manual,
>  http://www.apache.org/dev/mirror-step-by-step.html
>  I should say that the host where I removed the files 5 days ago was p.a.o.
>
>  It looks like they have to be removed from www.apache.org directly.
>
>
>
>
>  I noticed one glitch with the archive.apache.org site:
>  In the binaries folder the README.html file, that mentions the APR and
>  OpenSSL versions that were used to build the binaries is neither
>  displayed on the page like on www.apache.org, nor listed among the
>  files. [1]
>
>  [1] 
> http://archive.apache.org/dist/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/
>
>  Though it is readable if I access it directly [2], so it is present there.
>
>  [2] 
> http://archive.apache.org/dist/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/README.html
>
>  Looks like some misconfiguration at archive.apache.org.
>

The same applies to the top level directory:

http://archive.apache.org/dist/

Neither HEADER.html nor README.html appear in the listing, nor do they
appear as header and footer in the index page.

I suspect this is deliberate - the above-mentioned HEADER says:

"Apache Software Foundation Distribution Directory"

which is not correct for the archive site.
Likewise, displaying other footers/headers might confuse people.

>
>  Best regards,
>  Konstantin Kolinko
>
>  -
>  To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>  For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r897442 - in /tomcat/trunk/test/org/apache/catalina/valves: RemoteIpValveTest.java TestRemoteIpValve.java

2010-01-09 Thread markt
Author: markt
Date: Sat Jan  9 13:14:58 2010
New Revision: 897442

URL: http://svn.apache.org/viewvc?rev=897442&view=rev
Log:
Rename to fit expected naming convention

Added:
tomcat/trunk/test/org/apache/catalina/valves/TestRemoteIpValve.java
  - copied, changed from r896946, 
tomcat/trunk/test/org/apache/catalina/valves/RemoteIpValveTest.java
Removed:
tomcat/trunk/test/org/apache/catalina/valves/RemoteIpValveTest.java

Copied: tomcat/trunk/test/org/apache/catalina/valves/TestRemoteIpValve.java 
(from r896946, 
tomcat/trunk/test/org/apache/catalina/valves/RemoteIpValveTest.java)
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/valves/TestRemoteIpValve.java?p2=tomcat/trunk/test/org/apache/catalina/valves/TestRemoteIpValve.java&p1=tomcat/trunk/test/org/apache/catalina/valves/RemoteIpValveTest.java&r1=896946&r2=897442&rev=897442&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/valves/RemoteIpValveTest.java 
(original)
+++ tomcat/trunk/test/org/apache/catalina/valves/TestRemoteIpValve.java Sat Jan 
 9 13:14:58 2010
@@ -33,7 +33,7 @@
 /**
  * {...@link RemoteIpValve} Tests
  */
-public class RemoteIpValveTest extends TestCase {
+public class TestRemoteIpValve extends TestCase {
 
 static class RemoteAddrAndHostTrackerValve extends ValveBase {
 private String remoteAddr;



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: Removal of libtcnative-1.dll files from /dist

2010-01-09 Thread Konstantin Kolinko
2010/1/9 sebb :
> On 09/01/2010, Konstantin Kolinko  wrote:
>> 2010/1/4 Konstantin Kolinko :
>>
>> > Hi, all!
>>  >
>>  > I removed the libtcnative-1.dll files of Tomcat Native 1.1.18 from
>>  > www.apache.org/dist/tomcat/tomcat-connectors/native/1.1.18/binaries
>>  >
>
> Agreed.
>
>>
>> 5 days passed, and the current status is the following:
>>
>>  a) the libtcnative-1.dll files are still present at
>>  http://www.apache.org/dist/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/
>
> Agreed.
>
> Note that the delete phase of mirroring only runs once a day (but I
> agree this should have happened by now).
>
>>  b) they are absent at mirrors
>
> They are present at both the mirrors I checked:
>
> http://mirrors.dedipower.com/ftp.apache.org/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/
>
> http://mirror.ox.ac.uk/sites/rsync.apache.org/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/
>

Ah, I see. Some mirrors have it and some do not.

http://www.eu.apache.org/dist/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/
has the file, and the mirrors reading from there will have it

http://www.us.apache.org/dist/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/
does not have the file

>>  c) they are absent at archive.apache.org
>>
>>
>>  Reading the manual,
>>  http://www.apache.org/dev/mirror-step-by-step.html
>>  I should say that the host where I removed the files 5 days ago was p.a.o.
>>
>>  It looks like they have to be removed from www.apache.org directly.
>
> No, the www.apache.org host is synch. from p.a.o.

Oh, so there is an error in the manual, I mean
http://www.apache.org/dev/mirror-step-by-step.html
should not say "% ssh -l rdonkin www.apache.org", but ... p.a.o.

> However, the delete phase run separately - maybe that has been having 
> problems.
>
> I suggest you raise this with Infra.
>

OK, I'll raise the question. Thank you.

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: Removal of libtcnative-1.dll files from /dist

2010-01-09 Thread sebb
On 10/01/2010, Konstantin Kolinko  wrote:
> 2010/1/9 sebb :
>
> > On 09/01/2010, Konstantin Kolinko  wrote:
>  >> 2010/1/4 Konstantin Kolinko :
>  >>
>  >> > Hi, all!
>  >>  >
>  >>  > I removed the libtcnative-1.dll files of Tomcat Native 1.1.18 from
>  >>  > www.apache.org/dist/tomcat/tomcat-connectors/native/1.1.18/binaries
>  >>  >
>  >
>  > Agreed.
>  >
>  >>
>  >> 5 days passed, and the current status is the following:
>  >>
>  >>  a) the libtcnative-1.dll files are still present at
>  >>  
> http://www.apache.org/dist/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/
>  >
>  > Agreed.
>  >
>  > Note that the delete phase of mirroring only runs once a day (but I
>  > agree this should have happened by now).
>  >
>  >>  b) they are absent at mirrors
>  >
>  > They are present at both the mirrors I checked:
>  >
>  > 
> http://mirrors.dedipower.com/ftp.apache.org/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/
>  >
>  > 
> http://mirror.ox.ac.uk/sites/rsync.apache.org/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/
>  >
>
>
> Ah, I see. Some mirrors have it and some do not.
>
>  
> http://www.eu.apache.org/dist/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/
>  has the file, and the mirrors reading from there will have it
>
>  
> http://www.us.apache.org/dist/tomcat/tomcat-connectors/native/1.1.18/binaries/win32/
>  does not have the file
>

So the problem is that the EU mirror host is out of date with regards
to deletions.

I'm in UK, and I checked 2 EU mirrors only; forgot to check the EU host ;-)
This explains why I got different results from you.

>  >>  c) they are absent at archive.apache.org
>  >>
>  >>
>  >>  Reading the manual,
>  >>  http://www.apache.org/dev/mirror-step-by-step.html
>  >>  I should say that the host where I removed the files 5 days ago was 
> p.a.o.
>  >>
>  >>  It looks like they have to be removed from www.apache.org directly.
>  >
>  > No, the www.apache.org host is synch. from p.a.o.
>
>
> Oh, so there is an error in the manual, I mean
>
> http://www.apache.org/dev/mirror-step-by-step.html
>
> should not say "% ssh -l rdonkin www.apache.org", but ... p.a.o.
>
>
>  > However, the delete phase run separately - maybe that has been having 
> problems.
>  >
>  > I suggest you raise this with Infra.
>  >
>
>
> OK, I'll raise the question. Thank you.
>
>
>  Best regards,
>  Konstantin Kolinko
>
>  -
>  To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>  For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org