{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/jetty.project/issues/2570","repository_url":"https://api.github.com/repos/eclipse/jetty.project","labels_url":"https://api.github.com/repos/eclipse/jetty.project/issues/2570/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/jetty.project/issues/2570/comments","events_url":"https://api.github.com/repos/eclipse/jetty.project/issues/2570/events","html_url":"https://github.com/eclipse/jetty.project/issues/2570","id":326094291,"number":2570,"title":"InputStream blocks with Jetty HTTP client using an InputStreamResponseListener","user":{"login":"mpetzold","id":134109,"avatar_url":"https://avatars3.githubusercontent.com/u/134109?v=4","gravatar_id":"","url":"https://api.github.com/users/mpetzold","html_url":"https://github.com/mpetzold","followers_url":"https://api.github.com/users/mpetzold/followers","following_url":"https://api.github.com/users/mpetzold/following{/other_user}","gists_url":"https://api.github.com/users/mpetzold/gists{/gist_id}","starred_url":"https://api.github.com/users/mpetzold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpetzold/subscriptions","organizations_url":"https://api.github.com/users/mpetzold/orgs","repos_url":"https://api.github.com/users/mpetzold/repos","events_url":"https://api.github.com/users/mpetzold/events{/privacy}","received_events_url":"https://api.github.com/users/mpetzold/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"sbordet","id":414681,"avatar_url":"https://avatars3.githubusercontent.com/u/414681?v=4","gravatar_id":"","url":"https://api.github.com/users/sbordet","html_url":"https://github.com/sbordet","followers_url":"https://api.github.com/users/sbordet/followers","following_url":"https://api.github.com/users/sbordet/following{/other_user}","gists_url":"https://api.github.com/users/sbordet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbordet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbordet/subscriptions","organizations_url":"https://api.github.com/users/sbordet/orgs","repos_url":"https://api.github.com/users/sbordet/repos","events_url":"https://api.github.com/users/sbordet/events{/privacy}","received_events_url":"https://api.github.com/users/sbordet/received_events","type":"User","site_admin":false},"assignees":[{"login":"sbordet","id":414681,"avatar_url":"https://avatars3.githubusercontent.com/u/414681?v=4","gravatar_id":"","url":"https://api.github.com/users/sbordet","html_url":"https://github.com/sbordet","followers_url":"https://api.github.com/users/sbordet/followers","following_url":"https://api.github.com/users/sbordet/following{/other_user}","gists_url":"https://api.github.com/users/sbordet/gists{/gist_id}","starred_url":"https://api.github.com/users/sbordet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbordet/subscriptions","organizations_url":"https://api.github.com/users/sbordet/orgs","repos_url":"https://api.github.com/users/sbordet/repos","events_url":"https://api.github.com/users/sbordet/events{/privacy}","received_events_url":"https://api.github.com/users/sbordet/received_events","type":"User","site_admin":false}],"milestone":null,"comments":38,"created_at":"2018-05-24T12:15:54Z","updated_at":"2018-05-29T13:15:26Z","closed_at":null,"author_association":"NONE","body":"Im am using Jetty 9.4.8 HTTP client and want to write a stream of incoming data to a file. Currently I am using an InputStreamResponseListener and IOUtils.copy(..) writing to a FileOutputStream. I have also tried Files.copy().\r\n\r\n```\r\nInputStreamResponseListener streamResponseListener = new InputStreamResponseListener();\r\n\r\nrequest.send(streamResponseListener);\r\n\r\nif(streamResponseListener.get(5, TimeUnit.MINUTES).getStatus() == 200) {\r\n    OutputStream outputStream = null;\r\n    try {\r\n        TMP_FILE.toFile().createNewFile();\r\n        outputStream = new FileOutputStream(TMP_FILE.toFile());\r\n        IOUtils.copy(inputStream, outputStream);\r\n    } catch(IOException e) {\r\n        this.getLogService().log(..)\r\n    } finally {\r\n        IOUtils.closeQuietly(inputStream);\r\n        IOUtils.closeQuietly(outputStream);\r\n    }\r\n\r\n    // NOT REACHED IN CASE InputStream is BLOCKED FOR SOME REASON\r\n}\r\n```\r\n\r\nInputStream is blocked in some cases when I use the InputStreamResponseListener object to handle the InputStream. IMHO this is a bug. I also think that onSuccess() should not be called by Jetty in case InputStream is not fully read or blocking."},"comment":{"url":"https://api.github.com/repos/eclipse/jetty.project/issues/comments/392771431","html_url":"https://github.com/eclipse/jetty.project/issues/2570#issuecomment-392771431","issue_url":"https://api.github.com/repos/eclipse/jetty.project/issues/2570","id":392771431,"user":{"login":"mpetzold","id":134109,"avatar_url":"https://avatars3.githubusercontent.com/u/134109?v=4","gravatar_id":"","url":"https://api.github.com/users/mpetzold","html_url":"https://github.com/mpetzold","followers_url":"https://api.github.com/users/mpetzold/followers","following_url":"https://api.github.com/users/mpetzold/following{/other_user}","gists_url":"https://api.github.com/users/mpetzold/gists{/gist_id}","starred_url":"https://api.github.com/users/mpetzold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpetzold/subscriptions","organizations_url":"https://api.github.com/users/mpetzold/orgs","repos_url":"https://api.github.com/users/mpetzold/repos","events_url":"https://api.github.com/users/mpetzold/events{/privacy}","received_events_url":"https://api.github.com/users/mpetzold/received_events","type":"User","site_admin":false},"created_at":"2018-05-29T13:15:26Z","updated_at":"2018-05-29T13:15:26Z","author_association":"NONE","body":"Using actual file size (File.length()) instead of InputStream.available. Size of file in Linux filesystem (ls -l): 613971248\r\n\r\nResponse headers (according to Chrome Restlet HTTP client):\r\n```\r\nDate: Tue, 29 May 2018 13:11:37 GMT\r\nContent-Type: application/octet-stream\r\nContent-Disposition: attachment; filename=\"myfile.deb\"\r\nContent-Length: 613971248\r\nServer: Jetty(9.4.8.v20171121)\r\n```"}}
{"actor":{"display_login":"mpetzold"}}