Re: svn commit: r1486217 - /tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java

2013-05-25 Thread Violeta Georgieva
2013/5/25 Mark Thomas wrote:
>
> On 24/05/2013 21:58, violet...@apache.org wrote:
> > Author: violetagg
> > Date: Fri May 24 20:58:10 2013
> > New Revision: 1486217
> >
> > URL: http://svn.apache.org/r1486217
> > Log:
> > Temporary disable the test check.
>
> Why?

Because it was passing successful on my Windows box but failed on the
central build.

> And why does this need to be in svn rather than a local change?

Because I didn't want to keep the central build in a failing state while I
was debugging.
Fortunately I reproduced the failure on my MAC box and I just committed a
fix.

Violeta

>
> Mark
>
> >
> > Modified:
> > tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java
> >
> > Modified:
tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java
> > URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java?rev=1486217&r1=1486216&r2=1486217&view=diff
> >
==
> > --- tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java
(original)
> > +++ tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java
Fri May 24 20:58:10 2013
> > @@ -684,7 +684,7 @@ public class TestRequest extends TomcatB
> >  while ((line = reader.readLine()) != null) {
> >  response.add(line);
> >  }
> > -assertTrue(response.contains("Part äö"));
> > +//assertTrue(response.contains("Part äö"));
> >  } catch (Exception e) {
> >  if (reader != null) {
> >  reader.close();
> >
> >
> >
> > -
> > 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
>


Re: svn commit: r1486217 - /tomcat/trunk/test/org/apache/catalina/connector/TestRequest.java

2013-05-25 Thread Mark Thomas
On 25/05/2013 08:04, Violeta Georgieva wrote:
> 2013/5/25 Mark Thomas wrote:
>>
>> On 24/05/2013 21:58, violet...@apache.org wrote:
>>> Author: violetagg
>>> Date: Fri May 24 20:58:10 2013
>>> New Revision: 1486217
>>>
>>> URL: http://svn.apache.org/r1486217
>>> Log:
>>> Temporary disable the test check.
>>
>> Why?
> 
> Because it was passing successful on my Windows box but failed on the
> central build.
> 
>> And why does this need to be in svn rather than a local change?
> 
> Because I didn't want to keep the central build in a failing state while I
> was debugging.
> Fortunately I reproduced the failure on my MAC box and I just committed a
> fix.

Thanks for the explanation. It is usually worth putting brief details of
the why for stuff like this in the commit message. For example, I knew
about the failure but hadn't looked into the why (we still get some
random failures we don't fully understand) so the need for this wasn't
clear to me.

Mark


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



Re: [PATCH] jdbc-pool | FairBlockingQueue

2013-05-25 Thread Björn Raupach
Hi Chris,

thank you for your answer. Will do. :-)

kind regards,
Björn

On May 24, 2013, at 23:10 , Christopher Schultz  
wrote:

> Björn,
> 
> On 5/24/13 4:08 PM, Björn Raupach wrote:
>> out of pure curiosity I was browsing the source of jdbc-pool and
>> ended up looking through FairBlockingQueue. FairBlockingQueue
>> utilises a global ReentrantLock for mutual exclusion. Common practice
>> is to always follow a call to lock with a try-finally block. The
>> methods poll(long, TimeUnit), pollAsync() don't use that practice. I
>> was wondering why. Attached is modified version of FairBlockingQueue.
>> I know FairBlockingQueue is a sensitive part of jdbc-pool and I am
>> certainly not trying to smart ass. Its just interest and probably
>> only a minor issue.
> 
> Your attachment has been stripped from the list. It's best to attach
> patches to Bugzilla entries, but I'd wait and see if anyone objects to
> the idea before filing the bug.
> 
> If you can write a test that demonstrates a bug, that would be even
> better... "bug fixes" that come from pure code-reviews tend to be viewed
> skeptically around here, though this one seems to theoretically lead to
> deadlock.
> 
> If it can theoretically lead to deadlock, can you force a situation
> where it *actually* leads to deadlock (or some other unfortunate condition)?
> 
> -chris
> 


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



java-server-socket-binding-multiple-domain-host-names

2013-05-25 Thread Elgs Chen
Hi Mark,

I'm very sorry I know this is not related to the Tomcat project. However, I 
cannot find anyone who I think has more expertise in java networking 
programming than you.

I have a java server socket problem and I have no way to find the answer. I'm 
really hoping I can get some insights from you. Thanks in advance.

And here's the URL to this question:
http://stackoverflow.com/questions/16751062/java-server-socket-binding-multiple-domain-host-names

I have a java nio server with ip address 192.168.0.1 listening on port 80. I 
configured this server to bind to multiple domain/host names, let's say 
server1, server2, server3 are all resolved as 192.168.0.1.

Now I'm hoping if the client connects to server1, on the server side, I can 
recognize that the client is connecting to server1 instead of other names or 
direct ip address, so that I can do something special, and if the client is 
connecting to server2, I can recognize that the client is requesting server2, 
so I can do something else special, and so on.

Now the question is: seems on the server side, I cannot easily get the correct 
information which server name my clients are connecting to.

I have the follow code:

ServerSocketChannel ssChannel = (ServerSocketChannel) selKey.channel();
String boundHost = sChannel.socket().getLocalAddress().getHostName();
But it does not work, the boundHost is always the server1 even if clients 
connect to server2 or server3.

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



[OT] Re: java-server-socket-binding-multiple-domain-host-names

2013-05-25 Thread Mark Thomas
On 25/05/2013 17:23, Elgs Chen wrote:
> Hi Mark,
> 
> I'm very sorry I know this is not related to the Tomcat project.

Then mark the thread as off-topic and use the users mailing list.

> However, I cannot find anyone who I think has more expertise in java 
> networking programming than you.

Then you need to get out more. Also, flattery will get you nowhere.

> I have a java server socket problem and I have no way to find the answer. I'm 
> really hoping I can get some insights from you. Thanks in advance.
> 
> And here's the URL to this question:
> http://stackoverflow.com/questions/16751062/java-server-socket-binding-multiple-domain-host-names

Try reading the perfectly good answer you have already received or,
better yet, stop and think exactly what it is DNS does.

Mark

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



Re: [OT] Re: java-server-socket-binding-multiple-domain-host-names

2013-05-25 Thread Elgs Qian Chen
Thanks Mark. Actually I have problem with Apache2 proxy module when the backend 
is a wesocket server. I have written my own TCP proxy/port mapper, however, it 
maps only one client to one server. 

Now I think maybe I have to hack into the http protocol by reading a little bit 
from a client request, and steal out the server address information. 

Yes, it's up to the DNS to translate the address, not the server itself. Thank 
you very much. Now I'm clear. 

Best regards,
Elgs

Sent from my iPhone

On May 26, 2013, at 12:33 AM, "Mark Thomas"  wrote:

> On 25/05/2013 17:23, Elgs Chen wrote:
>> Hi Mark,
>> 
>> I'm very sorry I know this is not related to the Tomcat project.
> 
> Then mark the thread as off-topic and use the users mailing list.
> 
>> However, I cannot find anyone who I think has more expertise in java 
>> networking programming than you.
> 
> Then you need to get out more. Also, flattery will get you nowhere.
> 
>> I have a java server socket problem and I have no way to find the answer. 
>> I'm really hoping I can get some insights from you. Thanks in advance.
>> 
>> And here's the URL to this question:
>> http://stackoverflow.com/questions/16751062/java-server-socket-binding-multiple-domain-host-names
> 
> Try reading the perfectly good answer you have already received or,
> better yet, stop and think exactly what it is DNS does.
> 
> Mark
> 
> -
> 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



Re: java-server-socket-binding-multiple-domain-host-names

2013-05-25 Thread Enrico Olivelli
If you are using HTTP then clients will politely tell you which DNS name 
they are tryning to connect to using the "host:" header.

TCP does not give any info about "hostnames", but only about "IP Addresses"
I think .getLocalAddress().getHostName() will simply try to resolve back 
the IP address to  a DNS name


I hope that helps
Enrico

Il 25/05/2013 18:23, Elgs Chen ha scritto:

Hi Mark,

I'm very sorry I know this is not related to the Tomcat project. However, I 
cannot find anyone who I think has more expertise in java networking 
programming than you.

I have a java server socket problem and I have no way to find the answer. I'm 
really hoping I can get some insights from you. Thanks in advance.

And here's the URL to this question:
http://stackoverflow.com/questions/16751062/java-server-socket-binding-multiple-domain-host-names

I have a java nio server with ip address 192.168.0.1 listening on port 80. I 
configured this server to bind to multiple domain/host names, let's say 
server1, server2, server3 are all resolved as 192.168.0.1.

Now I'm hoping if the client connects to server1, on the server side, I can 
recognize that the client is connecting to server1 instead of other names or 
direct ip address, so that I can do something special, and if the client is 
connecting to server2, I can recognize that the client is requesting server2, 
so I can do something else special, and so on.

Now the question is: seems on the server side, I cannot easily get the correct 
information which server name my clients are connecting to.

I have the follow code:

ServerSocketChannel ssChannel = (ServerSocketChannel) selKey.channel();
String boundHost = sChannel.socket().getLocalAddress().getHostName();
But it does not work, the boundHost is always the server1 even if clients 
connect to server2 or server3.

Thanks,
Elgs
-
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



Re: java-server-socket-binding-multiple-domain-host-names

2013-05-25 Thread Elgs Chen
Yes, .getLocalAddress().getHostName() is not reliable. I don't assume the 
connection to be an HTTP connection. Probably I will set a new flag like 
allowPeep: true to request peeping into the header information if the users 
know that they are using HTTP for this connection. However, I'm afraid it's not 
possible to peep if the users are using HTTPS.

Thanks for the info, Enrico.
Elgs

On May 26, 2013, at 2:43 AM, Enrico Olivelli  wrote:

> If you are using HTTP then clients will politely tell you which DNS name they 
> are tryning to connect to using the "host:" header.
> TCP does not give any info about "hostnames", but only about "IP Addresses"
> I think .getLocalAddress().getHostName() will simply try to resolve back the 
> IP address to  a DNS name
> 
> I hope that helps
> Enrico
> 
> Il 25/05/2013 18:23, Elgs Chen ha scritto:
>> Hi Mark,
>> 
>> I'm very sorry I know this is not related to the Tomcat project. However, I 
>> cannot find anyone who I think has more expertise in java networking 
>> programming than you.
>> 
>> I have a java server socket problem and I have no way to find the answer. 
>> I'm really hoping I can get some insights from you. Thanks in advance.
>> 
>> And here's the URL to this question:
>> http://stackoverflow.com/questions/16751062/java-server-socket-binding-multiple-domain-host-names
>> 
>> I have a java nio server with ip address 192.168.0.1 listening on port 80. I 
>> configured this server to bind to multiple domain/host names, let's say 
>> server1, server2, server3 are all resolved as 192.168.0.1.
>> 
>> Now I'm hoping if the client connects to server1, on the server side, I can 
>> recognize that the client is connecting to server1 instead of other names or 
>> direct ip address, so that I can do something special, and if the client is 
>> connecting to server2, I can recognize that the client is requesting 
>> server2, so I can do something else special, and so on.
>> 
>> Now the question is: seems on the server side, I cannot easily get the 
>> correct information which server name my clients are connecting to.
>> 
>> I have the follow code:
>> 
>> ServerSocketChannel ssChannel = (ServerSocketChannel) selKey.channel();
>> String boundHost = sChannel.socket().getLocalAddress().getHostName();
>> But it does not work, the boundHost is always the server1 even if clients 
>> connect to server2 or server3.
>> 
>> Thanks,
>> Elgs
>> -
>> 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
> 
> 


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