{"action":"created","issue":{"url":"https://api.github.com/repos/square/okhttp/issues/2270","labels_url":"https://api.github.com/repos/square/okhttp/issues/2270/labels{/name}","comments_url":"https://api.github.com/repos/square/okhttp/issues/2270/comments","events_url":"https://api.github.com/repos/square/okhttp/issues/2270/events","html_url":"https://github.com/square/okhttp/issues/2270","id":128016821,"number":2270,"title":"[Websocket] Configure frame size to avoid payload splitting.","user":{"login":"rdtorres","id":1977787,"avatar_url":"https://avatars.githubusercontent.com/u/1977787?v=3","gravatar_id":"","url":"https://api.github.com/users/rdtorres","html_url":"https://github.com/rdtorres","followers_url":"https://api.github.com/users/rdtorres/followers","following_url":"https://api.github.com/users/rdtorres/following{/other_user}","gists_url":"https://api.github.com/users/rdtorres/gists{/gist_id}","starred_url":"https://api.github.com/users/rdtorres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdtorres/subscriptions","organizations_url":"https://api.github.com/users/rdtorres/orgs","repos_url":"https://api.github.com/users/rdtorres/repos","events_url":"https://api.github.com/users/rdtorres/events{/privacy}","received_events_url":"https://api.github.com/users/rdtorres/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/square/okhttp/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/square/okhttp/milestones/16","html_url":"https://github.com/square/okhttp/milestones/3.1","labels_url":"https://api.github.com/repos/square/okhttp/milestones/16/labels","id":1460477,"number":16,"title":"3.1","description":"Goal: update the response cache.","creator":{"login":"swankjesse","id":133019,"avatar_url":"https://avatars.githubusercontent.com/u/133019?v=3","gravatar_id":"","url":"https://api.github.com/users/swankjesse","html_url":"https://github.com/swankjesse","followers_url":"https://api.github.com/users/swankjesse/followers","following_url":"https://api.github.com/users/swankjesse/following{/other_user}","gists_url":"https://api.github.com/users/swankjesse/gists{/gist_id}","starred_url":"https://api.github.com/users/swankjesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swankjesse/subscriptions","organizations_url":"https://api.github.com/users/swankjesse/orgs","repos_url":"https://api.github.com/users/swankjesse/repos","events_url":"https://api.github.com/users/swankjesse/events{/privacy}","received_events_url":"https://api.github.com/users/swankjesse/received_events","type":"User","site_admin":false},"open_issues":38,"closed_issues":4,"state":"open","created_at":"2015-12-15T00:29:28Z","updated_at":"2016-01-23T02:11:59Z","due_on":"2016-03-27T04:00:00Z","closed_at":null},"comments":4,"created_at":"2016-01-21T20:51:24Z","updated_at":"2016-01-26T03:51:31Z","closed_at":null,"body":"Before version 2.5 of okhttp-ws, client was passing a **Buffer** and it was sent as specified by the client.\r\n\r\nOn version 2.6, the implementation migrated to use **RequestBody** and **ResponseBody**. By doing this all payload sent to server are truncated at 2048 (size of the **Segment**). If the payload is bigger than 2048, then the implementation sends the remaining data as a continuation frame.\r\n\r\nAccording to [RFC](https://tools.ietf.org/html/rfc6455#page-27), there is nothing wrong by splitting the payload into multiple frames.\r\n\r\nBut in my opinion this splitting is unnecessary and it should have an option to define the max desired frame size to avoid splitting.\r\n"},"comment":{"url":"https://api.github.com/repos/square/okhttp/issues/comments/174804649","html_url":"https://github.com/square/okhttp/issues/2270#issuecomment-174804649","issue_url":"https://api.github.com/repos/square/okhttp/issues/2270","id":174804649,"user":{"login":"JakeWharton","id":66577,"avatar_url":"https://avatars.githubusercontent.com/u/66577?v=3","gravatar_id":"","url":"https://api.github.com/users/JakeWharton","html_url":"https://github.com/JakeWharton","followers_url":"https://api.github.com/users/JakeWharton/followers","following_url":"https://api.github.com/users/JakeWharton/following{/other_user}","gists_url":"https://api.github.com/users/JakeWharton/gists{/gist_id}","starred_url":"https://api.github.com/users/JakeWharton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakeWharton/subscriptions","organizations_url":"https://api.github.com/users/JakeWharton/orgs","repos_url":"https://api.github.com/users/JakeWharton/repos","events_url":"https://api.github.com/users/JakeWharton/events{/privacy}","received_events_url":"https://api.github.com/users/JakeWharton/received_events","type":"User","site_admin":false},"created_at":"2016-01-26T03:51:31Z","updated_at":"2016-01-26T03:51:31Z","body":"Ideally we could optimize for the buffered case, but Okio makes it hard. I'm not sure that _just_ a known content length should be enough to trigger buffering since you could easily have a known length from a multi-gigabyte file!\r\n\r\nWe should figure something out for already-buffered types though for your case. Those where you've used a `String`, `byte[]`, or `ByteString` and the data is already in memory. Ideally this would work without the need to hand-customize some size."}}