{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/43515543","id":43515543,"diff_hunk":"@@ -374,6 +374,27 @@ public void MaxRequestContentBufferSize_Set_ThrowsPlatformNotSupportedException(\n             }\n         }\n \n+        [Fact]\n+        public async Task SendAsync_ReadFromSlowStreamingServer_PartialDataReturned()\n+        {\n+            // TODO: This is a placeholder until GitHub Issue #2383 gets resolved.\n+            const string SlowStreamingServer = \"http://httpbin.org/drip?numbytes=8192&duration=15&delay=1&code=200\";","path":"src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs","position":9,"original_position":8,"commit_id":"00aa9e197a0c5615caeacb62cdc8822dba5a1397","original_commit_id":"e132426d513bb3e74394df4b46e4cbf7b88f105e","user":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars.githubusercontent.com/u/2642209?v=3","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"body":"FWIW, it currently takes ~20 seconds for me, when passing, on both Windows and Linux.","created_at":"2015-10-30T15:33:35Z","updated_at":"2015-10-30T15:33:35Z","html_url":"https://github.com/dotnet/corefx/pull/4255#discussion_r43515543","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/4255","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/43515543"},"html":{"href":"https://github.com/dotnet/corefx/pull/4255#discussion_r43515543"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/4255"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/4255","id":49210003,"html_url":"https://github.com/dotnet/corefx/pull/4255","diff_url":"https://github.com/dotnet/corefx/pull/4255.diff","patch_url":"https://github.com/dotnet/corefx/pull/4255.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/4255","number":4255,"state":"open","locked":false,"title":"WinHttpHandler ResponseStream reads should return back with partial data","user":{"login":"davidsh","id":7684835,"avatar_url":"https://avatars.githubusercontent.com/u/7684835?v=3","gravatar_id":"","url":"https://api.github.com/users/davidsh","html_url":"https://github.com/davidsh","followers_url":"https://api.github.com/users/davidsh/followers","following_url":"https://api.github.com/users/davidsh/following{/other_user}","gists_url":"https://api.github.com/users/davidsh/gists{/gist_id}","starred_url":"https://api.github.com/users/davidsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidsh/subscriptions","organizations_url":"https://api.github.com/users/davidsh/orgs","repos_url":"https://api.github.com/users/davidsh/repos","events_url":"https://api.github.com/users/davidsh/events{/privacy}","received_events_url":"https://api.github.com/users/davidsh/received_events","type":"User","site_admin":false},"body":".NET Stream.Read() semantics leave it to the implementation to decide how much data to return given a buffer of size N:\r\n\r\nhttps://msdn.microsoft.com/en-us/library/system.io.stream.read(v=vs.110).aspx\r\n\"An implementation is free to return fewer bytes than requested even if the end of the stream has not been reached.\"\r\n\r\nThe behavior of System.Net HTTP APIs (i.e. .NET Framework) are such that stream reads are able to return as soon as data is available. They don't wait until the provided buffer is full. The current WinHttpHandler was not behaving that way because it didn't call WinHttpQueryDataAvailable before calling WinHttpReadData. WinHttpQueryDataAvailable would indicate how many bytes can be read immediately.\r\n\r\nThis fix changes the WinHttpResponseStream.Read* methods to use WinHttpQueryDataAvailable before calling WinHttpReadData.\r\n\r\nAdded both WinHttpHandler unit tests (helps with simulating/testing network errors) and HttpClientHandler functional tests (which will test x-plat).\r\n\r\nFixes #1825","created_at":"2015-10-29T22:39:45Z","updated_at":"2015-10-30T15:33:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"295482912e262b76fb798fd92992ff0890f26198","assignee":{"login":"davidsh","id":7684835,"avatar_url":"https://avatars.githubusercontent.com/u/7684835?v=3","gravatar_id":"","url":"https://api.github.com/users/davidsh","html_url":"https://github.com/davidsh","followers_url":"https://api.github.com/users/davidsh/followers","following_url":"https://api.github.com/users/davidsh/following{/other_user}","gists_url":"https://api.github.com/users/davidsh/gists{/gist_id}","starred_url":"https://api.github.com/users/davidsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidsh/subscriptions","organizations_url":"https://api.github.com/users/davidsh/orgs","repos_url":"https://api.github.com/users/davidsh/repos","events_url":"https://api.github.com/users/davidsh/events{/privacy}","received_events_url":"https://api.github.com/users/davidsh/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/6","html_url":"https://github.com/dotnet/corefx/milestones/1.0.0-rc2","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/6/labels","id":1365455,"number":6,"title":"1.0.0-rc2","description":"","creator":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars.githubusercontent.com/u/1302850?v=3","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":73,"closed_issues":14,"state":"open","created_at":"2015-10-20T04:29:15Z","updated_at":"2015-10-30T14:15:48Z","due_on":"2016-02-01T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/4255/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/4255/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/4255/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/00aa9e197a0c5615caeacb62cdc8822dba5a1397","head":{"label":"davidsh:streaming_fix","ref":"streaming_fix","sha":"00aa9e197a0c5615caeacb62cdc8822dba5a1397","user":{"login":"davidsh","id":7684835,"avatar_url":"https://avatars.githubusercontent.com/u/7684835?v=3","gravatar_id":"","url":"https://api.github.com/users/davidsh","html_url":"https://github.com/davidsh","followers_url":"https://api.github.com/users/davidsh/followers","following_url":"https://api.github.com/users/davidsh/following{/other_user}","gists_url":"https://api.github.com/users/davidsh/gists{/gist_id}","starred_url":"https://api.github.com/users/davidsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidsh/subscriptions","organizations_url":"https://api.github.com/users/davidsh/orgs","repos_url":"https://api.github.com/users/davidsh/repos","events_url":"https://api.github.com/users/davidsh/events{/privacy}","received_events_url":"https://api.github.com/users/davidsh/received_events","type":"User","site_admin":false},"repo":{"id":31976766,"name":"corefx","full_name":"davidsh/corefx","owner":{"login":"davidsh","id":7684835,"avatar_url":"https://avatars.githubusercontent.com/u/7684835?v=3","gravatar_id":"","url":"https://api.github.com/users/davidsh","html_url":"https://github.com/davidsh","followers_url":"https://api.github.com/users/davidsh/followers","following_url":"https://api.github.com/users/davidsh/following{/other_user}","gists_url":"https://api.github.com/users/davidsh/gists{/gist_id}","starred_url":"https://api.github.com/users/davidsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidsh/subscriptions","organizations_url":"https://api.github.com/users/davidsh/orgs","repos_url":"https://api.github.com/users/davidsh/repos","events_url":"https://api.github.com/users/davidsh/events{/privacy}","received_events_url":"https://api.github.com/users/davidsh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davidsh/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.","fork":true,"url":"https://api.github.com/repos/davidsh/corefx","forks_url":"https://api.github.com/repos/davidsh/corefx/forks","keys_url":"https://api.github.com/repos/davidsh/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davidsh/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davidsh/corefx/teams","hooks_url":"https://api.github.com/repos/davidsh/corefx/hooks","issue_events_url":"https://api.github.com/repos/davidsh/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/davidsh/corefx/events","assignees_url":"https://api.github.com/repos/davidsh/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/davidsh/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/davidsh/corefx/tags","blobs_url":"https://api.github.com/repos/davidsh/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davidsh/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davidsh/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/davidsh/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davidsh/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/davidsh/corefx/languages","stargazers_url":"https://api.github.com/repos/davidsh/corefx/stargazers","contributors_url":"https://api.github.com/repos/davidsh/corefx/contributors","subscribers_url":"https://api.github.com/repos/davidsh/corefx/subscribers","subscription_url":"https://api.github.com/repos/davidsh/corefx/subscription","commits_url":"https://api.github.com/repos/davidsh/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/davidsh/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/davidsh/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/davidsh/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/davidsh/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/davidsh/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davidsh/corefx/merges","archive_url":"https://api.github.com/repos/davidsh/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davidsh/corefx/downloads","issues_url":"https://api.github.com/repos/davidsh/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/davidsh/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/davidsh/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/davidsh/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davidsh/corefx/labels{/name}","releases_url":"https://api.github.com/repos/davidsh/corefx/releases{/id}","created_at":"2015-03-10T19:16:38Z","updated_at":"2015-05-06T21:44:49Z","pushed_at":"2015-10-30T03:45:24Z","git_url":"git://github.com/davidsh/corefx.git","ssh_url":"git@github.com:davidsh/corefx.git","clone_url":"https://github.com/davidsh/corefx.git","svn_url":"https://github.com/davidsh/corefx","homepage":"","size":38179,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"6c106c380249ebd394ea5ad75103cfa6bf71abe0","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":26295345,"name":"corefx","full_name":"dotnet/corefx","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.","fork":false,"url":"https://api.github.com/repos/dotnet/corefx","forks_url":"https://api.github.com/repos/dotnet/corefx/forks","keys_url":"https://api.github.com/repos/dotnet/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefx/teams","hooks_url":"https://api.github.com/repos/dotnet/corefx/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefx/events","assignees_url":"https://api.github.com/repos/dotnet/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefx/tags","blobs_url":"https://api.github.com/repos/dotnet/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefx/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefx/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefx/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefx/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefx/subscription","commits_url":"https://api.github.com/repos/dotnet/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefx/merges","archive_url":"https://api.github.com/repos/dotnet/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefx/downloads","issues_url":"https://api.github.com/repos/dotnet/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefx/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefx/releases{/id}","created_at":"2014-11-06T23:42:48Z","updated_at":"2015-10-30T07:44:44Z","pushed_at":"2015-10-30T13:51:07Z","git_url":"git://github.com/dotnet/corefx.git","ssh_url":"git@github.com:dotnet/corefx.git","clone_url":"https://github.com/dotnet/corefx.git","svn_url":"https://github.com/dotnet/corefx","homepage":"http://dotnet.github.io/core/","size":89316,"stargazers_count":8506,"watchers_count":8506,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1873,"mirror_url":null,"open_issues_count":665,"forks":1873,"open_issues":665,"watchers":8506,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/4255"},"html":{"href":"https://github.com/dotnet/corefx/pull/4255"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/4255"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/4255/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/4255/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/4255/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/00aa9e197a0c5615caeacb62cdc8822dba5a1397"}}}}