|
From: <jz...@xi...> - 2013-03-03 02:39:53
|
Thank you. The fix is checked into CVS...
----- Original Message -----
From: kh...@ba...
To:
Cc:
Sent:Thu, 28 Feb 2013 14:31:46 +0100
Subject:[Vtd-xml-users] Double get in VTDGen.parseHttpUrl()
Mr. jzhang,
I notice there is a little annoying bug in method
parseHttpUrl(String url,boolean ns) in class VTDGen.
Connection to url is open twice so it starts two downloads.
1st
in = url1.openStream(); [1]
2nd
urlConnection = (HttpURLConnection)url1openConnection(); [2]
---
The standard way of getting stream from URLConnection is method
getInputStream(). Easy fix follow ...
try{
url1 = new URL(url);
urlConnection = (HttpURLConnection)url1.openConnection(); [3]
if (urlConnection.getResponseCode() [4] ==
HttpURLConnection.HTTP_OK) [5] {
in = urlConnection.getInputStream(); [6]
int len = urlConnection.getContentLength(); [7]
if (len > 0) {
--
-----------------------------
Kamil Hanak
Bach systems, s.r.o.
Holicka 31/N, 772 00 Olomouc
tel.: +420 585 228 693
e-mail: kh...@ba... [8]
-----------------------------
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb [9]
_______________________________________________
Vtd-xml-users mailing list
Vtd...@li... [10]
https://lists.sourceforge.net/lists/listinfo/vtd-xml-users [11]
Links:
------
[1] http://sitemail.hostway.com/http:
[2] http://sitemail.hostway.com/http:
[3] http://sitemail.hostway.com/http:
[4] http://sitemail.hostway.com/http:
[5] http://sitemail.hostway.com/http:
[6] http://sitemail.hostway.com/http:
[7] http://sitemail.hostway.com/http:
[8] mailto:kh...@ba...
[9] http://p.sf.net/sfu/appdyn_d2d_feb
[10] mailto:Vtd...@li...
[11] https://lists.sourceforge.net/lists/listinfo/vtd-xml-users
|