Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 73C14200CB8 for ; Sat, 1 Jul 2017 10:47:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7256F160BEA; Sat, 1 Jul 2017 08:47:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6D3EE160BD2 for ; Sat, 1 Jul 2017 10:47:04 +0200 (CEST) Received: (qmail 69434 invoked by uid 500); 1 Jul 2017 08:47:03 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 69422 invoked by uid 99); 1 Jul 2017 08:47:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Jul 2017 08:47:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 32667C1FD8 for ; Sat, 1 Jul 2017 08:47:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.01 X-Spam-Level: X-Spam-Status: No, score=-100.01 tagged_above=-999 required=6.31 tests=[SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100, WEIRD_PORT=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id e8Wsj6Vr23xS for ; Sat, 1 Jul 2017 08:47:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4581B5F60D for ; Sat, 1 Jul 2017 08:47:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5E145E08C1 for ; Sat, 1 Jul 2017 08:47:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 07449245D8 for ; Sat, 1 Jul 2017 08:47:00 +0000 (UTC) Date: Sat, 1 Jul 2017 08:47:00 +0000 (UTC) From: "M.S. Dousti (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HTTPCORE-475) Occasional issues in handling "204 No Content" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 01 Jul 2017 08:47:05 -0000 [ https://issues.apache.org/jira/browse/HTTPCORE-475?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] M.S. Dousti updated HTTPCORE-475: --------------------------------- Description: While testing {{ElementalReverseProxy}}, I noted that occasionally, some requests fail. Digging further, it seems that the code has some difficulty in handling POST requests whose responses have "204 No Content" status. The bug is intermittent, so it is a bit tricky to reproduce. One way is to run the proxy against [http://www.bing.com]. (Notice it's HTTP and not HTTPS). Here are the steps: 1) Change line 274 of {{ElementalReverseProxy}} to further assist in debugging, from: {code:java} System.err.println("I/O error: " + ex.getMessage()); {code} to: {code:java} ex.printStackTrace(); System.exit(-1); {code} 2) Add the following lines to your {{hosts}} file ({{/etc/hosts}} in Linux, and {{%SystemRoot%\System32\drivers\etc\hosts}} in Windows): {code:none} 127.0.0.1 bing.com 127.0.0.1 www.bing.com {code} 3) Run {{ElementalReverseProxy}} against one of Bing's IP addresses. I used {{204.79.197.200}}. 4) Navigate your browser to {{http://www.bing.com:8888}}, and watch the output of {{ElementalReverseProxy}}. Here's a sample run: {code:none} Listening on port 8888 Incoming connection from /127.0.0.1 Outgoing connection to /204.79.197.200 New connection thread >> Request URI: / << Response: HTTP/1.1 200 OK Incoming connection from /127.0.0.1 Outgoing connection to /204.79.197.200 Incoming connection from /127.0.0.1 New connection thread >> Request URI: /fd/ls/l?IG=3C1FD9BC348B419DAF07D5D09D135555&CID=3ED5D1926AB96D71082FDB206BCB6CA6&Type=Event.CPT&DATA={%22pp%22:{%22S%22:%22L%22,%22FC%22:-1,%22BC%22:-1,%22SE%22:-1,%22TC%22:-1,%22H%22:116,%22BP%22:134,%22CT%22:169,%22IL%22:1},%22ad%22:[-1,-1,1600,770,1600,770,0]}&P=SERP&DA=Bn2 Outgoing connection to /204.79.197.200 New connection thread >> Request URI: /fd/ls/lsp.aspx? Incoming connection from /127.0.0.1 Outgoing connection to /204.79.197.200 New connection thread Incoming connection from /127.0.0.1 >> Request URI: /notifications/render?bnptrigger=%7B%22PartnerId%22%3A%22HomePage%22%2C%22IID%22%3A%22SERP.2000%22%2C%22Attributes%22%3A%7B%22RawRequestURL%22%3A%22%2F%22%7D%7D&IG=3C1FD9BC348B419DAF07D5D09D135555&IID=SERP.2000 Outgoing connection to /204.79.197.200 New connection thread Incoming connection from /127.0.0.1 >> Request URI: /sa/8_01_0_000000/HpbHeaderPopup.js << Response: HTTP/1.1 204 OK Outgoing connection to /204.79.197.200 New connection thread >> Request URI: /sa/8_01_0_000000/homepageImgViewer_c.js << Response: HTTP/1.1 200 OK << Response: HTTP/1.1 200 OK << Response: HTTP/1.1 200 OK >> Request URI: /HPImageArchive.aspx?format=js&idx=0&n=1&nc=1498898493932&pid=hp org.apache.http.NoHttpResponseException: The target server failed to respondIncoming connection from /127.0.0.1 at org.apache.http.impl.io.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:131) at org.apache.http.impl.io.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:53) at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259) at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163) at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273) at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125) at ElementalReverseProxy$ProxyHandler.handle(ElementalReverseProxy.java:134) at org.apache.http.protocol.HttpService.doService(HttpService.java:437) at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:342) at ElementalReverseProxy$ProxyThread.run(ElementalReverseProxy.java:262) {code} I don't know whether the problem lies within {{ElementalReverseProxy}}, or the way HC handles the requests/responses. I also wrote a simple PHP/HTML/JavaScript to reproduce the error without relying on Bing, which I can provide if needed. was: While testing {{ElementalReverseProxy}}, I noted that occasionally, some requests fail. Digging further, it seems that the code has some difficulty in handling POST requests whose responses have "204 No Content" status. The bug is intermittent, so it is a bit tricky to reproduce. One way is to run the proxy against [http://www.bing.com]. (Notice it's HTTP and not HTTPS). Here are the steps: # Change line 274 of {{ElementalReverseProxy}} to further assist in debugging, from: {code:java} System.err.println("I/O error: " + ex.getMessage()); {code} to: {code:java} ex.printStackTrace(); System.exit(-1); {code} # Add the following lines to your {{hosts}} file ({{/etc/hosts}} in Linux, and {{%SystemRoot%\System32\drivers\etc\hosts}} in Windows): {code:none} 127.0.0.1 bing.com 127.0.0.1 www.bing.com {code} # Run {{ElementalReverseProxy}} against one of Bing's IP addresses. I used {{204.79.197.200}}. # Navigate your browser to {{http://www.bing.com:8888}}, and watch the output of {{ElementalReverseProxy}}. Here's a sample run: {code:none} Listening on port 8888 Incoming connection from /127.0.0.1 Outgoing connection to /204.79.197.200 New connection thread >> Request URI: / << Response: HTTP/1.1 200 OK Incoming connection from /127.0.0.1 Outgoing connection to /204.79.197.200 Incoming connection from /127.0.0.1 New connection thread >> Request URI: /fd/ls/l?IG=3C1FD9BC348B419DAF07D5D09D135555&CID=3ED5D1926AB96D71082FDB206BCB6CA6&Type=Event.CPT&DATA={%22pp%22:{%22S%22:%22L%22,%22FC%22:-1,%22BC%22:-1,%22SE%22:-1,%22TC%22:-1,%22H%22:116,%22BP%22:134,%22CT%22:169,%22IL%22:1},%22ad%22:[-1,-1,1600,770,1600,770,0]}&P=SERP&DA=Bn2 Outgoing connection to /204.79.197.200 New connection thread >> Request URI: /fd/ls/lsp.aspx? Incoming connection from /127.0.0.1 Outgoing connection to /204.79.197.200 New connection thread Incoming connection from /127.0.0.1 >> Request URI: /notifications/render?bnptrigger=%7B%22PartnerId%22%3A%22HomePage%22%2C%22IID%22%3A%22SERP.2000%22%2C%22Attributes%22%3A%7B%22RawRequestURL%22%3A%22%2F%22%7D%7D&IG=3C1FD9BC348B419DAF07D5D09D135555&IID=SERP.2000 Outgoing connection to /204.79.197.200 New connection thread Incoming connection from /127.0.0.1 >> Request URI: /sa/8_01_0_000000/HpbHeaderPopup.js << Response: HTTP/1.1 204 OK Outgoing connection to /204.79.197.200 New connection thread >> Request URI: /sa/8_01_0_000000/homepageImgViewer_c.js << Response: HTTP/1.1 200 OK << Response: HTTP/1.1 200 OK << Response: HTTP/1.1 200 OK >> Request URI: /HPImageArchive.aspx?format=js&idx=0&n=1&nc=1498898493932&pid=hp org.apache.http.NoHttpResponseException: The target server failed to respondIncoming connection from /127.0.0.1 at org.apache.http.impl.io.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:131) at org.apache.http.impl.io.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:53) at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259) at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163) at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273) at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125) at ElementalReverseProxy$ProxyHandler.handle(ElementalReverseProxy.java:134) at org.apache.http.protocol.HttpService.doService(HttpService.java:437) at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:342) at ElementalReverseProxy$ProxyThread.run(ElementalReverseProxy.java:262) {code} I don't know whether the problem lies within {{ElementalReverseProxy}}, or the way HC handles the requests/responses. I also wrote a simple PHP/HTML/JavaScript to reproduce the error without relying on Bing, which I can provide if needed. > Occasional issues in handling "204 No Content" > ---------------------------------------------- > > Key: HTTPCORE-475 > URL: https://issues.apache.org/jira/browse/HTTPCORE-475 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: Examples, HttpCore > Affects Versions: 4.4.6 > Environment: Windows, Java 8 > Reporter: M.S. Dousti > Priority: Minor > > While testing {{ElementalReverseProxy}}, I noted that occasionally, some requests fail. Digging further, it seems that the code has some difficulty in handling POST requests whose responses have "204 No Content" status. The bug is intermittent, so it is a bit tricky to reproduce. One way is to run the proxy against [http://www.bing.com]. (Notice it's HTTP and not HTTPS). Here are the steps: > 1) Change line 274 of {{ElementalReverseProxy}} to further assist in debugging, from: > {code:java} > System.err.println("I/O error: " + ex.getMessage()); > {code} > to: > {code:java} > ex.printStackTrace(); System.exit(-1); > {code} > 2) Add the following lines to your {{hosts}} file ({{/etc/hosts}} in Linux, and {{%SystemRoot%\System32\drivers\etc\hosts}} in Windows): > {code:none} > 127.0.0.1 bing.com > 127.0.0.1 www.bing.com > {code} > 3) Run {{ElementalReverseProxy}} against one of Bing's IP addresses. I used {{204.79.197.200}}. > 4) Navigate your browser to {{http://www.bing.com:8888}}, and watch the output of > {{ElementalReverseProxy}}. Here's a sample run: > {code:none} > Listening on port 8888 > Incoming connection from /127.0.0.1 > Outgoing connection to /204.79.197.200 > New connection thread > >> Request URI: / > << Response: HTTP/1.1 200 OK > Incoming connection from /127.0.0.1 > Outgoing connection to /204.79.197.200 > Incoming connection from /127.0.0.1 > New connection thread > >> Request URI: /fd/ls/l?IG=3C1FD9BC348B419DAF07D5D09D135555&CID=3ED5D1926AB96D71082FDB206BCB6CA6&Type=Event.CPT&DATA={%22pp%22:{%22S%22:%22L%22,%22FC%22:-1,%22BC%22:-1,%22SE%22:-1,%22TC%22:-1,%22H%22:116,%22BP%22:134,%22CT%22:169,%22IL%22:1},%22ad%22:[-1,-1,1600,770,1600,770,0]}&P=SERP&DA=Bn2 > Outgoing connection to /204.79.197.200 > New connection thread > >> Request URI: /fd/ls/lsp.aspx? > Incoming connection from /127.0.0.1 > Outgoing connection to /204.79.197.200 > New connection thread > Incoming connection from /127.0.0.1 > >> Request URI: /notifications/render?bnptrigger=%7B%22PartnerId%22%3A%22HomePage%22%2C%22IID%22%3A%22SERP.2000%22%2C%22Attributes%22%3A%7B%22RawRequestURL%22%3A%22%2F%22%7D%7D&IG=3C1FD9BC348B419DAF07D5D09D135555&IID=SERP.2000 > Outgoing connection to /204.79.197.200 > New connection thread > Incoming connection from /127.0.0.1 > >> Request URI: /sa/8_01_0_000000/HpbHeaderPopup.js > << Response: HTTP/1.1 204 OK > Outgoing connection to /204.79.197.200 > New connection thread > >> Request URI: /sa/8_01_0_000000/homepageImgViewer_c.js > << Response: HTTP/1.1 200 OK > << Response: HTTP/1.1 200 OK > << Response: HTTP/1.1 200 OK > >> Request URI: /HPImageArchive.aspx?format=js&idx=0&n=1&nc=1498898493932&pid=hp > org.apache.http.NoHttpResponseException: The target server failed to respondIncoming connection from /127.0.0.1 > at org.apache.http.impl.io.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:131) > at org.apache.http.impl.io.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:53) > at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259) > at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163) > at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273) > at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125) > at ElementalReverseProxy$ProxyHandler.handle(ElementalReverseProxy.java:134) > at org.apache.http.protocol.HttpService.doService(HttpService.java:437) > at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:342) > at ElementalReverseProxy$ProxyThread.run(ElementalReverseProxy.java:262) > {code} > I don't know whether the problem lies within {{ElementalReverseProxy}}, or the way HC handles the requests/responses. > I also wrote a simple PHP/HTML/JavaScript to reproduce the error without relying on Bing, which I can provide if needed. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org