Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix -loops failure with large-data-transfers #60

Merged
merged 1 commit into from
Aug 2, 2019

Conversation

hwangcc23
Copy link
Contributor

The -loops option is broken after merging the pull-request #57 (#57).

Here is a sample transcript to reproduce the problem.
hwangcc23-BU401LG:~$ dd 'if=/dev/zero' 'bs=2000' 'count=1000' | tr '\000' 'a' | xclip -i -quiet -l 1

Expect: xclip should exist right after any requestor (ex: xclip -o) retrieved data.
What I saw: xclip didn't exist.

Break out the while(1) loop once there is one SelectionRequest completed such that dloop can be decreased by one and compared to sleep for fixing the problem.

The -loops option is broken after merging the pull-request astrand#57 (astrand#57).

Here is a sample transcript to reproduce the problem.
hwangcc23-BU401LG:~$ dd 'if=/dev/zero' 'bs=2000' 'count=1000' | tr '\000' 'a' | xclip -i -quiet -l 1

Expect: xclip should exist right after any requestor (ex: `xclip -o`) retrieved data.
What I saw: xclip didn't exist.

Break out the while(1) loop once there is one SelectionRequest completed such that dloop can be decreased by one and compared to sleep for fixing the problem.
@hwangcc23
Copy link
Contributor Author

Fix #59

@mckellyln
Copy link

mckellyln commented Jul 24, 2019

Hi. This works, but I think we should not remove the other check, as in:

	    if (finished) {
	        del_requestor(requestor);
                break;
	    }

	    if (!requestors) {
	        break;
	    }

Maybe tho it doesn't matter.
I originally had this fix:

            if (sloop > 0 && finished)
                break;

	    if (finished) {
	        del_requestor(requestor);
	    }

	    if (!requestors) {
	        break;
	    }

@hwangcc23
Copy link
Contributor Author

I think it it better to have the outter loop handle sloop/dloop and the inner loop handle SelectionRequest. :)

@hwangcc23
Copy link
Contributor Author

@astrand The patch is tested by @mckellyln. Could you review the code and merge it? Thanks.

@astrand astrand merged commit 040c6af into astrand:master Aug 2, 2019
@hwangcc23 hwangcc23 deleted the fix-loop-1 branch August 5, 2019 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants