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

stdin -> docker exec is closed too early #82

Open
moul opened this issue Jul 15, 2016 · 3 comments
Open

stdin -> docker exec is closed too early #82

moul opened this issue Jul 15, 2016 · 3 comments
Assignees
Milestone

Comments

@moul
Copy link
Owner

moul commented Jul 15, 2016

No description provided.

@moul moul added the bug label Jul 15, 2016
@moul moul self-assigned this Jul 15, 2016
@moul
Copy link
Owner Author

moul commented Jul 15, 2016

testing

server

hook script always accept the connection but sleep during two seconds to simulate some API calls etc

$ make && ./ssh2docker -V --publickey-auth-script=./examples/sleep-yes-publickey-auth-script
...

client

done: printing 50 lines in 0.5sec
result: nothing is printed

$ assh sockets flush; (for i in {1..50}; do echo $i; sleep .01; done) | ssh ubuntu@localhost -p 2222 -- cat -e; assh sockets flush

done: printing 50 lines in 5 secs
result:

  • we can see 25 lines that should be the output of the buffer
  • then we can see 25 lines without '$' at the end of the line, which are the 25 buffered lines, sent in one-shot to the cat -e in the docker exec
  • then we can see 25 lines with a $ at the end, which are the result of the cat -e on the buffered lines
  • and finally, we can see the rest of the lines treated line by line by the cat -e, without buffering
$ assh sockets flush; (for i in {1..50}; do echo $i; sleep .1; done) | ssh ubuntu@localhost -p 2222 -- cat -e; assh sockets flush
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
1$
2$
3$
4$
5$
6$
7$
8$
9$
10$
11$
12$
13$
14$
15$
16$
17$
18$
19$
20$
21$
22$
23$
24$
25$
26$
27
27$
28
28$
29
29$
30
30$
31
31$
32
32$
33
33$
34
34$
35
35$
36
36$
37
37$
38
38$
39
39$
40
40$
41
41$
42
42$
43
43$
44
44$
45
45$
46
46$
47
47$
48
48$
49
49$
50
50$

@moul
Copy link
Owner Author

moul commented Jul 15, 2016

@QuentinPerez, I will need some help :p

This was referenced Jul 15, 2016
@moul moul modified the milestone: v1.3.0 Jul 15, 2016
@moul
Copy link
Owner Author

moul commented Jul 19, 2016

Partially fixed :)

@moul moul added the ready label Dec 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant