simpleweb-support Mailing List for Simple (Page 24)
Brought to you by:
niallg
You can subscribe to this list here.
2004 |
Jan
(1) |
Feb
(4) |
Mar
(2) |
Apr
(14) |
May
(22) |
Jun
(15) |
Jul
(9) |
Aug
(2) |
Sep
(7) |
Oct
(4) |
Nov
(2) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(7) |
Feb
(16) |
Mar
(17) |
Apr
|
May
(12) |
Jun
(4) |
Jul
(22) |
Aug
(50) |
Sep
(8) |
Oct
(23) |
Nov
(9) |
Dec
(50) |
2006 |
Jan
(6) |
Feb
(7) |
Mar
(8) |
Apr
(3) |
May
(13) |
Jun
(4) |
Jul
(2) |
Aug
|
Sep
(1) |
Oct
|
Nov
(6) |
Dec
(7) |
2007 |
Jan
(11) |
Feb
(3) |
Mar
(17) |
Apr
(21) |
May
(9) |
Jun
(4) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
(14) |
Dec
(3) |
2008 |
Jan
(3) |
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
(4) |
Aug
(4) |
Sep
(15) |
Oct
(9) |
Nov
(6) |
Dec
(2) |
2009 |
Jan
(29) |
Feb
(2) |
Mar
(8) |
Apr
(14) |
May
(4) |
Jun
(13) |
Jul
(5) |
Aug
|
Sep
|
Oct
(4) |
Nov
(3) |
Dec
(7) |
2010 |
Jan
|
Feb
(2) |
Mar
(61) |
Apr
(9) |
May
(10) |
Jun
(9) |
Jul
(10) |
Aug
(7) |
Sep
(15) |
Oct
(5) |
Nov
(2) |
Dec
(3) |
2011 |
Jan
(11) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
(4) |
Oct
|
Nov
(6) |
Dec
(9) |
2012 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
(3) |
May
(2) |
Jun
|
Jul
(17) |
Aug
|
Sep
|
Oct
|
Nov
(10) |
Dec
(5) |
2013 |
Jan
(2) |
Feb
(4) |
Mar
|
Apr
(12) |
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
(1) |
2014 |
Jan
|
Feb
(2) |
Mar
(6) |
Apr
|
May
|
Jun
(20) |
Jul
(12) |
Aug
(4) |
Sep
(3) |
Oct
(5) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Christophe R. <cr...@ac...> - 2006-01-10 19:24:04
|
Hi, Does anyone as an example on how to use the fileupload classes (simple-upload)? Thanks. Christophe |
From: Andrew B. <an...@ro...> - 2005-12-27 19:17:07
|
I'd rather not work with a modified code-base; doing that makes it more difficult for me to benefit from the new fixes and features of SimpleWeb 2.8 :-) I agree with your point about using parameters within the collection framework. What about adding a method with a signature like this? Collection<String> getParameterValues(paramName) Then you'll have done the servlet API one better with a strongly- typed, modifiable collection. -- Andrew > > Date: Thu, 22 Dec 2005 13:09:28 -0800 (PST) > From: Niall Gallagher <gal...@ya...> > Subject: Re: [Simpleweb-Support] Re: Multi-value parameters > To: sim...@li... > Reply-To: sim...@li... > > Hi Andrew, > > Sure, I can add this back (you could simply cut and > paste from a previous release). The reason for the > change was to make the parameters editable via the > java.util.Map. Previously parameters were read only, > however I find that it can be very useful to add > parameters to the request and either forward it to > another Service or redirect it else where. Also, its > nice to be able to use the parameters with the > collections framework. > > Niall |
From: Niall G. <gal...@ya...> - 2005-12-22 21:09:37
|
Hi Andrew, Sure, I can add this back (you could simply cut and paste from a previous release). The reason for the change was to make the parameters editable via the java.util.Map. Previously parameters were read only, however I find that it can be very useful to add parameters to the request and either forward it to another Service or redirect it else where. Also, its nice to be able to use the parameters with the collections framework. Niall --- Andrew Bunner <an...@ro...> wrote: > Hi Niall, > > Was there a technical reason for removing support > for multi-value > parameters? I don't want to go back to an earlier > version of > SimpleWeb, but that sure feature would be handy. I'm > porting some > Servlets into SimpleWeb and I used to have > multi-value parameters > (via getParameterValues). Without multi-value > parameters, I'll have > to change my client code (that calls my Servlets) to > do some kind of > single-key-with-values-separated-by-delimiters > scheme. Which just > doesn't feel right. > > Any chance I could talk you into putting this > feature back in :-) > > -- Andrew > > On Dec 21, 2005, at 8:40 PM, simpleweb-support- > re...@li... wrote: > > > > Date: Wed, 21 Dec 2005 14:02:18 -0800 (PST) > > From: Niall Gallagher <gal...@ya...> > > Subject: Re: [Simpleweb-Support] Multi-value > parameters > > To: sim...@li... > > Reply-To: sim...@li... > > > > Hi Andrew, > > > > It did have multivalue parameters via > > Parameters.getParameters() up to about a month > ago. > > However I removed this feature, now only the POST > > parameter is available from the > Request.getParameters. > > If you want the query parameters then you need to > > parse the URI. I may add this feature back in the > next > > release....? > > > > Niall > > > > --- Andrew Bunner <an...@ro...> wrote: > > > >> Hi there, > >> > >> I'm new to simpleweb and... so far so good, > but > >> it's missing one > >> feature from the Servlet API that I like. That > is, > >> on Servlets, you > >> can say: > >> > >> String[] paramValuesForThisName = > >> request.getParameterValues > >> ("paramName"); > >> > >> In simpleweb, there seems to be a one-key to > >> one-value mapping for > >> parameters in the request. So I guess this is a > >> feature request. > >> Niall, any plans to allow multi-value parameters? > >> > >> -- Andrew > >> > >> Andrew Bunner > >> Director of Engineering, Rojo Networks, Inc. > >> an...@ro... > >> P: 415-848-2444 > >> Please visit http://www.rojo.com/ to start your > FREE > >> Rojo account > >> > >> > >> > >> > >> > >> > > > ------------------------------------------------------- > >> This SF.net email is sponsored by: Splunk Inc. Do > >> you grep through log files > >> for problems? Stop! Download the new AJAX > search > >> engine that makes > >> searching your log files as easy as surfing the > >> web. DOWNLOAD SPLUNK! > >> > > > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > >> _______________________________________________ > >> Simpleweb-Support mailing list > >> Sim...@li... > >> > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > >> > > > > > > Niall Gallagher > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > > > > > > > --__--__-- > > > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > > End of Simpleweb-Support Digest > > > Andrew Bunner > Director of Engineering, Rojo Networks, Inc. > an...@ro... > P: 415-848-2444 > Please visit http://www.rojo.com/ to start your FREE > Rojo account > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do > you grep through log files > for problems? Stop! Download the new AJAX search > engine that makes > searching your log files as easy as surfing the > web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > Niall Gallagher __________________________________________ Yahoo! DSL Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com |
From: Andrew B. <an...@ro...> - 2005-12-22 20:00:54
|
Hi Niall, Was there a technical reason for removing support for multi-value parameters? I don't want to go back to an earlier version of SimpleWeb, but that sure feature would be handy. I'm porting some Servlets into SimpleWeb and I used to have multi-value parameters (via getParameterValues). Without multi-value parameters, I'll have to change my client code (that calls my Servlets) to do some kind of single-key-with-values-separated-by-delimiters scheme. Which just doesn't feel right. Any chance I could talk you into putting this feature back in :-) -- Andrew On Dec 21, 2005, at 8:40 PM, simpleweb-support- re...@li... wrote: > Date: Wed, 21 Dec 2005 14:02:18 -0800 (PST) > From: Niall Gallagher <gal...@ya...> > Subject: Re: [Simpleweb-Support] Multi-value parameters > To: sim...@li... > Reply-To: sim...@li... > > Hi Andrew, > > It did have multivalue parameters via > Parameters.getParameters() up to about a month ago. > However I removed this feature, now only the POST > parameter is available from the Request.getParameters. > If you want the query parameters then you need to > parse the URI. I may add this feature back in the next > release....? > > Niall > > --- Andrew Bunner <an...@ro...> wrote: > >> Hi there, >> >> I'm new to simpleweb and... so far so good, but >> it's missing one >> feature from the Servlet API that I like. That is, >> on Servlets, you >> can say: >> >> String[] paramValuesForThisName = >> request.getParameterValues >> ("paramName"); >> >> In simpleweb, there seems to be a one-key to >> one-value mapping for >> parameters in the request. So I guess this is a >> feature request. >> Niall, any plans to allow multi-value parameters? >> >> -- Andrew >> >> Andrew Bunner >> Director of Engineering, Rojo Networks, Inc. >> an...@ro... >> P: 415-848-2444 >> Please visit http://www.rojo.com/ to start your FREE >> Rojo account >> >> >> >> >> >> > ------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. Do >> you grep through log files >> for problems? Stop! Download the new AJAX search >> engine that makes >> searching your log files as easy as surfing the >> web. DOWNLOAD SPLUNK! >> > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click >> _______________________________________________ >> Simpleweb-Support mailing list >> Sim...@li... >> > https://lists.sourceforge.net/lists/listinfo/simpleweb-support >> > > > Niall Gallagher > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > > > --__--__-- > > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > End of Simpleweb-Support Digest Andrew Bunner Director of Engineering, Rojo Networks, Inc. an...@ro... P: 415-848-2444 Please visit http://www.rojo.com/ to start your FREE Rojo account |
From: Niall G. <gal...@ya...> - 2005-12-21 22:02:27
|
Hi Andrew, It did have multivalue parameters via Parameters.getParameters() up to about a month ago. However I removed this feature, now only the POST parameter is available from the Request.getParameters. If you want the query parameters then you need to parse the URI. I may add this feature back in the next release....? Niall --- Andrew Bunner <an...@ro...> wrote: > Hi there, > > I'm new to simpleweb and... so far so good, but > it's missing one > feature from the Servlet API that I like. That is, > on Servlets, you > can say: > > String[] paramValuesForThisName = > request.getParameterValues > ("paramName"); > > In simpleweb, there seems to be a one-key to > one-value mapping for > parameters in the request. So I guess this is a > feature request. > Niall, any plans to allow multi-value parameters? > > -- Andrew > > Andrew Bunner > Director of Engineering, Rojo Networks, Inc. > an...@ro... > P: 415-848-2444 > Please visit http://www.rojo.com/ to start your FREE > Rojo account > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do > you grep through log files > for problems? Stop! Download the new AJAX search > engine that makes > searching your log files as easy as surfing the > web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > Niall Gallagher __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Andrew B. <an...@ro...> - 2005-12-21 20:06:31
|
Hi there, I'm new to simpleweb and... so far so good, but it's missing one feature from the Servlet API that I like. That is, on Servlets, you can say: String[] paramValuesForThisName = request.getParameterValues ("paramName"); In simpleweb, there seems to be a one-key to one-value mapping for parameters in the request. So I guess this is a feature request. Niall, any plans to allow multi-value parameters? -- Andrew Andrew Bunner Director of Engineering, Rojo Networks, Inc. an...@ro... P: 415-848-2444 Please visit http://www.rojo.com/ to start your FREE Rojo account |
From: Brian D. <wic...@gm...> - 2005-12-18 19:00:53
|
Hi.. thanks for the input.. current results below... public void test1006() throws Exception { File dir =3D new File("test/carol"); File[] list =3D dir.listFiles(); for (int i =3D 0; i < list.length; i++) { File tmp =3D list[i]; String path =3D tmp.getAbsolutePath(); int x =3D path.lastIndexOf('/'); if (x !=3D -1) { path =3D path.substring(x+1); } HttpClient client =3D new HttpClient(); HttpMethod method =3D new GetMethod("http://127.0.0.1:2000/carol/" + path); try { int status =3D client.executeMethod(method); byte[] body =3D method.getResponseBody(); Assert.assertTrue(status =3D=3D 200); } catch (Exception ex) { throw ex; } finally { method.releaseConnection(); } } } 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/contents.doc HTTP/1.1" 200 19968 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/contents.html HTTP/1.1" 200 607 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/contents.pdf HTTP/1.1" 200 8140 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/contents.txt HTTP/1.1" 200 188 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/preface.doc HTTP/1.1" 200 19968 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/preface.html HTTP/1.1" 200 830 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/preface.pdf HTTP/1.1" 200 8467 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/preface.txt HTTP/1.1" 200 366 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/stave1.doc HTTP/1.1" 200 88064 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/stave1.html HTTP/1.1" 200 38755 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/stave1.pdf HTTP/1.1" 200 76956 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/stave1.txt HTTP/1.1" 200 37092 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/stave2.doc HTTP/1.1" 200 80896 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/stave2.html HTTP/1.1" 200 36186 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/stave2.pdf HTTP/1.1" 200 67731 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/stave2.txt HTTP/1.1" 200 34739 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/stave3.doc HTTP/1.1" 200 100352 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/stave3.html HTTP/1.1" 200 48604 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:57 -0000] "GET /carol/stave3.pdf HTTP/1.1" 200 85185 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:58 -0000] "GET /carol/stave3.txt HTTP/1.1" 200 47176 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:58 -0000] "GET /carol/stave4.doc HTTP/1.1" 200 74240 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:58 -0000] "GET /carol/stave4.html HTTP/1.1" 200 31303 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:58 -0000] "GET /carol/stave4.pdf HTTP/1.1" 200 62070 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:58 -0000] "GET /carol/stave4.txt HTTP/1.1" 200 29757 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:58 -0000] "GET /carol/stave5.doc HTTP/1.1" 200 38400 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:58 -0000] "GET /carol/stave5.html HTTP/1.1" 200 13697 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:58 -0000] "GET /carol/stave5.pdf HTTP/1.1" 200 31047 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:58 -0000] "GET /carol/stave5.txt HTTP/1.1" 200 12818 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:58 -0000] "GET /carol/title.doc HTTP/1.1" 200 19968 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:58 -0000] "GET /carol/title.html HTTP/1.1" 200 447 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:58 -0000] "GET /carol/title.pdf HTTP/1.1" 200 8150 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:58 -0000] "GET /carol/title.txt HTTP/1.1" 200 88 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 // test gzip public void test7001() throws Exception { File dir =3D new File("test/carol"); File[] list =3D dir.listFiles(); for (int i =3D 0; i < list.length; i++) { File tmp =3D list[i]; String path =3D tmp.getAbsolutePath(); int x =3D path.lastIndexOf('/'); if (x !=3D -1) { path =3D path.substring(x+1); } HttpClient client =3D new HttpClient(); HttpMethod method =3D new GetMethod("http://127.0.0.1:2000/carol/" + path); method.setRequestHeader("Accept-Encoding", "gzip"); try { int status =3D client.executeMethod(method); byte[] body =3D method.getResponseBody(); if (method.getResponseHeader("Content-Encoding") !=3D null && method.getResponseHeader("Content-Encoding").getValue().equals("gzi= p")) { System.err.println("GZIP MY FRIEND " + path); GZIPInputStream in =3D new GZIPInputStream(new ByteArrayInputStream(body)); byte[] decoded =3D new byte[Integer.parseInt(method.getResponseHeader("Content-Length").getValue()= )]; in.read(decoded, 0, decoded.length); } Assert.assertTrue(status =3D=3D 200); } catch (Exception ex) { throw ex; } finally { method.releaseConnection(); } } } 127.0.0.1 - - [18/Dec/2005:18:52:58 -0000] "GET /carol/contents.doc HTTP/1.1" 200 2043 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:58 -0000] "GET /carol/contents.html HTTP/1.1" 200 379 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:59 -0000] "GET /carol/contents.pdf HTTP/1.1" 200 2900 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:59 -0000] "GET /carol/contents.txt HTTP/1.1" 200 124 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:59 -0000] "GET /carol/preface.doc HTTP/1.1" 200 2171 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:59 -0000] "GET /carol/preface.html HTTP/1.1" 200 541 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:59 -0000] "GET /carol/preface.pdf HTTP/1.1" 200 3158 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:59 -0000] "GET /carol/preface.txt HTTP/1.1" 200 250 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:59 -0000] "GET /carol/stave1.doc HTTP/1.1" 200 23319 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:52:59 -0000] "GET /carol/stave1.html HTTP/1.1" 200 16154 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave1.pdf HTTP/1.1" 200 45454 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave1.txt HTTP/1.1" 200 15662 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave2.doc HTTP/1.1" 200 21556 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave2.html HTTP/1.1" 200 15066 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave2.pdf HTTP/1.1" 200 40428 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave2.txt HTTP/1.1" 200 14623 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave3.doc HTTP/1.1" 200 27909 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave3.html HTTP/1.1" 200 20182 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave3.pdf HTTP/1.1" 200 51863 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave3.txt HTTP/1.1" 200 19720 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave4.doc HTTP/1.1" 200 19062 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave4.pdf HTTP/1.1" 200 36394 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave4.html HTTP/1.1" 200 13008 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave4.txt HTTP/1.1" 200 12568 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave5.doc HTTP/1.1" 200 8748 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave5.html HTTP/1.1" 200 5980 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave5.txt HTTP/1.1" 200 5619 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/stave5.pdf HTTP/1.1" 200 17410 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:00 -0000] "GET /carol/title.doc HTTP/1.1" 200 2033 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:01 -0000] "GET /carol/title.html HTTP/1.1" 200 340 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:01 -0000] "GET /carol/title.pdf HTTP/1.1" 200 2885 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 127.0.0.1 - - [18/Dec/2005:18:53:01 -0000] "GET /carol/title.txt HTTP/1.1" 200 88 "" "Jakarta Commons-HttpClient/3.0-rc4" 127.0.0.1:2000 public class GZipEncoder { public GZipEncoder(Request req, Response res) { _req =3D req; _res =3D res; } public byte[] encode(byte[] data) { if (String.valueOf(_req.getValue("Accept-Encoding")).toLowerCase().= indexOf("gzip") !=3D -1) { ByteArrayOutputStream bout =3D new ByteArrayOutputStream(); GZIPOutputStream out =3D null; try { out =3D new GZIPOutputStream(bout); out.write(data, 0, data.length); out.finish(); } catch (Exception ex) { } finally { try { out.close(); } catch (Exception ex) { } } byte[] tmp =3D bout.toByteArray(); if (tmp.length < data.length) { _res.set("Content-Encoding", "gzip"); _res.set("Vary", "Accept-Encoding"); return tmp; } } return data; } private Request _req; private Response _res; } public final class GZipFileResource extends ContentResource { public GZipFileResource(Context context, String target){ super(context, target); } protected void process(Request req, Response resp)throws Exception { if(req.getDate("If-Modified-Since")< getLastModified()){ resp.setDate("Date", System.currentTimeMillis()); resp.setDate("Last-Modified",getLastModified()); resp.set("Content-Type",type); ByteArrayOutputStream bout =3D new ByteArrayOutputStream(); write(bout); GZipEncoder encoder =3D new GZipEncoder(req, resp); byte[] data =3D encoder.encode(bout.toByteArray()); resp.setContentLength(data.length); if (req.getMethod().equals("HEAD")) { resp.commit(); } else if (req.getMethod().equals("GET")) { resp.getOutputStream().write(data, 0, data.length); resp.getOutputStream().close(); } else { handle(req,resp,501); } }else { handle(req,resp,304); } } } /hear's the beegee's On 12/17/05, petite_abeille <pet...@ma...> wrote: > Hello, > > On Dec 14, 2005, at 22:45, Niall Gallagher wrote: > > > Take a look a http://zoe.nu, this uses compression > > with Simple. > > ZO=CB uses a very straightforward approach: > > http://dev.alt.textdrive.com/file/ZOE/Frameworks/SZApp/ > SZContentEncoder.java > > For something slightly more sophisticated (including conditional > responses), take a look at LWResponse:handleContent(): > > http://dev.alt.textdrive.com/file/LW/LWResponse.lua > > > I did implement compression in Simple, I > > was not impressed with the performance results and it > > added complexity I did not need. > > From my personal experience, response compression do make sense when > the network bandwidth is either a bottleneck or a significant monetary > cost of running your application. Or both :) Of course, your mileage > may vary according to your particular circumstances. > > Regarding if this should be supported by an HTTP framework > "out-of-the-box", I would venture that yes, it should :) > > "The third principle is that web.py should, by default, do the right > thing by the Web" [sic] > -- Aaron Swartz, "Rewriting Reddit", December 6 2005 > http://www.aaronsw.com/weblog/rewritingreddit > > As Spike Lee might have said [1], "doing the right thing" would include > handling most, if not all, the drudgery of HTTP mannerisms. > > Cheers > > -- > PA, Onnay Equitursay > http://alt.textdrive.com/ > > [1] http://www.imdb.com/title/tt0097216/ > > > > > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id=16865&opclick > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > |
From: petite_abeille <pet...@ma...> - 2005-12-17 13:27:54
|
Hello, On Dec 14, 2005, at 22:45, Niall Gallagher wrote: > Take a look a http://zoe.nu, this uses compression > with Simple. ZO=CB uses a very straightforward approach: http://dev.alt.textdrive.com/file/ZOE/Frameworks/SZApp/=20 SZContentEncoder.java For something slightly more sophisticated (including conditional =20 responses), take a look at LWResponse:handleContent(): http://dev.alt.textdrive.com/file/LW/LWResponse.lua > I did implement compression in Simple, I > was not impressed with the performance results and it > added complexity I did not need. =46rom my personal experience, response compression do make sense when =20= the network bandwidth is either a bottleneck or a significant monetary =20= cost of running your application. Or both :) Of course, your mileage =20= may vary according to your particular circumstances. Regarding if this should be supported by an HTTP framework =20 "out-of-the-box", I would venture that yes, it should :) "The third principle is that web.py should, by default, do the right =20 thing by the Web" [sic] -- Aaron Swartz, "Rewriting Reddit", December 6 2005 http://www.aaronsw.com/weblog/rewritingreddit As Spike Lee might have said [1], "doing the right thing" would include =20= handling most, if not all, the drudgery of HTTP mannerisms. Cheers -- PA, Onnay Equitursay http://alt.textdrive.com/ [1] http://www.imdb.com/title/tt0097216/ |
From: Brian D. <wic...@gm...> - 2005-12-16 20:45:31
|
Hi I have the following code.. the File dir =3D root.getFile(req.getURI()); li= ne throws a nullpointerexception when the req.getURI() =3D=3D /../../ for example... am i using the api incorrectly? Iterator it =3D _context.getHost(req).roots(); while (it.hasNext()) { FileContext root =3D (FileContext) it.next(); File dir =3D root.getFile(req.getURI()); if (dir.isDirectory() && dir.canRead()) { /cheers! |
From: Kristian R. S. <kri...@ja...> - 2005-12-15 15:00:19
|
LinuxConfigurator: public void configure(Socket sock) throws IOException { if (sock.getSoTimeout() <=3D 0) { sock.setSoTimeout(60000); } =20 sock.setTcpNoDelay(true); sock.setSoLinger(true,5); The standard java memory limitation is used. This is about 128 MB of = RAM.=20 Med venlig hilsen / Best Regards, Kristian Reesen Skouboe Retail Internet A/S Denmark / Europe=20 IT Department Phone: 8734-5774 | Email: kri...@ja... | Skype: atommax http://www.retailinternet.dk http://www.jatak.* > -----Oprindelig meddelelse----- > Fra: sim...@li... [mailto:simpleweb- > sup...@li...] P=E5 vegne af Kristian Reesen = Skouboe > Sendt: 15. december 2005 15:52 > Til: sim...@li... > Emne: SV: [Simpleweb-Support] Scaling Problems with SimpleWeb > Prioritet: H=F8j >=20 > Hi Niall, >=20 > I am using both Java 1.5.0_03 and 1.4.2_09 - both SDK and JRE. Both > versions have the problems. >=20 > > Hi Kristian, > > > > Firstly, are you using Java 1.5 or 1.4? > > > > Also, what is your memory profile like under high > > loads? An OutOfMemoryError can cause services to end > > without closing the connection. >=20 > No Out of memory errors. We use the standard memory limitation. >=20 > > > > The OutOfMemoryError can also cause, on occasion, > > confusion within many data structures both within the > > Simple and Java class libraries. > > > > Have you used Jconsole (using the > > -Dcom.sun.management.jmxremote VM argument) to inspect > > the state of the VM? What is the memory usage like, > > also are there any dead threads (there should be > > none). >=20 > I have sent a SIGQUIT to the process. This gives a dump of the Threads > being in WAIT_STATE. I have attached the Thread Dump to this mail. >=20 > > > > If you are sure it is not an OutOfMemoryError, then I > > will certainly investigate it further. > > > > Thanks for the feedback, I really appreciate it. > > > > Niall >=20 > Hope we will get it to work. You are welcome to ask me other = questions. >=20 > Kristian >=20 > > > > --- Kristian Reesen Skouboe <kri...@ja...> wrote: > > > > > Hello, > > > > > > > > > > > > I have done some scaling tests of SimpleWeb 2.7.4. > > > using a Microsoft Web > > > Application Stress Tool. > > > > > > > > > > > > The OS is Linux 2.4.21-32.ELsmp #1 SMP Fri Apr 15 > > > 21:17:59 EDT 2005 i686 > > > i686 i386 GNU/Linux. 2 CPUs - 3 Ghz and 2 GB of RAM. > > > A Normal HP server. > > > The tests have also been run on two other hardware > > > architectures. > > > > > > > > > > > > The number of connections to SimpleWeb have been set > > > for 4000 > > > simultaneous connections during a test running > > > period of 20 minutes. > > > > > > > > > > > > The connections are being done onto different images > > > that are being > > > served using SimpleWeb and an implementation of the > > > Process method. The > > > Process method reads the images from HashMap using > > > the URL given. > > > > > > > > > > > > Furthermore, I have put in some monitoring of the > > > number of sockets that > > > are being opened and closed when SimpleWeb is > > > running. > > > > > > Both the GranularPoller and the DefaultPoller have > > > been used using both > > > standard and lower timeout rate settings. > > > > > > Furthermore we use the LinuxConfigurator and we have > > > also been using the > > > default configuration. Here is a snapshot of the > > > LinuxConfigurator: > > > > > > xxx > > > > > > > > > > > > > > > > > > The tests have been run multiple times. The results > > > of the tests are > > > that SimpleWeb halts its execution and stops serving > > > images to the Web > > > clients that connect (the Stress Tool). This happens > > > when there are > > > about 500 simultaneous connections have been done to > > > SimpleWeb. > > > Furthermore the number of connections then raises to > > > about 2000 > > > connections, where it stops increasing (max is 4000 > > > connections in > > > Stress Tool). Then when the stress tool is done, the > > > number of > > > connections sometimes decrease to about 500 > > > connections, other times to > > > about 10-20 connections. But it never decreases to 0 > > > connections. > > > > > > > > > > > > When the test is run again, the number of > > > connections arises again, but > > > no requests are being served by SimpleWeb. It only > > > enqueues the > > > requests, it never dequeues them and gives a > > > response back. > > > > > > > > > > > > If the tests are done with lower connections, e.g. > > > 1000 connections for > > > about 3-4 minutes, the SimpleWeb functions fine and > > > serves requests as > > > designed. It never halts. This only happens when the > > > connections are > > > high (4000) connections. > > > > > > > > > > > > After doing some analysis on the java classes, I > > > think I have found four > > > java classes that may be having the problems: > > > > > > - Processor > > > > > > - Scheduler > > > > > > - SchedulerQueue > > > > > > - PriorityQueue > > > > > > > > > > > > The Processor class is opening the sockets and > > > letting the pipeline > > > method execute on the sockets. However the sockets > > > are never really > > > closed (except when GranularPoller closes a pipeline > > > - a socket closes > > > also), and a lot of the sockets convert to "Can't > > > Identify protocols" in > > > Linux, and when the number of sockets are as high as > > > the max number of > > > open file handles in Linux, SimpleWeb cannot serve > > > any more web content > > > (images in this case). The GranularPoller looks like > > > it is working when > > > the number of simultaneous connections are lower > > > than 500 connections. > > > However when the number of connections increases > > > above this to about > > > 1000-2000 connections, the GranularPoller stops > > > closing down > > > connections. > > > > > > > > > > > > The Scheduler class is used for enqueuing and > > > dequeuing objects into a > > > queue. However when SimpleWeb is running under high > > > load, the enqueuing > > > continues to work, but the dequeuing of objects > > > stops working. I have > > > put logging onto the class and dequeueing never > > > happens again when > > > SimpleWeb has been overloaded with requests. > > > > > > > > > > > > The SchedulerQueue class works together with > > > Scheduler class, the > > > dequeuing of objects never happens here either. > > > > > > > > > > > > The PriorityQueue continues to grow with new > > > requests from the Stress > > > Tool, however it is not decreased when SimpleWeb is > > > overloaded. > > > > > > > > > > > > Two Solutions that work currently: > > > > > > I have tried out two solutions that tend to solve > > > the problem, however > > > the solutions are not good, because they kick away > > > users from the > > > webserver. > > > > > > > > > > > > Solution 1: Implementing a monitoring thread that > > > monitors the number of > > > connections open. This is the same as implementing a > > > "Max connections > > > allowed" in SimpleWeb, as many other web servers > > > have. When the number > > > of connections are too high, then we stop serving. > > > This tends to work. > > > > > > > > > > > > Solution 2: Try to notify the Daemons, PriorityQueue > > > and other Threads > > > running, that they need to work. This is done using > > > a "notifyAll" call > > > to the different threads. This tends to kick in the > > > dequeuing of the > > > PriorityQueue, however this it does not work > > > completety. > > > > > > > > > > > > Please help me with deep design details of > > > SimpleWebs different queue > > > structures and how it handles many connections > > > (unlimited?) and sockets > > > and thread locking. There seems to be some problems > > > when running > > > SimpleWeb with high loads. > > > > > > Med venlig hilsen / Best Regards, > > > Kristian Reesen Skouboe > > > Denmark, Europe > > > > > =3D=3D=3D message truncated =3D=3D=3D > > > > > > Niall Gallagher > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam protection around > > http://mail.yahoo.com > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. Do you grep through = log > > files > > for problems? Stop! Download the new AJAX search engine that makes > > searching your log files as easy as surfing the web. DOWNLOAD > SPLUNK! > > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Kristian R. S. <kri...@ja...> - 2005-12-15 14:52:46
|
Hi Niall, I am using both Java 1.5.0_03 and 1.4.2_09 - both SDK and JRE. Both versions have the problems. > Hi Kristian, >=20 > Firstly, are you using Java 1.5 or 1.4? >=20 > Also, what is your memory profile like under high > loads? An OutOfMemoryError can cause services to end > without closing the connection. No Out of memory errors. We use the standard memory limitation.=20 >=20 > The OutOfMemoryError can also cause, on occasion, > confusion within many data structures both within the > Simple and Java class libraries. >=20 > Have you used Jconsole (using the > -Dcom.sun.management.jmxremote VM argument) to inspect > the state of the VM? What is the memory usage like, > also are there any dead threads (there should be > none). I have sent a SIGQUIT to the process. This gives a dump of the Threads being in WAIT_STATE. I have attached the Thread Dump to this mail.=20 >=20 > If you are sure it is not an OutOfMemoryError, then I > will certainly investigate it further. >=20 > Thanks for the feedback, I really appreciate it. >=20 > Niall Hope we will get it to work. You are welcome to ask me other questions.=20 Kristian >=20 > --- Kristian Reesen Skouboe <kri...@ja...> wrote: >=20 > > Hello, > > > > > > > > I have done some scaling tests of SimpleWeb 2.7.4. > > using a Microsoft Web > > Application Stress Tool. > > > > > > > > The OS is Linux 2.4.21-32.ELsmp #1 SMP Fri Apr 15 > > 21:17:59 EDT 2005 i686 > > i686 i386 GNU/Linux. 2 CPUs - 3 Ghz and 2 GB of RAM. > > A Normal HP server. > > The tests have also been run on two other hardware > > architectures. > > > > > > > > The number of connections to SimpleWeb have been set > > for 4000 > > simultaneous connections during a test running > > period of 20 minutes. > > > > > > > > The connections are being done onto different images > > that are being > > served using SimpleWeb and an implementation of the > > Process method. The > > Process method reads the images from HashMap using > > the URL given. > > > > > > > > Furthermore, I have put in some monitoring of the > > number of sockets that > > are being opened and closed when SimpleWeb is > > running. > > > > Both the GranularPoller and the DefaultPoller have > > been used using both > > standard and lower timeout rate settings. > > > > Furthermore we use the LinuxConfigurator and we have > > also been using the > > default configuration. Here is a snapshot of the > > LinuxConfigurator: > > > > xxx > > > > > > > > > > > > The tests have been run multiple times. The results > > of the tests are > > that SimpleWeb halts its execution and stops serving > > images to the Web > > clients that connect (the Stress Tool). This happens > > when there are > > about 500 simultaneous connections have been done to > > SimpleWeb. > > Furthermore the number of connections then raises to > > about 2000 > > connections, where it stops increasing (max is 4000 > > connections in > > Stress Tool). Then when the stress tool is done, the > > number of > > connections sometimes decrease to about 500 > > connections, other times to > > about 10-20 connections. But it never decreases to 0 > > connections. > > > > > > > > When the test is run again, the number of > > connections arises again, but > > no requests are being served by SimpleWeb. It only > > enqueues the > > requests, it never dequeues them and gives a > > response back. > > > > > > > > If the tests are done with lower connections, e.g. > > 1000 connections for > > about 3-4 minutes, the SimpleWeb functions fine and > > serves requests as > > designed. It never halts. This only happens when the > > connections are > > high (4000) connections. > > > > > > > > After doing some analysis on the java classes, I > > think I have found four > > java classes that may be having the problems: > > > > - Processor > > > > - Scheduler > > > > - SchedulerQueue > > > > - PriorityQueue > > > > > > > > The Processor class is opening the sockets and > > letting the pipeline > > method execute on the sockets. However the sockets > > are never really > > closed (except when GranularPoller closes a pipeline > > - a socket closes > > also), and a lot of the sockets convert to "Can't > > Identify protocols" in > > Linux, and when the number of sockets are as high as > > the max number of > > open file handles in Linux, SimpleWeb cannot serve > > any more web content > > (images in this case). The GranularPoller looks like > > it is working when > > the number of simultaneous connections are lower > > than 500 connections. > > However when the number of connections increases > > above this to about > > 1000-2000 connections, the GranularPoller stops > > closing down > > connections. > > > > > > > > The Scheduler class is used for enqueuing and > > dequeuing objects into a > > queue. However when SimpleWeb is running under high > > load, the enqueuing > > continues to work, but the dequeuing of objects > > stops working. I have > > put logging onto the class and dequeueing never > > happens again when > > SimpleWeb has been overloaded with requests. > > > > > > > > The SchedulerQueue class works together with > > Scheduler class, the > > dequeuing of objects never happens here either. > > > > > > > > The PriorityQueue continues to grow with new > > requests from the Stress > > Tool, however it is not decreased when SimpleWeb is > > overloaded. > > > > > > > > Two Solutions that work currently: > > > > I have tried out two solutions that tend to solve > > the problem, however > > the solutions are not good, because they kick away > > users from the > > webserver. > > > > > > > > Solution 1: Implementing a monitoring thread that > > monitors the number of > > connections open. This is the same as implementing a > > "Max connections > > allowed" in SimpleWeb, as many other web servers > > have. When the number > > of connections are too high, then we stop serving. > > This tends to work. > > > > > > > > Solution 2: Try to notify the Daemons, PriorityQueue > > and other Threads > > running, that they need to work. This is done using > > a "notifyAll" call > > to the different threads. This tends to kick in the > > dequeuing of the > > PriorityQueue, however this it does not work > > completety. > > > > > > > > Please help me with deep design details of > > SimpleWebs different queue > > structures and how it handles many connections > > (unlimited?) and sockets > > and thread locking. There seems to be some problems > > when running > > SimpleWeb with high loads. > > > > Med venlig hilsen / Best Regards, > > Kristian Reesen Skouboe > > Denmark, Europe > > > =3D=3D=3D message truncated =3D=3D=3D >=20 >=20 > Niall Gallagher >=20 > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Niall G. <gal...@ya...> - 2005-12-15 14:37:51
|
Hi Kristian, Firstly, are you using Java 1.5 or 1.4? Also, what is your memory profile like under high loads? An OutOfMemoryError can cause services to end without closing the connection. The OutOfMemoryError can also cause, on occasion, confusion within many data structures both within the Simple and Java class libraries. Have you used Jconsole (using the -Dcom.sun.management.jmxremote VM argument) to inspect the state of the VM? What is the memory usage like, also are there any dead threads (there should be none). If you are sure it is not an OutOfMemoryError, then I will certainly investigate it further. Thanks for the feedback, I really appreciate it. Niall --- Kristian Reesen Skouboe <kri...@ja...> wrote: > Hello, > > > > I have done some scaling tests of SimpleWeb 2.7.4. > using a Microsoft Web > Application Stress Tool. > > > > The OS is Linux 2.4.21-32.ELsmp #1 SMP Fri Apr 15 > 21:17:59 EDT 2005 i686 > i686 i386 GNU/Linux. 2 CPUs - 3 Ghz and 2 GB of RAM. > A Normal HP server. > The tests have also been run on two other hardware > architectures. > > > > The number of connections to SimpleWeb have been set > for 4000 > simultaneous connections during a test running > period of 20 minutes. > > > > The connections are being done onto different images > that are being > served using SimpleWeb and an implementation of the > Process method. The > Process method reads the images from HashMap using > the URL given. > > > > Furthermore, I have put in some monitoring of the > number of sockets that > are being opened and closed when SimpleWeb is > running. > > Both the GranularPoller and the DefaultPoller have > been used using both > standard and lower timeout rate settings. > > Furthermore we use the LinuxConfigurator and we have > also been using the > default configuration. Here is a snapshot of the > LinuxConfigurator: > > xxx > > > > > > The tests have been run multiple times. The results > of the tests are > that SimpleWeb halts its execution and stops serving > images to the Web > clients that connect (the Stress Tool). This happens > when there are > about 500 simultaneous connections have been done to > SimpleWeb. > Furthermore the number of connections then raises to > about 2000 > connections, where it stops increasing (max is 4000 > connections in > Stress Tool). Then when the stress tool is done, the > number of > connections sometimes decrease to about 500 > connections, other times to > about 10-20 connections. But it never decreases to 0 > connections. > > > > When the test is run again, the number of > connections arises again, but > no requests are being served by SimpleWeb. It only > enqueues the > requests, it never dequeues them and gives a > response back. > > > > If the tests are done with lower connections, e.g. > 1000 connections for > about 3-4 minutes, the SimpleWeb functions fine and > serves requests as > designed. It never halts. This only happens when the > connections are > high (4000) connections. > > > > After doing some analysis on the java classes, I > think I have found four > java classes that may be having the problems: > > - Processor > > - Scheduler > > - SchedulerQueue > > - PriorityQueue > > > > The Processor class is opening the sockets and > letting the pipeline > method execute on the sockets. However the sockets > are never really > closed (except when GranularPoller closes a pipeline > - a socket closes > also), and a lot of the sockets convert to "Can't > Identify protocols" in > Linux, and when the number of sockets are as high as > the max number of > open file handles in Linux, SimpleWeb cannot serve > any more web content > (images in this case). The GranularPoller looks like > it is working when > the number of simultaneous connections are lower > than 500 connections. > However when the number of connections increases > above this to about > 1000-2000 connections, the GranularPoller stops > closing down > connections. > > > > The Scheduler class is used for enqueuing and > dequeuing objects into a > queue. However when SimpleWeb is running under high > load, the enqueuing > continues to work, but the dequeuing of objects > stops working. I have > put logging onto the class and dequeueing never > happens again when > SimpleWeb has been overloaded with requests. > > > > The SchedulerQueue class works together with > Scheduler class, the > dequeuing of objects never happens here either. > > > > The PriorityQueue continues to grow with new > requests from the Stress > Tool, however it is not decreased when SimpleWeb is > overloaded. > > > > Two Solutions that work currently: > > I have tried out two solutions that tend to solve > the problem, however > the solutions are not good, because they kick away > users from the > webserver. > > > > Solution 1: Implementing a monitoring thread that > monitors the number of > connections open. This is the same as implementing a > "Max connections > allowed" in SimpleWeb, as many other web servers > have. When the number > of connections are too high, then we stop serving. > This tends to work. > > > > Solution 2: Try to notify the Daemons, PriorityQueue > and other Threads > running, that they need to work. This is done using > a "notifyAll" call > to the different threads. This tends to kick in the > dequeuing of the > PriorityQueue, however this it does not work > completety. > > > > Please help me with deep design details of > SimpleWebs different queue > structures and how it handles many connections > (unlimited?) and sockets > and thread locking. There seems to be some problems > when running > SimpleWeb with high loads. > > Med venlig hilsen / Best Regards, > Kristian Reesen Skouboe > Denmark, Europe > === message truncated === Niall Gallagher __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Kristian R. S. <kri...@ja...> - 2005-12-15 14:11:50
|
Hello,=20 =20 I have done some scaling tests of SimpleWeb 2.7.4. using a Microsoft Web Application Stress Tool.=20 =20 The OS is Linux 2.4.21-32.ELsmp #1 SMP Fri Apr 15 21:17:59 EDT 2005 i686 i686 i386 GNU/Linux. 2 CPUs - 3 Ghz and 2 GB of RAM. A Normal HP server. The tests have also been run on two other hardware architectures.=20 =20 The number of connections to SimpleWeb have been set for 4000 simultaneous connections during a test running period of 20 minutes.=20 =20 The connections are being done onto different images that are being served using SimpleWeb and an implementation of the Process method. The Process method reads the images from HashMap using the URL given.=20 =20 Furthermore, I have put in some monitoring of the number of sockets that are being opened and closed when SimpleWeb is running.=20 Both the GranularPoller and the DefaultPoller have been used using both standard and lower timeout rate settings.=20 Furthermore we use the LinuxConfigurator and we have also been using the default configuration. Here is a snapshot of the LinuxConfigurator: xxx =20 =20 The tests have been run multiple times. The results of the tests are that SimpleWeb halts its execution and stops serving images to the Web clients that connect (the Stress Tool). This happens when there are about 500 simultaneous connections have been done to SimpleWeb. Furthermore the number of connections then raises to about 2000 connections, where it stops increasing (max is 4000 connections in Stress Tool). Then when the stress tool is done, the number of connections sometimes decrease to about 500 connections, other times to about 10-20 connections. But it never decreases to 0 connections.=20 =20 When the test is run again, the number of connections arises again, but no requests are being served by SimpleWeb. It only enqueues the requests, it never dequeues them and gives a response back.=20 =20 If the tests are done with lower connections, e.g. 1000 connections for about 3-4 minutes, the SimpleWeb functions fine and serves requests as designed. It never halts. This only happens when the connections are high (4000) connections.=20 =20 After doing some analysis on the java classes, I think I have found four java classes that may be having the problems: - Processor - Scheduler - SchedulerQueue - PriorityQueue =20 The Processor class is opening the sockets and letting the pipeline method execute on the sockets. However the sockets are never really closed (except when GranularPoller closes a pipeline - a socket closes also), and a lot of the sockets convert to "Can't Identify protocols" in Linux, and when the number of sockets are as high as the max number of open file handles in Linux, SimpleWeb cannot serve any more web content (images in this case). The GranularPoller looks like it is working when the number of simultaneous connections are lower than 500 connections. However when the number of connections increases above this to about 1000-2000 connections, the GranularPoller stops closing down connections.=20 =20 The Scheduler class is used for enqueuing and dequeuing objects into a queue. However when SimpleWeb is running under high load, the enqueuing continues to work, but the dequeuing of objects stops working. I have put logging onto the class and dequeueing never happens again when SimpleWeb has been overloaded with requests.=20 =20 The SchedulerQueue class works together with Scheduler class, the dequeuing of objects never happens here either.=20 =20 The PriorityQueue continues to grow with new requests from the Stress Tool, however it is not decreased when SimpleWeb is overloaded.=20 =20 Two Solutions that work currently: I have tried out two solutions that tend to solve the problem, however the solutions are not good, because they kick away users from the webserver.=20 =20 Solution 1: Implementing a monitoring thread that monitors the number of connections open. This is the same as implementing a "Max connections allowed" in SimpleWeb, as many other web servers have. When the number of connections are too high, then we stop serving. This tends to work.=20 =20 Solution 2: Try to notify the Daemons, PriorityQueue and other Threads running, that they need to work. This is done using a "notifyAll" call to the different threads. This tends to kick in the dequeuing of the PriorityQueue, however this it does not work completety.=20 =20 Please help me with deep design details of SimpleWebs different queue structures and how it handles many connections (unlimited?) and sockets and thread locking. There seems to be some problems when running SimpleWeb with high loads. Med venlig hilsen / Best Regards, Kristian Reesen Skouboe Denmark, Europe =20 |
From: M <me...@bi...> - 2005-12-14 22:18:03
|
hello simpleweb-support ----------------------------- i have recieved vol 1 #121 - 3 msg and i am not sure if the subject explained is something i am interested in: create a zip file with ".zip" java routines "on the fly" from a url/uri pointer. at the "end" of pointer can be .html files or .gif or .jpg but the idea is that ".zip" java routines "don't care" what url/uri is pointing at and simply adds the file to the .zip archive. from the message/mail i got i could not figure if this is the problem the demo is solving? (there should be a change of the "look" part of this mail-list - it is hard to understand from the demo/question/answer what is the problem and how it is solved) thank you meir abramson me...@bi... |
From: Niall G. <gal...@ya...> - 2005-12-14 21:45:58
|
Hi Brian, Take a look a http://zoe.nu, this uses compression with Simple. I did implement compression in Simple, I was not impressed with the performance results and it added complexity I did not need. Also, compression is not always best implemented in the Response object. I am unsure how you are serving content. However encoding in a cache, or file system interface is a good solution. For example: public class GzipContent implements Content { public GzipContent(SomeSource source) { // set up your source } public void write(OutputStream out) { compressedBytes = // get from cache or dynamic source out.write(compressedBytes); } public String getMimeType() { return "text/html; charset=utf-8" } public String getEncoding() { return "gzip"; } } This allows you to use the object to transfer info and meta-data easily, also it gives you more choice in what gets compressed. Niall --- Brian Davis <wic...@gm...> wrote: > Hmm... can't seem to get this to work.. > > also a couple things bother me... first.. in order > to do it this way I > won't be able to set the content-length because > whatever i set would > be wrong.. also.. compression should be handled at > the framework level > if possible.. so.. I was really just wondering why > it wasn't > supported... out of the box per-se > > anyway.. thanks for the help! > > /Brian > > On 12/13/05, Brian Davis <wic...@gm...> > wrote: > > Hey cool.. I will look at this in a day or two and > let you know how it > > goes.. did you guys do anything with deflate or > just gzip? > > > > /Brian > > > > > > On 12/13/05, Christophe Roudet > <cr...@ac...> wrote: > > > I have done this with a custom ProtocolHandler: > > > > > > public class ServerHandler implements > ProtocolHandler { > > > private ProtocolHandler _handler; > > > private static final Logger _logger = > > > Logger.getLogger(ServerHandler.class); > > > > > > // ============= > > > // Constructor > > > // ============= > > > > > > public ServerHandler(ProtocolHandler handler) > { > > > _handler = handler; > > > } > > > > > > // =============== > > > // Public methods > > > // =============== > > > > > > public void handle(Request req, Response resp) > { > > > resp.set("Server", "Simple"); > > > resp.setDate("Date", > System.currentTimeMillis()); > > > // check for compressed request > > > String contentEncoding = > req.getValue("Content-Encoding"); > > > if ((contentEncoding != null) > > > && > (contentEncoding.toLowerCase().indexOf("gzip") > > -1)) { > > > _logger.debug("Request is zipped."); > > > req = new GZipRequest(req, > SimpleWeb.BUFFER_SIZE); > > > } > > > // does the client accept compressed > response? > > > String acceptEncoding = > req.getValue("Accept-Encoding"); > > > if ((!"GET".equals(req.getMethod())) && > (acceptEncoding != null) > > > && > (acceptEncoding.toLowerCase().indexOf("gzip") > -1)) > { > > > _logger.debug("Response will be zipped."); > > > resp = new GZipResponse(resp); > > > } > > > /* > > > * Hand the request over to the real server > so that targeted service can > > > be > > > * executed. > > > */ > > > _handler.handle(req, resp); > > > } > > > } > > > > > > -------------------- > > > And the GZipRequest and GZipResponse are mainly > a wrapper on a request where > > > stream getter methods return a GZIP stream: > > > > > > > > > public class GZipRequest implements Request { > //extends FilterRequest { > > > private int _size; > > > private Request _req; > > > > > > // ============= > > > // Constructor > > > // ============= > > > > > > /** > > > * Wraps the specified request stream into a > GZipStream. > > > */ > > > public GZipRequest(Request request, int size) > { > > > //super(request); > > > _req = request; > > > if (size <=0) { > > > _size = 2048; > > > } else { > > > _size = size; > > > } > > > } > > > > > > // =============== > > > // Public methods > > > // =============== > > > > > > /** > > > * Returns a GZIPInputStream. > > > */ > > > public InputStream getInputStream() throws > IOException { > > > return new > GZIPInputStream(_req.getInputStream(), _size); > > > } > > > > > > /** > > > * This can be used to get the URI specified > for this HTTP > > > * request. This corresponds to the /index > part of a > > > * http://www.domain.com/index URL but may > contain the full > > > * URL. This can be set using > <code>setURI</code>. > > > * > > > * @return the URI that this HTTP request is > targeting > > > */ > > > public String getURI(){ > > > return _req.getURI(); > > > } > > > > > > /** > > > * This can be used to set the URI for this > HTTP request. > > > * The <code>getURI</code> will return the > String entered > > > * which can be a full HTTP URL or a relative > path URL. > > > * > > > * @param uri the URI that this HTTP request > is to use > > > */ > > > public void setURI(String uri){ > > > _req.setURI(uri); > > > } > > > > > > /** > > > * This can be used to get the HTTP method for > this > > > * request. The HTTP specification RFC 2616 > specifies the > > > * HTTP request methods in section 9, Method > Definitions. > > > * > > > * @return the request method for this request > > > */ > > > public String getMethod(){ > > > return _req.getMethod(); > > > } > > > > > > ... > > > > > > ------------------ > > > > > > public class GZipResponse implements Response { > //extends FilterResponse { > > > private Response _resp; > > > > > > // ============= > > > // Constructors > > > // ============= > > > > > > /** > > > * Creates a GZipResponse for the specified > Response. > > > */ > > > public GZipResponse(Response response) { > > > //super(response); > > > _resp = response; > > > _resp.set("Content-Encoding", "gzip"); > > > } > > > > > > // ============== > > > // Public methods > > > // =============== > === message truncated === Niall Gallagher __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Brian D. <wic...@gm...> - 2005-12-14 19:51:27
|
Hmm... can't seem to get this to work.. also a couple things bother me... first.. in order to do it this way I won't be able to set the content-length because whatever i set would be wrong.. also.. compression should be handled at the framework level if possible.. so.. I was really just wondering why it wasn't supported... out of the box per-se anyway.. thanks for the help! /Brian On 12/13/05, Brian Davis <wic...@gm...> wrote: > Hey cool.. I will look at this in a day or two and let you know how it > goes.. did you guys do anything with deflate or just gzip? > > /Brian > > > On 12/13/05, Christophe Roudet <cr...@ac...> wrote: > > I have done this with a custom ProtocolHandler: > > > > public class ServerHandler implements ProtocolHandler { > > private ProtocolHandler _handler; > > private static final Logger _logger =3D > > Logger.getLogger(ServerHandler.class); > > > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > // Constructor > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > public ServerHandler(ProtocolHandler handler) { > > _handler =3D handler; > > } > > > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > // Public methods > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > public void handle(Request req, Response resp) { > > resp.set("Server", "Simple"); > > resp.setDate("Date", System.currentTimeMillis()); > > // check for compressed request > > String contentEncoding =3D req.getValue("Content-Encoding"); > > if ((contentEncoding !=3D null) > > && (contentEncoding.toLowerCase().indexOf("gzip") > -1)) { > > _logger.debug("Request is zipped."); > > req =3D new GZipRequest(req, SimpleWeb.BUFFER_SIZE); > > } > > // does the client accept compressed response? > > String acceptEncoding =3D req.getValue("Accept-Encoding"); > > if ((!"GET".equals(req.getMethod())) && (acceptEncoding !=3D null) > > && (acceptEncoding.toLowerCase().indexOf("gzip") > -1)) { > > _logger.debug("Response will be zipped."); > > resp =3D new GZipResponse(resp); > > } > > /* > > * Hand the request over to the real server so that targeted servic= e can > > be > > * executed. > > */ > > _handler.handle(req, resp); > > } > > } > > > > -------------------- > > And the GZipRequest and GZipResponse are mainly a wrapper on a request = where > > stream getter methods return a GZIP stream: > > > > > > public class GZipRequest implements Request { //extends FilterRequest { > > private int _size; > > private Request _req; > > > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > // Constructor > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > /** > > * Wraps the specified request stream into a GZipStream. > > */ > > public GZipRequest(Request request, int size) { > > //super(request); > > _req =3D request; > > if (size <=3D0) { > > _size =3D 2048; > > } else { > > _size =3D size; > > } > > } > > > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > // Public methods > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > /** > > * Returns a GZIPInputStream. > > */ > > public InputStream getInputStream() throws IOException { > > return new GZIPInputStream(_req.getInputStream(), _size); > > } > > > > /** > > * This can be used to get the URI specified for this HTTP > > * request. This corresponds to the /index part of a > > * http://www.domain.com/index URL but may contain the full > > * URL. This can be set using <code>setURI</code>. > > * > > * @return the URI that this HTTP request is targeting > > */ > > public String getURI(){ > > return _req.getURI(); > > } > > > > /** > > * This can be used to set the URI for this HTTP request. > > * The <code>getURI</code> will return the String entered > > * which can be a full HTTP URL or a relative path URL. > > * > > * @param uri the URI that this HTTP request is to use > > */ > > public void setURI(String uri){ > > _req.setURI(uri); > > } > > > > /** > > * This can be used to get the HTTP method for this > > * request. The HTTP specification RFC 2616 specifies the > > * HTTP request methods in section 9, Method Definitions. > > * > > * @return the request method for this request > > */ > > public String getMethod(){ > > return _req.getMethod(); > > } > > > > ... > > > > ------------------ > > > > public class GZipResponse implements Response { //extends FilterRespons= e { > > private Response _resp; > > > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > // Constructors > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > /** > > * Creates a GZipResponse for the specified Response. > > */ > > public GZipResponse(Response response) { > > //super(response); > > _resp =3D response; > > _resp.set("Content-Encoding", "gzip"); > > } > > > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > // Public methods > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > /** > > * Returns a GZIPOutputStream. > > * @see simple.http.Response#getOutputStream() > > */ > > public OutputStream getOutputStream() throws IOException { > > return new GZIPOutputStream(_resp.getOutputStream()); > > } > > > > /** > > * Returns a GZIPOutputStream. > > * @see simple.http.Response#getOutputStream(int) > > */ > > public OutputStream getOutputStream(int size) throws IOException { > > return new GZIPOutputStream(_resp.getOutputStream(size), size); > > } > > > > /** > > * Returns a GZIPOutputStream wrapped into a PrintStream. > > * @see simple.http.Response#getPrintStream() > > */ > > public PrintStream getPrintStream() throws IOException { > > return getPrintStream(); > > } > > > > /** > > * Returns a GZIPOutputStream wrapped into a PrintStream. > > * @see simple.http.Response#getPrintStream(int) > > */ > > public PrintStream getPrintStream(int size) throws IOException { > > return new PrintStream(getOutputStream(size), false); > > } > > > > /** > > * This represents the status code of the HTTP response. The HTTP > > * response code represents the type of message that is being sent > > * to the client. For a description of the codes see RFC 2616 > > * section 10, Status Code Definitions. > > * > > * @return the status code that this HTTP response has > > */ > > public int getCode(){ > > return _resp.getCode(); > > } > > > > /** > > * This method allows the status for the response to be changed. > > * This must be reflected the the response content given to the > > * client. For a description of the codes see RFC 2616 section > > * 10, Status Code Definitions. > > * > > * @param code the new status code for the HTTP response > > */ > > public void setCode(int code){ > > _resp.setCode(code); > > } > > > > .... > > > > Christophe > > > -----Original Message----- > > > From: sim...@li... [mailto:simpleweb= - > > > sup...@li...] On Behalf Of Brian Davis > > > Sent: Tuesday, December 13, 2005 10:20 AM > > > To: sim...@li... > > > Subject: [Simpleweb-Support] HTTP Compression > > > > > > Is there any plans to support gzip or deflate.. or is it there and I > > > am not finding it.. also.. if not why? and.. if not.. any recommends > > > on where to add it.. > > > > > > thanks! > > > > > > Brian > > > > > > > > > ------------------------------------------------------- > > > This SF.net email is sponsored by: Splunk Inc. Do you grep through lo= g > > > files > > > for problems? Stop! Download the new AJAX search engine that makes > > > searching your log files as easy as surfing the web. DOWNLOAD SPLUN= K! > > > http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dick > > > _______________________________________________ > > > Simpleweb-Support mailing list > > > Sim...@li... > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. Do you grep through log = files > > for problems? Stop! Download the new AJAX search engine that makes > > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > > http://ads.osdn.com/?ad_idv37&alloc_id=16865&opclick > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > |
From: Brian D. <wic...@gm...> - 2005-12-13 20:21:26
|
Hey cool.. I will look at this in a day or two and let you know how it goes.. did you guys do anything with deflate or just gzip? /Brian On 12/13/05, Christophe Roudet <cr...@ac...> wrote: > I have done this with a custom ProtocolHandler: > > public class ServerHandler implements ProtocolHandler { > private ProtocolHandler _handler; > private static final Logger _logger =3D > Logger.getLogger(ServerHandler.class); > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > // Constructor > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > public ServerHandler(ProtocolHandler handler) { > _handler =3D handler; > } > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > // Public methods > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > public void handle(Request req, Response resp) { > resp.set("Server", "Simple"); > resp.setDate("Date", System.currentTimeMillis()); > // check for compressed request > String contentEncoding =3D req.getValue("Content-Encoding"); > if ((contentEncoding !=3D null) > && (contentEncoding.toLowerCase().indexOf("gzip") > -1)) { > _logger.debug("Request is zipped."); > req =3D new GZipRequest(req, SimpleWeb.BUFFER_SIZE); > } > // does the client accept compressed response? > String acceptEncoding =3D req.getValue("Accept-Encoding"); > if ((!"GET".equals(req.getMethod())) && (acceptEncoding !=3D null) > && (acceptEncoding.toLowerCase().indexOf("gzip") > -1)) { > _logger.debug("Response will be zipped."); > resp =3D new GZipResponse(resp); > } > /* > * Hand the request over to the real server so that targeted service = can > be > * executed. > */ > _handler.handle(req, resp); > } > } > > -------------------- > And the GZipRequest and GZipResponse are mainly a wrapper on a request wh= ere > stream getter methods return a GZIP stream: > > > public class GZipRequest implements Request { //extends FilterRequest { > private int _size; > private Request _req; > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > // Constructor > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > /** > * Wraps the specified request stream into a GZipStream. > */ > public GZipRequest(Request request, int size) { > //super(request); > _req =3D request; > if (size <=3D0) { > _size =3D 2048; > } else { > _size =3D size; > } > } > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > // Public methods > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > /** > * Returns a GZIPInputStream. > */ > public InputStream getInputStream() throws IOException { > return new GZIPInputStream(_req.getInputStream(), _size); > } > > /** > * This can be used to get the URI specified for this HTTP > * request. This corresponds to the /index part of a > * http://www.domain.com/index URL but may contain the full > * URL. This can be set using <code>setURI</code>. > * > * @return the URI that this HTTP request is targeting > */ > public String getURI(){ > return _req.getURI(); > } > > /** > * This can be used to set the URI for this HTTP request. > * The <code>getURI</code> will return the String entered > * which can be a full HTTP URL or a relative path URL. > * > * @param uri the URI that this HTTP request is to use > */ > public void setURI(String uri){ > _req.setURI(uri); > } > > /** > * This can be used to get the HTTP method for this > * request. The HTTP specification RFC 2616 specifies the > * HTTP request methods in section 9, Method Definitions. > * > * @return the request method for this request > */ > public String getMethod(){ > return _req.getMethod(); > } > > ... > > ------------------ > > public class GZipResponse implements Response { //extends FilterResponse = { > private Response _resp; > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > // Constructors > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > /** > * Creates a GZipResponse for the specified Response. > */ > public GZipResponse(Response response) { > //super(response); > _resp =3D response; > _resp.set("Content-Encoding", "gzip"); > } > > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > // Public methods > // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > /** > * Returns a GZIPOutputStream. > * @see simple.http.Response#getOutputStream() > */ > public OutputStream getOutputStream() throws IOException { > return new GZIPOutputStream(_resp.getOutputStream()); > } > > /** > * Returns a GZIPOutputStream. > * @see simple.http.Response#getOutputStream(int) > */ > public OutputStream getOutputStream(int size) throws IOException { > return new GZIPOutputStream(_resp.getOutputStream(size), size); > } > > /** > * Returns a GZIPOutputStream wrapped into a PrintStream. > * @see simple.http.Response#getPrintStream() > */ > public PrintStream getPrintStream() throws IOException { > return getPrintStream(); > } > > /** > * Returns a GZIPOutputStream wrapped into a PrintStream. > * @see simple.http.Response#getPrintStream(int) > */ > public PrintStream getPrintStream(int size) throws IOException { > return new PrintStream(getOutputStream(size), false); > } > > /** > * This represents the status code of the HTTP response. The HTTP > * response code represents the type of message that is being sent > * to the client. For a description of the codes see RFC 2616 > * section 10, Status Code Definitions. > * > * @return the status code that this HTTP response has > */ > public int getCode(){ > return _resp.getCode(); > } > > /** > * This method allows the status for the response to be changed. > * This must be reflected the the response content given to the > * client. For a description of the codes see RFC 2616 section > * 10, Status Code Definitions. > * > * @param code the new status code for the HTTP response > */ > public void setCode(int code){ > _resp.setCode(code); > } > > .... > > Christophe > > -----Original Message----- > > From: sim...@li... [mailto:simpleweb- > > sup...@li...] On Behalf Of Brian Davis > > Sent: Tuesday, December 13, 2005 10:20 AM > > To: sim...@li... > > Subject: [Simpleweb-Support] HTTP Compression > > > > Is there any plans to support gzip or deflate.. or is it there and I > > am not finding it.. also.. if not why? and.. if not.. any recommends > > on where to add it.. > > > > thanks! > > > > Brian > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > > files > > for problems? Stop! Download the new AJAX search engine that makes > > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > > http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dick > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id=16865&opclick > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > |
From: Christophe R. <cr...@ac...> - 2005-12-13 18:14:51
|
I have done this with a custom ProtocolHandler: public class ServerHandler implements ProtocolHandler { private ProtocolHandler _handler; private static final Logger _logger =3D Logger.getLogger(ServerHandler.class); =20 // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D // Constructor // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D public ServerHandler(ProtocolHandler handler) { _handler =3D handler; } // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D // Public methods // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D public void handle(Request req, Response resp) { resp.set("Server", "Simple"); resp.setDate("Date", System.currentTimeMillis()); // check for compressed request String contentEncoding =3D req.getValue("Content-Encoding"); if ((contentEncoding !=3D null) && (contentEncoding.toLowerCase().indexOf("gzip") > -1)) { _logger.debug("Request is zipped."); req =3D new GZipRequest(req, SimpleWeb.BUFFER_SIZE); } // does the client accept compressed response? String acceptEncoding =3D req.getValue("Accept-Encoding"); if ((!"GET".equals(req.getMethod())) && (acceptEncoding !=3D null) && (acceptEncoding.toLowerCase().indexOf("gzip") > -1)) { _logger.debug("Response will be zipped."); resp =3D new GZipResponse(resp); } /* * Hand the request over to the real server so that targeted service = can be * executed. */ _handler.handle(req, resp); } } -------------------- And the GZipRequest and GZipResponse are mainly a wrapper on a request = where stream getter methods return a GZIP stream: public class GZipRequest implements Request { //extends FilterRequest { private int _size; private Request _req; =20 // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D // Constructor // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 /** * Wraps the specified request stream into a GZipStream. */ public GZipRequest(Request request, int size) { //super(request); _req =3D request; if (size <=3D0) { _size =3D 2048; } else { _size =3D size; } } // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D // Public methods // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 /** * Returns a GZIPInputStream. */ public InputStream getInputStream() throws IOException { return new GZIPInputStream(_req.getInputStream(), _size); } =20 /** * This can be used to get the URI specified for this HTTP * request. This corresponds to the /index part of a=20 * http://www.domain.com/index URL but may contain the full * URL. This can be set using <code>setURI</code>. * * @return the URI that this HTTP request is targeting */=20 public String getURI(){ return _req.getURI(); } /** * This can be used to set the URI for this HTTP request. * The <code>getURI</code> will return the String entered * which can be a full HTTP URL or a relative path URL. * * @param uri the URI that this HTTP request is to use */ =20 public void setURI(String uri){ _req.setURI(uri); } /** * This can be used to get the HTTP method for this * request. The HTTP specification RFC 2616 specifies the * HTTP request methods in section 9, Method Definitions. * * @return the request method for this request */=20 public String getMethod(){ return _req.getMethod(); } ... ------------------ public class GZipResponse implements Response { //extends FilterResponse = { private Response _resp; =20 // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D // Constructors // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D /** * Creates a GZipResponse for the specified Response. */ public GZipResponse(Response response) { //super(response); _resp =3D response; _resp.set("Content-Encoding", "gzip"); } // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D // Public methods // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D /** * Returns a GZIPOutputStream. * @see simple.http.Response#getOutputStream() */ public OutputStream getOutputStream() throws IOException { return new GZIPOutputStream(_resp.getOutputStream()); } /** * Returns a GZIPOutputStream. * @see simple.http.Response#getOutputStream(int) */ public OutputStream getOutputStream(int size) throws IOException { return new GZIPOutputStream(_resp.getOutputStream(size), size); } /** * Returns a GZIPOutputStream wrapped into a PrintStream. * @see simple.http.Response#getPrintStream() */ public PrintStream getPrintStream() throws IOException { return getPrintStream(); } /** * Returns a GZIPOutputStream wrapped into a PrintStream. * @see simple.http.Response#getPrintStream(int) */ public PrintStream getPrintStream(int size) throws IOException { return new PrintStream(getOutputStream(size), false); } /** * This represents the status code of the HTTP response. The HTTP * response code represents the type of message that is being sent * to the client. For a description of the codes see RFC 2616=20 * section 10, Status Code Definitions.=20 * * @return the status code that this HTTP response has */=20 public int getCode(){ return _resp.getCode(); } =20 /** * This method allows the status for the response to be changed.=20 * This must be reflected the the response content given to the=20 * client. For a description of the codes see RFC 2616 section=20 * 10, Status Code Definitions. * * @param code the new status code for the HTTP response */=20 public void setCode(int code){ _resp.setCode(code); } .... Christophe > -----Original Message----- > From: sim...@li... [mailto:simpleweb- > sup...@li...] On Behalf Of Brian Davis > Sent: Tuesday, December 13, 2005 10:20 AM > To: sim...@li... > Subject: [Simpleweb-Support] HTTP Compression >=20 > Is there any plans to support gzip or deflate.. or is it there and I > am not finding it.. also.. if not why? and.. if not.. any recommends > on where to add it.. >=20 > thanks! >=20 > Brian >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD = SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dick > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Brian D. <wic...@gm...> - 2005-12-13 15:19:58
|
Is there any plans to support gzip or deflate.. or is it there and I am not finding it.. also.. if not why? and.. if not.. any recommends on where to add it.. thanks! Brian |
From: Brian D. <wic...@gm...> - 2005-12-13 00:01:50
|
Hey hey.. making both those changes to the code works great.. included is the coverage report for that class.. Thanks! On 12/12/05, Niall Gallagher <gal...@ya...> wrote: > Hi Brian, > > I have been testing this also. Does this have any ill > effects? I have tested this on Linux and Windows and > there are no problems? It works fine for both 1.4 and > 1.5? Is this causing problems for you? I have noticed > a rather large performance increase for Linux and > Windows using the new PollerInputStream. If this is > causing problems you can avoid blocking by changing > line 175 from > > peek(); --> peek(1); > > And change line 105 from > > this.sock =3D sock; --> this.sock =3D pipe.sock; > > Niall > > > --- Brian Davis <wic...@gm...> wrote: > > > Also happens on the following environment. > > > > Current Time is Mon Dec 12 15:57:37 CST 2005 > > Server is running at 127.0.0.1 port 2000 > > Java Version : 1.5.0_05 > > Java Vendor : Apple Computer, Inc. > > > > This affects the following classes: > > > > PollerInputStream > > Poller > > BasicPoller > > > > Thanks! > > > > > > > > On 12/12/05, Brian Davis <wic...@gm...> > > wrote: > > > Java(TM) 2 Runtime Environment, Standard Edition > > (build 1.4.2_09-232) > > > Java HotSpot(TM) Client VM (build 1.4.2-54, mixed > > mode) > > > > > > > > > On 12/12/05, Niall Gallagher > > <gal...@ya...> wrote: > > > > Hi Brian, > > > > > > > > Thanks for this, ill check this out. I assume > > that you > > > > are using Java 1.4? > > > > > > > > Niall > > > > > > > > --- Brian Davis <wic...@gm...> wrote: > > > > > > > > > When upgrading from 2.7.2 to 2.7.3 the new > > > > > PollerInputStream breaks > > > > > the regression tests in such a way that > > reading > > > > > multiple requests > > > > > blocks until the configurator times out. > > > > > > > > > > The problem was fixed by going back to the old > > > > > PollerInputStream that > > > > > is based upon the PushBackInputStream > > > > > > > > > > test below: > > > > > > > > > > public void test1325() throws Exception > > > > > { > > > > > File dir =3D new File("test/carol"); > > > > > > > > > > File[] list =3D dir.listFiles(); > > > > > > > > > > for (int i =3D 0; i < list.length; i++) > > > > > { > > > > > File tmp =3D list[i]; > > > > > > > > > > String path =3D > > tmp.getAbsolutePath(); > > > > > > > > > > int x =3D path.lastIndexOf('/'); > > > > > > > > > > if (x !=3D -1) > > > > > { > > > > > path =3D path.substring(x+1); > > > > > } > > > > > > > > > > HttpConfiguration config =3D new > > > > > HttpConfiguration(); > > > > > > > > > > config.setRequest("GET", > > > > > "http://127.0.0.1:2000/carol/" + path); > > > > > > > > > > Client http =3D new Client(); > > > > > > > > > > http.open(config); > > > > > http.send(); > > > > > > > > > > > > Assert.assertTrue(http.getStatusCode() > > > > > =3D=3D 200); > > > > > } > > > > > } > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > This SF.net email is sponsored by: Splunk Inc. > > Do > > > > > you grep through log files > > > > > for problems? Stop! Download the new AJAX > > search > > > > > engine that makes > > > > > searching your log files as easy as surfing > > the > > > > > web. DOWNLOAD SPLUNK! > > > > > > > http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dclick > > > > > > > _______________________________________________ > > > > > Simpleweb-Support mailing list > > > > > Sim...@li... > > > > > > > > > > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > > > > > > > > > Niall Gallagher > > > > > > > > > > __________________________________________________ > > > > Do You Yahoo!? > > > > Tired of spam? Yahoo! Mail has the best spam > > protection around > > > > http://mail.yahoo.com > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This SF.net email is sponsored by: Splunk Inc. > > Do you grep through log files > > > > for problems? Stop! Download the new AJAX > > search engine that makes > > > > searching your log files as easy as surfing the > > web. DOWNLOAD SPLUNK! > > > > > > > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > > > > _______________________________________________ > > > > Simpleweb-Support mailing list > > > > Sim...@li... > > > > > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > > > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. Do > > you grep through log files > > for problems? Stop! Download the new AJAX search > > engine that makes > > searching your log files as easy as surfing the > > web. DOWNLOAD SPLUNK! > > http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dclick > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > Niall Gallagher > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > |
From: Niall G. <gal...@ya...> - 2005-12-12 22:29:16
|
Hi Brian, I have been testing this also. Does this have any ill effects? I have tested this on Linux and Windows and there are no problems? It works fine for both 1.4 and 1.5? Is this causing problems for you? I have noticed a rather large performance increase for Linux and Windows using the new PollerInputStream. If this is causing problems you can avoid blocking by changing line 175 from peek(); --> peek(1); And change line 105 from this.sock = sock; --> this.sock = pipe.sock; Niall --- Brian Davis <wic...@gm...> wrote: > Also happens on the following environment. > > Current Time is Mon Dec 12 15:57:37 CST 2005 > Server is running at 127.0.0.1 port 2000 > Java Version : 1.5.0_05 > Java Vendor : Apple Computer, Inc. > > This affects the following classes: > > PollerInputStream > Poller > BasicPoller > > Thanks! > > > > On 12/12/05, Brian Davis <wic...@gm...> > wrote: > > Java(TM) 2 Runtime Environment, Standard Edition > (build 1.4.2_09-232) > > Java HotSpot(TM) Client VM (build 1.4.2-54, mixed > mode) > > > > > > On 12/12/05, Niall Gallagher > <gal...@ya...> wrote: > > > Hi Brian, > > > > > > Thanks for this, ill check this out. I assume > that you > > > are using Java 1.4? > > > > > > Niall > > > > > > --- Brian Davis <wic...@gm...> wrote: > > > > > > > When upgrading from 2.7.2 to 2.7.3 the new > > > > PollerInputStream breaks > > > > the regression tests in such a way that > reading > > > > multiple requests > > > > blocks until the configurator times out. > > > > > > > > The problem was fixed by going back to the old > > > > PollerInputStream that > > > > is based upon the PushBackInputStream > > > > > > > > test below: > > > > > > > > public void test1325() throws Exception > > > > { > > > > File dir = new File("test/carol"); > > > > > > > > File[] list = dir.listFiles(); > > > > > > > > for (int i = 0; i < list.length; i++) > > > > { > > > > File tmp = list[i]; > > > > > > > > String path = > tmp.getAbsolutePath(); > > > > > > > > int x = path.lastIndexOf('/'); > > > > > > > > if (x != -1) > > > > { > > > > path = path.substring(x+1); > > > > } > > > > > > > > HttpConfiguration config = new > > > > HttpConfiguration(); > > > > > > > > config.setRequest("GET", > > > > "http://127.0.0.1:2000/carol/" + path); > > > > > > > > Client http = new Client(); > > > > > > > > http.open(config); > > > > http.send(); > > > > > > > > > Assert.assertTrue(http.getStatusCode() > > > > == 200); > > > > } > > > > } > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This SF.net email is sponsored by: Splunk Inc. > Do > > > > you grep through log files > > > > for problems? Stop! Download the new AJAX > search > > > > engine that makes > > > > searching your log files as easy as surfing > the > > > > web. DOWNLOAD SPLUNK! > > > > > http://ads.osdn.com/?ad_idv37&alloc_id865&op=click > > > > > _______________________________________________ > > > > Simpleweb-Support mailing list > > > > Sim...@li... > > > > > > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > > > > > > Niall Gallagher > > > > > > > __________________________________________________ > > > Do You Yahoo!? > > > Tired of spam? Yahoo! Mail has the best spam > protection around > > > http://mail.yahoo.com > > > > > > > > > > ------------------------------------------------------- > > > This SF.net email is sponsored by: Splunk Inc. > Do you grep through log files > > > for problems? Stop! Download the new AJAX > search engine that makes > > > searching your log files as easy as surfing the > web. DOWNLOAD SPLUNK! > > > > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > > > _______________________________________________ > > > Simpleweb-Support mailing list > > > Sim...@li... > > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do > you grep through log files > for problems? Stop! Download the new AJAX search > engine that makes > searching your log files as easy as surfing the > web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id865&op=click > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > Niall Gallagher __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Brian D. <wic...@gm...> - 2005-12-12 22:04:44
|
Also happens on the following environment. Current Time is Mon Dec 12 15:57:37 CST 2005 Server is running at 127.0.0.1 port 2000 Java Version : 1.5.0_05 Java Vendor : Apple Computer, Inc. This affects the following classes: PollerInputStream Poller BasicPoller Thanks! On 12/12/05, Brian Davis <wic...@gm...> wrote: > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-232) > Java HotSpot(TM) Client VM (build 1.4.2-54, mixed mode) > > > On 12/12/05, Niall Gallagher <gal...@ya...> wrote: > > Hi Brian, > > > > Thanks for this, ill check this out. I assume that you > > are using Java 1.4? > > > > Niall > > > > --- Brian Davis <wic...@gm...> wrote: > > > > > When upgrading from 2.7.2 to 2.7.3 the new > > > PollerInputStream breaks > > > the regression tests in such a way that reading > > > multiple requests > > > blocks until the configurator times out. > > > > > > The problem was fixed by going back to the old > > > PollerInputStream that > > > is based upon the PushBackInputStream > > > > > > test below: > > > > > > public void test1325() throws Exception > > > { > > > File dir =3D new File("test/carol"); > > > > > > File[] list =3D dir.listFiles(); > > > > > > for (int i =3D 0; i < list.length; i++) > > > { > > > File tmp =3D list[i]; > > > > > > String path =3D tmp.getAbsolutePath(); > > > > > > int x =3D path.lastIndexOf('/'); > > > > > > if (x !=3D -1) > > > { > > > path =3D path.substring(x+1); > > > } > > > > > > HttpConfiguration config =3D new > > > HttpConfiguration(); > > > > > > config.setRequest("GET", > > > "http://127.0.0.1:2000/carol/" + path); > > > > > > Client http =3D new Client(); > > > > > > http.open(config); > > > http.send(); > > > > > > Assert.assertTrue(http.getStatusCode() > > > =3D=3D 200); > > > } > > > } > > > > > > > > > > > ------------------------------------------------------- > > > This SF.net email is sponsored by: Splunk Inc. Do > > > you grep through log files > > > for problems? Stop! Download the new AJAX search > > > engine that makes > > > searching your log files as easy as surfing the > > > web. DOWNLOAD SPLUNK! > > > http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dclick > > > _______________________________________________ > > > Simpleweb-Support mailing list > > > Sim...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > > > Niall Gallagher > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam protection around > > http://mail.yahoo.com > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. Do you grep through log = files > > for problems? Stop! Download the new AJAX search engine that makes > > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > |
From: Brian D. <wic...@gm...> - 2005-12-12 17:02:05
|
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-232) Java HotSpot(TM) Client VM (build 1.4.2-54, mixed mode) On 12/12/05, Niall Gallagher <gal...@ya...> wrote: > Hi Brian, > > Thanks for this, ill check this out. I assume that you > are using Java 1.4? > > Niall > > --- Brian Davis <wic...@gm...> wrote: > > > When upgrading from 2.7.2 to 2.7.3 the new > > PollerInputStream breaks > > the regression tests in such a way that reading > > multiple requests > > blocks until the configurator times out. > > > > The problem was fixed by going back to the old > > PollerInputStream that > > is based upon the PushBackInputStream > > > > test below: > > > > public void test1325() throws Exception > > { > > File dir =3D new File("test/carol"); > > > > File[] list =3D dir.listFiles(); > > > > for (int i =3D 0; i < list.length; i++) > > { > > File tmp =3D list[i]; > > > > String path =3D tmp.getAbsolutePath(); > > > > int x =3D path.lastIndexOf('/'); > > > > if (x !=3D -1) > > { > > path =3D path.substring(x+1); > > } > > > > HttpConfiguration config =3D new > > HttpConfiguration(); > > > > config.setRequest("GET", > > "http://127.0.0.1:2000/carol/" + path); > > > > Client http =3D new Client(); > > > > http.open(config); > > http.send(); > > > > Assert.assertTrue(http.getStatusCode() > > =3D=3D 200); > > } > > } > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. Do > > you grep through log files > > for problems? Stop! Download the new AJAX search > > engine that makes > > searching your log files as easy as surfing the > > web. DOWNLOAD SPLUNK! > > http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dclick > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > Niall Gallagher > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > |
From: Niall G. <gal...@ya...> - 2005-12-12 16:56:47
|
Hi Brian, Thanks for this, ill check this out. I assume that you are using Java 1.4? Niall --- Brian Davis <wic...@gm...> wrote: > When upgrading from 2.7.2 to 2.7.3 the new > PollerInputStream breaks > the regression tests in such a way that reading > multiple requests > blocks until the configurator times out. > > The problem was fixed by going back to the old > PollerInputStream that > is based upon the PushBackInputStream > > test below: > > public void test1325() throws Exception > { > File dir = new File("test/carol"); > > File[] list = dir.listFiles(); > > for (int i = 0; i < list.length; i++) > { > File tmp = list[i]; > > String path = tmp.getAbsolutePath(); > > int x = path.lastIndexOf('/'); > > if (x != -1) > { > path = path.substring(x+1); > } > > HttpConfiguration config = new > HttpConfiguration(); > > config.setRequest("GET", > "http://127.0.0.1:2000/carol/" + path); > > Client http = new Client(); > > http.open(config); > http.send(); > > Assert.assertTrue(http.getStatusCode() > == 200); > } > } > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do > you grep through log files > for problems? Stop! Download the new AJAX search > engine that makes > searching your log files as easy as surfing the > web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id865&op=click > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > Niall Gallagher __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Brian D. <wic...@gm...> - 2005-12-12 16:49:51
|
When upgrading from 2.7.2 to 2.7.3 the new PollerInputStream breaks the regression tests in such a way that reading multiple requests blocks until the configurator times out. The problem was fixed by going back to the old PollerInputStream that is based upon the PushBackInputStream test below: public void test1325() throws Exception { File dir =3D new File("test/carol"); File[] list =3D dir.listFiles(); for (int i =3D 0; i < list.length; i++) { File tmp =3D list[i]; String path =3D tmp.getAbsolutePath(); int x =3D path.lastIndexOf('/'); if (x !=3D -1) { path =3D path.substring(x+1); } HttpConfiguration config =3D new HttpConfiguration(); config.setRequest("GET", "http://127.0.0.1:2000/carol/" + path)= ; Client http =3D new Client(); http.open(config); http.send(); Assert.assertTrue(http.getStatusCode() =3D=3D 200); } } |