{"action":"created","issue":{"url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/issues/1089","labels_url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/issues/1089/labels{/name}","comments_url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/issues/1089/comments","events_url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/issues/1089/events","html_url":"https://github.com/AsyncHttpClient/async-http-client/issues/1089","id":129469214,"number":1089,"title":"MultipartBody endless loop reading ByteArrayPart with empty byte array ","user":{"login":"matterche","id":1415368,"avatar_url":"https://avatars.githubusercontent.com/u/1415368?v=3","gravatar_id":"","url":"https://api.github.com/users/matterche","html_url":"https://github.com/matterche","followers_url":"https://api.github.com/users/matterche/followers","following_url":"https://api.github.com/users/matterche/following{/other_user}","gists_url":"https://api.github.com/users/matterche/gists{/gist_id}","starred_url":"https://api.github.com/users/matterche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matterche/subscriptions","organizations_url":"https://api.github.com/users/matterche/orgs","repos_url":"https://api.github.com/users/matterche/repos","events_url":"https://api.github.com/users/matterche/events{/privacy}","received_events_url":"https://api.github.com/users/matterche/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/labels/Defect","name":"Defect","color":"e11d21"},{"url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/labels/Netty","name":"Netty","color":"009800"}],"state":"closed","locked":false,"assignee":{"login":"slandelle","id":849197,"avatar_url":"https://avatars.githubusercontent.com/u/849197?v=3","gravatar_id":"","url":"https://api.github.com/users/slandelle","html_url":"https://github.com/slandelle","followers_url":"https://api.github.com/users/slandelle/followers","following_url":"https://api.github.com/users/slandelle/following{/other_user}","gists_url":"https://api.github.com/users/slandelle/gists{/gist_id}","starred_url":"https://api.github.com/users/slandelle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slandelle/subscriptions","organizations_url":"https://api.github.com/users/slandelle/orgs","repos_url":"https://api.github.com/users/slandelle/repos","events_url":"https://api.github.com/users/slandelle/events{/privacy}","received_events_url":"https://api.github.com/users/slandelle/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/milestones/66","html_url":"https://github.com/AsyncHttpClient/async-http-client/milestones/1.9.33","labels_url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/milestones/66/labels","id":1549300,"number":66,"title":"1.9.33","description":"","creator":{"login":"slandelle","id":849197,"avatar_url":"https://avatars.githubusercontent.com/u/849197?v=3","gravatar_id":"","url":"https://api.github.com/users/slandelle","html_url":"https://github.com/slandelle","followers_url":"https://api.github.com/users/slandelle/followers","following_url":"https://api.github.com/users/slandelle/following{/other_user}","gists_url":"https://api.github.com/users/slandelle/gists{/gist_id}","starred_url":"https://api.github.com/users/slandelle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slandelle/subscriptions","organizations_url":"https://api.github.com/users/slandelle/orgs","repos_url":"https://api.github.com/users/slandelle/repos","events_url":"https://api.github.com/users/slandelle/events{/privacy}","received_events_url":"https://api.github.com/users/slandelle/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":1,"state":"open","created_at":"2016-01-28T16:09:59Z","updated_at":"2016-01-28T16:10:10Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-01-28T14:36:18Z","updated_at":"2016-01-29T10:25:26Z","closed_at":"2016-01-28T16:07:28Z","body":"Hi,\r\n\r\nWe're working with play framework 2.4.x and encounter problems when posting multipart form data to some webserver. Sometimes it happens that users upload empty files with size 0. In this case reading the Multipart body is stuck in an endless loop.\r\n\r\nI was able to reproduce this behavior with async-http-client-1.9.32:\r\n\r\n    final List<Part> parts = new ArrayList<>();\r\n    byte[] emptyByteAray = {};\r\n    parts.add(new ByteArrayPart(\"baPart\", emptyByteAray, \"application/test\", UTF_8, \"fileName\"));\r\n    final Body multipartBody = MultipartUtils.newMultipartBody(parts, new FluentCaseInsensitiveStringsMap());\r\n    final ByteBuffer buffer = ByteBuffer.allocate(8192);\r\n        try {\r\n            multipartBody.read(buffer);\r\n        } catch (IOException e) {\r\n            e.printStackTrace();\r\n        }\r\n\r\nI've also tested with async-http-client-project-2.0.0-RC7 and could not reproduce the issue anymore.\r\n\r\nWould you mind providing a fix for 1.9.x?"},"comment":{"url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/issues/comments/176683039","html_url":"https://github.com/AsyncHttpClient/async-http-client/issues/1089#issuecomment-176683039","issue_url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/issues/1089","id":176683039,"user":{"login":"matterche","id":1415368,"avatar_url":"https://avatars.githubusercontent.com/u/1415368?v=3","gravatar_id":"","url":"https://api.github.com/users/matterche","html_url":"https://github.com/matterche","followers_url":"https://api.github.com/users/matterche/followers","following_url":"https://api.github.com/users/matterche/following{/other_user}","gists_url":"https://api.github.com/users/matterche/gists{/gist_id}","starred_url":"https://api.github.com/users/matterche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matterche/subscriptions","organizations_url":"https://api.github.com/users/matterche/orgs","repos_url":"https://api.github.com/users/matterche/repos","events_url":"https://api.github.com/users/matterche/events{/privacy}","received_events_url":"https://api.github.com/users/matterche/received_events","type":"User","site_admin":false},"created_at":"2016-01-29T10:25:26Z","updated_at":"2016-01-29T10:25:26Z","body":"I see. Thanks again for fixing this so fast."}}