|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
HTTPClient 3.1 Post method runs too slowly at some client's environments.Hi, I am developing an Applet with HTTPClient 3.1
I love the library, so thanks you guys for making that. My Applet have worked very well. However, I faced to a problem today. For some environments, HTTPClient’s POST method runs too slowly. There was no firewall. I dumped the full log message. And I’ve found where problem occurs but I don’t know the cause. See the 2009/09/29 10:28:36:328 2009/09/29 10:28:16:390 KST [DEBUG] header - >> "POST / HTTP/1.1[\r][\n]" 2009/09/29 10:28:16:390 KST [DEBUG] HttpMethodBase - Adding Host request header 2009/09/29 10:28:16:421 KST [DEBUG] header - >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]" 2009/09/29 10:28:16:437 KST [DEBUG] header - >> "Host: 70.7.105.235:8080[\r][\n]" 2009/09/29 10:28:16:437 KST [DEBUG] header - >> "Content-Length: 107481[\r][\n]" 2009/09/29 10:28:16:437 KST [DEBUG] header - >> "Content-Type: multipart/form-data; boundary=3tHtpPZ_lPWZJS3dCtFN68SYaRfA4B[\r][\n]" 2009/09/29 10:28:16:437 KST [DEBUG] header - >> "[\r][\n]" 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "--" 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "3tHtpPZ_lPWZJS3dCtFN68SYaRfA4B" 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "[\r][\n]" 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "Content-Disposition: form-data; name=" 2009/09/29 10:28:16:437 KST [DEBUG] content - >> """ 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "FILENAME" 2009/09/29 10:28:16:437 KST [DEBUG] content - >> """ 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "[\r][\n]" 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "Content-Type: " 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "text/plain" 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "; charset=" 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "US-ASCII" . omitted . . 2009/09/29 10:28:16:734 KST [DEBUG] content - >> "Content-Disposition: form-data; name=" 2009/09/29 10:28:16:734 KST [DEBUG] content - >> """ 2009/09/29 10:28:16:734 KST [DEBUG] content - >> "??.jpg" 2009/09/29 10:28:16:734 KST [DEBUG] content - >> """ 2009/09/29 10:28:16:734 KST [DEBUG] content - >> "; filename=" 2009/09/29 10:28:16:734 KST [DEBUG] content - >> """ 2009/09/29 10:28:16:734 KST [DEBUG] content - >> "??.jpg" 2009/09/29 10:28:16:734 KST [DEBUG] content - >> """ 2009/09/29 10:28:16:734 KST [DEBUG] content - >> "[\r][\n]" 2009/09/29 10:28:16:734 KST [DEBUG] content - >> "Content-Type: " 2009/09/29 10:28:16:734 KST [DEBUG] content - >> "application/octet-stream" 2009/09/29 10:28:16:734 KST [DEBUG] content - >> "; charset=" // @@@ 10:28:16:734 2009/09/29 10:28:36:328 KST [DEBUG] content - >> "ISO-8859-1" // @@@ here! 20 seconds delayed! What happened? It is weird. 2009/09/29 10:28:36:328 KST [DEBUG] content - >> "[\r][\n]" 2009/09/29 10:28:36:328 KST [DEBUG] content - >> "Content-Transfer-Encoding: " 2009/09/29 10:28:36:328 KST [DEBUG] content - >> "binary" 2009/09/29 10:28:36:328 KST [DEBUG] content - >> "[\r][\n]" 2009/09/29 10:28:36:328 KST [DEBUG] content - >> "[\r][\n]" 2009/09/29 10:28:36:375 KST [DEBUG] content - >> "[0xff][0xd8][0xff][0xe0][0x0][0x10]JFIF[0x0][0x1][0x2][0x1][0x0]`[0x0]`[0x0][0x0][0xff][0xed][0x10]JPhotoshop 3.0[0x0]8BIM[0x3][0xed][\n]" . omitted . . 2009/09/29 10:28:37:984 KST [DEBUG] content - >> "[\r][\n]" 2009/09/29 10:28:37:984 KST [DEBUG] content - >> "--" 2009/09/29 10:28:37:984 KST [DEBUG] content - >> "3tHtpPZ_lPWZJS3dCtFN68SYaRfA4B" 2009/09/29 10:28:37:984 KST [DEBUG] content - >> "--" 2009/09/29 10:28:37:984 KST [DEBUG] content - >> "[\r][\n]" 2009/09/29 10:28:37:984 KST [DEBUG] EntityEnclosingMethod - Request body sent 2009/09/29 10:28:38:078 KST [DEBUG] header - << "HTTP/1.0 200 OK[\r][\n]" 2009/09/29 10:28:38:078 KST [DEBUG] header - << "HTTP/1.0 200 OK[\r][\n]" 2009/09/29 10:28:38:078 KST [DEBUG] header - << "Content-Length: 0[\r][\n]" 2009/09/29 10:28:38:078 KST [DEBUG] header - << "Content-Type: text/html[\r][\n]" 2009/09/29 10:28:38:078 KST [DEBUG] header - << "[\r][\n]" My HTTP POST codes are following. String s = "https://" + sServerIP.value + ":" + sServerPort.value + "/"; PostMethod filePost = new PostMethod(s); Part[] parts = { new StringPart("FILENAME", file.getName()), new StringPart("SESSIONINDEX", String.valueOf(m_jSID)), new StringPart("FILEINDEX", String.valueOf(jfidx)), new StringPart("DISKTYPE", String.valueOf(m_iDiskType)), new StringPart("DISKINDEX", String.valueOf(m_jDiskIndex)), new StringPart("SERVERIP", sServerIP.value), new StringPart("SERVERPORT", sServerPort.value), new StringPart("UPLOADDAEMONTYPE", "2"), new StringPart("FILEUPLOADTYPE", String.valueOf(iFileUploadOption)), new StringPart("UPLOADSIZE", String.valueOf(file.getSize())), new BizFilePart(file.getName(), new FilePartSource((File) file.getUserObject()), this) }; filePost.setRequestEntity(new MultipartRequestEntity(parts, filePost.getParams())); HttpClient client = new HttpClient(); client.getHostConfiguration().setHost(sServerIP.value, Integer.valueOf(sServerPort.value)); client.getHttpConnectionManager().getParams().setConnectionTimeout(timeout); int status = client.executeMethod(filePost); If you know why, please let me know too. Thanks in advance. |
|
|
Re: HTTPClient 3.1 Post method runs too slowly at some client's environments.crazytazo wrote:
> Hi, I am developing an Applet with HTTPClient 3.1 > I love the library, so thanks you guys for making that. > > > My Applet have worked very well. > However, I faced to a problem today. > For some environments, HTTPClient’s POST method runs too slowly. There > was no firewall. > I dumped the full log message. And I’ve found where problem occurs but > I don’t know the cause. > > See the 2009/09/29 10:28:36:328 > > > > 2009/09/29 10:28:16:390 KST [DEBUG] header - >> "POST / HTTP/1.1[\r][\n]" > 2009/09/29 10:28:16:390 KST [DEBUG] HttpMethodBase - Adding Host request > header > 2009/09/29 10:28:16:421 KST [DEBUG] header - >> "User-Agent: Jakarta > Commons-HttpClient/3.1[\r][\n]" > 2009/09/29 10:28:16:437 KST [DEBUG] header - >> "Host: > 70.7.105.235:8080[\r][\n]" > 2009/09/29 10:28:16:437 KST [DEBUG] header - >> "Content-Length: > 107481[\r][\n]" > 2009/09/29 10:28:16:437 KST [DEBUG] header - >> "Content-Type: > multipart/form-data; boundary=3tHtpPZ_lPWZJS3dCtFN68SYaRfA4B[\r][\n]" > 2009/09/29 10:28:16:437 KST [DEBUG] header - >> "[\r][\n]" > 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "--" > 2009/09/29 10:28:16:437 KST [DEBUG] content - >> > "3tHtpPZ_lPWZJS3dCtFN68SYaRfA4B" > 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "[\r][\n]" > 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "Content-Disposition: > form-data; name=" > 2009/09/29 10:28:16:437 KST [DEBUG] content - >> """ > 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "FILENAME" > 2009/09/29 10:28:16:437 KST [DEBUG] content - >> """ > 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "[\r][\n]" > 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "Content-Type: " > 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "text/plain" > 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "; charset=" > 2009/09/29 10:28:16:437 KST [DEBUG] content - >> "US-ASCII" > . omitted > . > . > 2009/09/29 10:28:16:734 KST [DEBUG] content - >> "Content-Disposition: > form-data; name=" > 2009/09/29 10:28:16:734 KST [DEBUG] content - >> """ > 2009/09/29 10:28:16:734 KST [DEBUG] content - >> "??.jpg" > 2009/09/29 10:28:16:734 KST [DEBUG] content - >> """ > 2009/09/29 10:28:16:734 KST [DEBUG] content - >> "; filename=" > 2009/09/29 10:28:16:734 KST [DEBUG] content - >> """ > 2009/09/29 10:28:16:734 KST [DEBUG] content - >> "??.jpg" > 2009/09/29 10:28:16:734 KST [DEBUG] content - >> """ > 2009/09/29 10:28:16:734 KST [DEBUG] content - >> "[\r][\n]" > 2009/09/29 10:28:16:734 KST [DEBUG] content - >> "Content-Type: " > 2009/09/29 10:28:16:734 KST [DEBUG] content - >> "application/octet-stream" > > 2009/09/29 10:28:16:734 KST [DEBUG] content - >> "; charset=" // @@@ > 10:28:16:734 > > 2009/09/29 10:28:36:328 KST [DEBUG] content - >> "ISO-8859-1" // @@@ > here! 20 seconds delayed! What happened? It is weird. > > 2009/09/29 10:28:36:328 KST [DEBUG] content - >> "[\r][\n]" > 2009/09/29 10:28:36:328 KST [DEBUG] content - >> "Content-Transfer-Encoding: > " > 2009/09/29 10:28:36:328 KST [DEBUG] content - >> "binary" > 2009/09/29 10:28:36:328 KST [DEBUG] content - >> "[\r][\n]" > 2009/09/29 10:28:36:328 KST [DEBUG] content - >> "[\r][\n]" > 2009/09/29 10:28:36:375 KST [DEBUG] content - >> > "[0xff][0xd8][0xff][0xe0][0x0][0x10]JFIF[0x0][0x1][0x2][0x1][0x0]`[0x0]`[0x0][0x0][0xff][0xed][0x10]JPhotoshop > 3.0[0x0]8BIM[0x3][0xed][\n]" > . omitted > . > . > 2009/09/29 10:28:37:984 KST [DEBUG] content - >> "[\r][\n]" > 2009/09/29 10:28:37:984 KST [DEBUG] content - >> "--" > 2009/09/29 10:28:37:984 KST [DEBUG] content - >> > "3tHtpPZ_lPWZJS3dCtFN68SYaRfA4B" > 2009/09/29 10:28:37:984 KST [DEBUG] content - >> "--" > 2009/09/29 10:28:37:984 KST [DEBUG] content - >> "[\r][\n]" > 2009/09/29 10:28:37:984 KST [DEBUG] EntityEnclosingMethod - Request body > sent > 2009/09/29 10:28:38:078 KST [DEBUG] header - << "HTTP/1.0 200 OK[\r][\n]" > 2009/09/29 10:28:38:078 KST [DEBUG] header - << "HTTP/1.0 200 OK[\r][\n]" > 2009/09/29 10:28:38:078 KST [DEBUG] header - << "Content-Length: 0[\r][\n]" > 2009/09/29 10:28:38:078 KST [DEBUG] header - << "Content-Type: > text/html[\r][\n]" > 2009/09/29 10:28:38:078 KST [DEBUG] header - << "[\r][\n]" > > > > > My HTTP POST codes are following. > > > String s = "https://" + sServerIP.value + ":" + sServerPort.value + "/"; > PostMethod filePost = new PostMethod(s); > Part[] parts = { > new StringPart("FILENAME", file.getName()), > new StringPart("SESSIONINDEX", String.valueOf(m_jSID)), > new StringPart("FILEINDEX", String.valueOf(jfidx)), > new StringPart("DISKTYPE", String.valueOf(m_iDiskType)), > new StringPart("DISKINDEX", String.valueOf(m_jDiskIndex)), > new StringPart("SERVERIP", sServerIP.value), > new StringPart("SERVERPORT", sServerPort.value), > new StringPart("UPLOADDAEMONTYPE", "2"), > new StringPart("FILEUPLOADTYPE", > String.valueOf(iFileUploadOption)), > new StringPart("UPLOADSIZE", String.valueOf(file.getSize())), > new BizFilePart(file.getName(), new > FilePartSource((File) file.getUserObject()), this) > }; > > filePost.setRequestEntity(new MultipartRequestEntity(parts, > filePost.getParams())); > HttpClient client = new HttpClient(); > client.getHostConfiguration().setHost(sServerIP.value, > Integer.valueOf(sServerPort.value)); > client.getHttpConnectionManager().getParams().setConnectionTimeout(timeout); > int status = client.executeMethod(filePost); > > > If you know why, please let me know too. > Thanks in advance. My only guess this is a local connectivity issue. There are no known performance problems with HttpClient both version 3.1 and 4.0 Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@... For additional commands, e-mail: httpclient-users-help@... |
| Free embeddable forum powered by Nabble | Forum Help |