{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/3033","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/3033/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/3033/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/3033/events","html_url":"https://github.com/dotnet/corefx/pull/3033","id":104107087,"number":3033,"title":"Fix error handling in WinHttpHandler StartRequest","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},"labels":[{"url":"https://api.github.com/repos/dotnet/corefx/labels/cla-already-signed","name":"cla-already-signed","color":"009800"},{"url":"https://api.github.com/repos/dotnet/corefx/labels/System.Net","name":"System.Net","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-08-31T18:28:49Z","updated_at":"2015-09-01T17:38:36Z","closed_at":"2015-09-01T14:11:00Z","pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/3033","html_url":"https://github.com/dotnet/corefx/pull/3033","diff_url":"https://github.com/dotnet/corefx/pull/3033.diff","patch_url":"https://github.com/dotnet/corefx/pull/3033.patch"},"body":"Addresses dnu restore exception 2547\r\n\r\nhttps://github.com/aspnet/dnx/issues/2547/\r\n\r\n* Fix a code path where `requestHandle` could be `null`.\r\n* Add unit test to simulate this error code path."},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/136806952","html_url":"https://github.com/dotnet/corefx/pull/3033#issuecomment-136806952","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/3033","id":136806952,"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},"created_at":"2015-09-01T17:38:36Z","updated_at":"2015-09-01T17:38:36Z","body":"@CIPop Regarding your comments questions:\r\n\r\n>Nit: This is a huge function and this error seems to be caused by lack of nearby context. Please consider refactoring into smaller functions to avoid these kind of bugs in the future.\r\nThis will be refactored during the async work #3000 \r\n\r\n>Would this work when requestHandle is invalid? (as in line 1141?)\r\nYes. `SafeWinHttpHandle` derives from `SafeHandleZeroOrMinusOneIsInvalid`.  WinHTTP returns NULL (0) when `WinHttpOpenRequest` fails.  When this non-null safehandle is passed into `SetStatusCallback`, it will generate an error from WinHTTP about invalid handle and handled there (line 2125).  I agree this is non-obvious and will be refactored during #3000."}}