{"action":"created","comment":{"url":"https://api.github.com/repos/bittorrent/libutp/pulls/comments/55904201","id":55904201,"diff_hunk":"@@ -1903,10 +1903,21 @@ size_t utp_process_incoming(UTPSocket *conn, const byte *packet, size_t len, boo\n \n \t// if we get the same ack_nr as in the last packet\n \t// increase the duplicate_ack counter, otherwise reset\n-\t// it to 0\n+\t// it to 0.\n+\t// It's important to only count ACKs in ST_STATE packets. Any other\n+\t// packet (primarily ST_DATA) is likely to have been sent because of the\n+\t// other end having new outgoing data, not in response to incoming data.\n+\t// For instance, if we're receiving a steady stream of payload with no\n+\t// outgoing data, and we suddently have a few bytes of payload to send (say,\n+\t// a bittorrent HAVE message), we're very likely to see 3 duplicate ACKs\n+\t// immediately after sending our payload packet. This effectively disables\n+\t// the fast-resend on duplicate-ack logic for bi-directional connections\n+\t// (except in the case of a selective ACK). This is in line with BSD4.4 TCP\n+\t// implementation.\n \tif (conn->cur_window_packets > 0) {\n \t\tif (pk_ack_nr == ((conn->seq_nr - conn->cur_window_packets - 1) & ACK_NR_MASK)\n-\t\t\t&& conn->cur_window_packets > 0) {\n+\t\t\t&& conn->cur_window_packets > 0\n+\t\t\t&& pk_flags == ST_STATE) {","path":"utp_internal.cpp","position":20,"original_position":20,"commit_id":"5a6754da0c6431b81f197493c67bdcdc638e7d6d","original_commit_id":"5a6754da0c6431b81f197493c67bdcdc638e7d6d","user":{"login":"jpcottin","id":768943,"avatar_url":"https://avatars.githubusercontent.com/u/768943?v=3","gravatar_id":"","url":"https://api.github.com/users/jpcottin","html_url":"https://github.com/jpcottin","followers_url":"https://api.github.com/users/jpcottin/followers","following_url":"https://api.github.com/users/jpcottin/following{/other_user}","gists_url":"https://api.github.com/users/jpcottin/gists{/gist_id}","starred_url":"https://api.github.com/users/jpcottin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpcottin/subscriptions","organizations_url":"https://api.github.com/users/jpcottin/orgs","repos_url":"https://api.github.com/users/jpcottin/repos","events_url":"https://api.github.com/users/jpcottin/events{/privacy}","received_events_url":"https://api.github.com/users/jpcottin/received_events","type":"User","site_admin":false},"body":"ok, lgtm","created_at":"2016-03-11T23:23:24Z","updated_at":"2016-03-11T23:23:24Z","html_url":"https://github.com/bittorrent/libutp/pull/87#discussion_r55904201","pull_request_url":"https://api.github.com/repos/bittorrent/libutp/pulls/87","_links":{"self":{"href":"https://api.github.com/repos/bittorrent/libutp/pulls/comments/55904201"},"html":{"href":"https://github.com/bittorrent/libutp/pull/87#discussion_r55904201"},"pull_request":{"href":"https://api.github.com/repos/bittorrent/libutp/pulls/87"}}},"pull_request":{"url":"https://api.github.com/repos/bittorrent/libutp/pulls/87","id":62614780,"html_url":"https://github.com/bittorrent/libutp/pull/87","diff_url":"https://github.com/bittorrent/libutp/pull/87.diff","patch_url":"https://github.com/bittorrent/libutp/pull/87.patch","issue_url":"https://api.github.com/repos/bittorrent/libutp/issues/87","number":87,"state":"open","locked":false,"title":"prevent bi-directional connections from triggering duplicate-ack fast-retransmits","user":{"login":"arvidn","id":661450,"avatar_url":"https://avatars.githubusercontent.com/u/661450?v=3","gravatar_id":"","url":"https://api.github.com/users/arvidn","html_url":"https://github.com/arvidn","followers_url":"https://api.github.com/users/arvidn/followers","following_url":"https://api.github.com/users/arvidn/following{/other_user}","gists_url":"https://api.github.com/users/arvidn/gists{/gist_id}","starred_url":"https://api.github.com/users/arvidn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arvidn/subscriptions","organizations_url":"https://api.github.com/users/arvidn/orgs","repos_url":"https://api.github.com/users/arvidn/repos","events_url":"https://api.github.com/users/arvidn/events{/privacy}","received_events_url":"https://api.github.com/users/arvidn/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-11T22:53:30Z","updated_at":"2016-03-11T23:23:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aecfa044df7015cbc7c350f936881118169423ce","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bittorrent/libutp/pulls/87/commits","review_comments_url":"https://api.github.com/repos/bittorrent/libutp/pulls/87/comments","review_comment_url":"https://api.github.com/repos/bittorrent/libutp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bittorrent/libutp/issues/87/comments","statuses_url":"https://api.github.com/repos/bittorrent/libutp/statuses/5a6754da0c6431b81f197493c67bdcdc638e7d6d","head":{"label":"arvidn:master","ref":"master","sha":"5a6754da0c6431b81f197493c67bdcdc638e7d6d","user":{"login":"arvidn","id":661450,"avatar_url":"https://avatars.githubusercontent.com/u/661450?v=3","gravatar_id":"","url":"https://api.github.com/users/arvidn","html_url":"https://github.com/arvidn","followers_url":"https://api.github.com/users/arvidn/followers","following_url":"https://api.github.com/users/arvidn/following{/other_user}","gists_url":"https://api.github.com/users/arvidn/gists{/gist_id}","starred_url":"https://api.github.com/users/arvidn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arvidn/subscriptions","organizations_url":"https://api.github.com/users/arvidn/orgs","repos_url":"https://api.github.com/users/arvidn/repos","events_url":"https://api.github.com/users/arvidn/events{/privacy}","received_events_url":"https://api.github.com/users/arvidn/received_events","type":"User","site_admin":false},"repo":{"id":53701488,"name":"libutp","full_name":"arvidn/libutp","owner":{"login":"arvidn","id":661450,"avatar_url":"https://avatars.githubusercontent.com/u/661450?v=3","gravatar_id":"","url":"https://api.github.com/users/arvidn","html_url":"https://github.com/arvidn","followers_url":"https://api.github.com/users/arvidn/followers","following_url":"https://api.github.com/users/arvidn/following{/other_user}","gists_url":"https://api.github.com/users/arvidn/gists{/gist_id}","starred_url":"https://api.github.com/users/arvidn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arvidn/subscriptions","organizations_url":"https://api.github.com/users/arvidn/orgs","repos_url":"https://api.github.com/users/arvidn/repos","events_url":"https://api.github.com/users/arvidn/events{/privacy}","received_events_url":"https://api.github.com/users/arvidn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/arvidn/libutp","description":"uTorrent Transport Protocol library","fork":true,"url":"https://api.github.com/repos/arvidn/libutp","forks_url":"https://api.github.com/repos/arvidn/libutp/forks","keys_url":"https://api.github.com/repos/arvidn/libutp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arvidn/libutp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arvidn/libutp/teams","hooks_url":"https://api.github.com/repos/arvidn/libutp/hooks","issue_events_url":"https://api.github.com/repos/arvidn/libutp/issues/events{/number}","events_url":"https://api.github.com/repos/arvidn/libutp/events","assignees_url":"https://api.github.com/repos/arvidn/libutp/assignees{/user}","branches_url":"https://api.github.com/repos/arvidn/libutp/branches{/branch}","tags_url":"https://api.github.com/repos/arvidn/libutp/tags","blobs_url":"https://api.github.com/repos/arvidn/libutp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arvidn/libutp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arvidn/libutp/git/refs{/sha}","trees_url":"https://api.github.com/repos/arvidn/libutp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arvidn/libutp/statuses/{sha}","languages_url":"https://api.github.com/repos/arvidn/libutp/languages","stargazers_url":"https://api.github.com/repos/arvidn/libutp/stargazers","contributors_url":"https://api.github.com/repos/arvidn/libutp/contributors","subscribers_url":"https://api.github.com/repos/arvidn/libutp/subscribers","subscription_url":"https://api.github.com/repos/arvidn/libutp/subscription","commits_url":"https://api.github.com/repos/arvidn/libutp/commits{/sha}","git_commits_url":"https://api.github.com/repos/arvidn/libutp/git/commits{/sha}","comments_url":"https://api.github.com/repos/arvidn/libutp/comments{/number}","issue_comment_url":"https://api.github.com/repos/arvidn/libutp/issues/comments{/number}","contents_url":"https://api.github.com/repos/arvidn/libutp/contents/{+path}","compare_url":"https://api.github.com/repos/arvidn/libutp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arvidn/libutp/merges","archive_url":"https://api.github.com/repos/arvidn/libutp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arvidn/libutp/downloads","issues_url":"https://api.github.com/repos/arvidn/libutp/issues{/number}","pulls_url":"https://api.github.com/repos/arvidn/libutp/pulls{/number}","milestones_url":"https://api.github.com/repos/arvidn/libutp/milestones{/number}","notifications_url":"https://api.github.com/repos/arvidn/libutp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arvidn/libutp/labels{/name}","releases_url":"https://api.github.com/repos/arvidn/libutp/releases{/id}","deployments_url":"https://api.github.com/repos/arvidn/libutp/deployments","created_at":"2016-03-11T22:51:45Z","updated_at":"2016-03-11T22:51:46Z","pushed_at":"2016-03-11T22:53:00Z","git_url":"git://github.com/arvidn/libutp.git","ssh_url":"git@github.com:arvidn/libutp.git","clone_url":"https://github.com/arvidn/libutp.git","svn_url":"https://github.com/arvidn/libutp","homepage":"http://github.com/bittorrent/libutp","size":238,"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":"bittorrent:master","ref":"master","sha":"49692b8dcbc0b96d282423afeb5d9ffde87ab741","user":{"login":"bittorrent","id":142253,"avatar_url":"https://avatars.githubusercontent.com/u/142253?v=3","gravatar_id":"","url":"https://api.github.com/users/bittorrent","html_url":"https://github.com/bittorrent","followers_url":"https://api.github.com/users/bittorrent/followers","following_url":"https://api.github.com/users/bittorrent/following{/other_user}","gists_url":"https://api.github.com/users/bittorrent/gists{/gist_id}","starred_url":"https://api.github.com/users/bittorrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bittorrent/subscriptions","organizations_url":"https://api.github.com/users/bittorrent/orgs","repos_url":"https://api.github.com/users/bittorrent/repos","events_url":"https://api.github.com/users/bittorrent/events{/privacy}","received_events_url":"https://api.github.com/users/bittorrent/received_events","type":"Organization","site_admin":false},"repo":{"id":678022,"name":"libutp","full_name":"bittorrent/libutp","owner":{"login":"bittorrent","id":142253,"avatar_url":"https://avatars.githubusercontent.com/u/142253?v=3","gravatar_id":"","url":"https://api.github.com/users/bittorrent","html_url":"https://github.com/bittorrent","followers_url":"https://api.github.com/users/bittorrent/followers","following_url":"https://api.github.com/users/bittorrent/following{/other_user}","gists_url":"https://api.github.com/users/bittorrent/gists{/gist_id}","starred_url":"https://api.github.com/users/bittorrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bittorrent/subscriptions","organizations_url":"https://api.github.com/users/bittorrent/orgs","repos_url":"https://api.github.com/users/bittorrent/repos","events_url":"https://api.github.com/users/bittorrent/events{/privacy}","received_events_url":"https://api.github.com/users/bittorrent/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bittorrent/libutp","description":"uTorrent Transport Protocol library","fork":false,"url":"https://api.github.com/repos/bittorrent/libutp","forks_url":"https://api.github.com/repos/bittorrent/libutp/forks","keys_url":"https://api.github.com/repos/bittorrent/libutp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bittorrent/libutp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bittorrent/libutp/teams","hooks_url":"https://api.github.com/repos/bittorrent/libutp/hooks","issue_events_url":"https://api.github.com/repos/bittorrent/libutp/issues/events{/number}","events_url":"https://api.github.com/repos/bittorrent/libutp/events","assignees_url":"https://api.github.com/repos/bittorrent/libutp/assignees{/user}","branches_url":"https://api.github.com/repos/bittorrent/libutp/branches{/branch}","tags_url":"https://api.github.com/repos/bittorrent/libutp/tags","blobs_url":"https://api.github.com/repos/bittorrent/libutp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bittorrent/libutp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bittorrent/libutp/git/refs{/sha}","trees_url":"https://api.github.com/repos/bittorrent/libutp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bittorrent/libutp/statuses/{sha}","languages_url":"https://api.github.com/repos/bittorrent/libutp/languages","stargazers_url":"https://api.github.com/repos/bittorrent/libutp/stargazers","contributors_url":"https://api.github.com/repos/bittorrent/libutp/contributors","subscribers_url":"https://api.github.com/repos/bittorrent/libutp/subscribers","subscription_url":"https://api.github.com/repos/bittorrent/libutp/subscription","commits_url":"https://api.github.com/repos/bittorrent/libutp/commits{/sha}","git_commits_url":"https://api.github.com/repos/bittorrent/libutp/git/commits{/sha}","comments_url":"https://api.github.com/repos/bittorrent/libutp/comments{/number}","issue_comment_url":"https://api.github.com/repos/bittorrent/libutp/issues/comments{/number}","contents_url":"https://api.github.com/repos/bittorrent/libutp/contents/{+path}","compare_url":"https://api.github.com/repos/bittorrent/libutp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bittorrent/libutp/merges","archive_url":"https://api.github.com/repos/bittorrent/libutp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bittorrent/libutp/downloads","issues_url":"https://api.github.com/repos/bittorrent/libutp/issues{/number}","pulls_url":"https://api.github.com/repos/bittorrent/libutp/pulls{/number}","milestones_url":"https://api.github.com/repos/bittorrent/libutp/milestones{/number}","notifications_url":"https://api.github.com/repos/bittorrent/libutp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bittorrent/libutp/labels{/name}","releases_url":"https://api.github.com/repos/bittorrent/libutp/releases{/id}","deployments_url":"https://api.github.com/repos/bittorrent/libutp/deployments","created_at":"2010-05-20T22:32:57Z","updated_at":"2016-03-09T16:22:41Z","pushed_at":"2016-03-11T22:53:30Z","git_url":"git://github.com/bittorrent/libutp.git","ssh_url":"git@github.com:bittorrent/libutp.git","clone_url":"https://github.com/bittorrent/libutp.git","svn_url":"https://github.com/bittorrent/libutp","homepage":"http://github.com/bittorrent/libutp","size":381,"stargazers_count":435,"watchers_count":435,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":109,"mirror_url":null,"open_issues_count":27,"forks":109,"open_issues":27,"watchers":435,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bittorrent/libutp/pulls/87"},"html":{"href":"https://github.com/bittorrent/libutp/pull/87"},"issue":{"href":"https://api.github.com/repos/bittorrent/libutp/issues/87"},"comments":{"href":"https://api.github.com/repos/bittorrent/libutp/issues/87/comments"},"review_comments":{"href":"https://api.github.com/repos/bittorrent/libutp/pulls/87/comments"},"review_comment":{"href":"https://api.github.com/repos/bittorrent/libutp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bittorrent/libutp/pulls/87/commits"},"statuses":{"href":"https://api.github.com/repos/bittorrent/libutp/statuses/5a6754da0c6431b81f197493c67bdcdc638e7d6d"}}}}