{"action":"created","issue":{"url":"https://api.github.com/repos/curl/curl/issues/703","repository_url":"https://api.github.com/repos/curl/curl","labels_url":"https://api.github.com/repos/curl/curl/issues/703/labels{/name}","comments_url":"https://api.github.com/repos/curl/curl/issues/703/comments","events_url":"https://api.github.com/repos/curl/curl/issues/703/events","html_url":"https://github.com/curl/curl/pull/703","id":139037392,"number":703,"title":"try to fix CONNECT blocking","user":{"login":"maxim-ky","id":1576180,"avatar_url":"https://avatars.githubusercontent.com/u/1576180?v=3","gravatar_id":"","url":"https://api.github.com/users/maxim-ky","html_url":"https://github.com/maxim-ky","followers_url":"https://api.github.com/users/maxim-ky/followers","following_url":"https://api.github.com/users/maxim-ky/following{/other_user}","gists_url":"https://api.github.com/users/maxim-ky/gists{/gist_id}","starred_url":"https://api.github.com/users/maxim-ky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxim-ky/subscriptions","organizations_url":"https://api.github.com/users/maxim-ky/orgs","repos_url":"https://api.github.com/users/maxim-ky/repos","events_url":"https://api.github.com/users/maxim-ky/events{/privacy}","received_events_url":"https://api.github.com/users/maxim-ky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"bagder","id":177011,"avatar_url":"https://avatars.githubusercontent.com/u/177011?v=3","gravatar_id":"","url":"https://api.github.com/users/bagder","html_url":"https://github.com/bagder","followers_url":"https://api.github.com/users/bagder/followers","following_url":"https://api.github.com/users/bagder/following{/other_user}","gists_url":"https://api.github.com/users/bagder/gists{/gist_id}","starred_url":"https://api.github.com/users/bagder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bagder/subscriptions","organizations_url":"https://api.github.com/users/bagder/orgs","repos_url":"https://api.github.com/users/bagder/repos","events_url":"https://api.github.com/users/bagder/events{/privacy}","received_events_url":"https://api.github.com/users/bagder/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2016-03-07T17:18:31Z","updated_at":"2016-03-08T18:58:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/curl/curl/pulls/703","html_url":"https://github.com/curl/curl/pull/703","diff_url":"https://github.com/curl/curl/pull/703.diff","patch_url":"https://github.com/curl/curl/pull/703.patch"},"body":"Hello, guys!\r\n\r\nI use curl multi-* API and as far as I understand it's supposed to be non-blocking. But I have an issue with HTTP proxy: during querying the proxy with CONNECT method (establishing a tunnel for an HTTPS session) libcurl blocks in curl_multi_socket_action until the proxy returns \"200 Connection established\". After some debugging I've found that actually libcurl blocks in multi_runsingle function. The code snippet below explains the details:\r\n\r\n```c\r\ndo {\r\n  switch( state ) {\r\n    case CURLM_STATE_WAITPROXYCONNECT:\r\n       // this unconditional statement causes that blocking\r\n       rc = CURLM_CALL_MULTI_PERFORM;\r\n    break;\r\n  };\r\n} while( rc == CURLM_CALL_MULTI_PERFORM );\r\n```\r\n\r\nIt seems we can not to block in the loop but wait a callback from curl_multi_socket_action. \r\nHere is the patch. It's working for me but still it looks pretty naive :) Please review it and give me a hint how to solve the faced issue in a proper way.\r\nI'm looking forward to hearing from you soon.\r\n\r\nRegards"},"comment":{"url":"https://api.github.com/repos/curl/curl/issues/comments/193915099","html_url":"https://github.com/curl/curl/pull/703#issuecomment-193915099","issue_url":"https://api.github.com/repos/curl/curl/issues/703","id":193915099,"user":{"login":"bagder","id":177011,"avatar_url":"https://avatars.githubusercontent.com/u/177011?v=3","gravatar_id":"","url":"https://api.github.com/users/bagder","html_url":"https://github.com/bagder","followers_url":"https://api.github.com/users/bagder/followers","following_url":"https://api.github.com/users/bagder/following{/other_user}","gists_url":"https://api.github.com/users/bagder/gists{/gist_id}","starred_url":"https://api.github.com/users/bagder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bagder/subscriptions","organizations_url":"https://api.github.com/users/bagder/orgs","repos_url":"https://api.github.com/users/bagder/repos","events_url":"https://api.github.com/users/bagder/events{/privacy}","received_events_url":"https://api.github.com/users/bagder/received_events","type":"User","site_admin":false},"created_at":"2016-03-08T18:58:13Z","updated_at":"2016-03-08T18:58:13Z","body":"> I have some doubts about connection timeouts. They were handled in a blocking manner in Curl_proxyCONNECT, but now are they okay?\r\n\r\nI don't think there's any connection timeout problem either with or without this suggested change. But I imagine you can test that fairly easily."}}