Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Shutdown hijacked stdin #1567

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
Loading
from
Open

Shutdown hijacked stdin #1567

wants to merge 2 commits into from

Conversation

bsideup
Copy link
Member

@bsideup bsideup commented Mar 26, 2021

Fixes #1448

@bsideup
Copy link
Member Author

bsideup commented Mar 29, 2021

It looks like there are two challenges with this:

  1. OkHttp + TCP transport does not pass
  2. Npipe does not implement shutdownOutput properly

putting on hold for now

@luneo7
Copy link

luneo7 commented May 13, 2022

Tested you branch and just changing com.github.dockerjava.okhttp.HijackingInterceptor thread to something like

Thread thread = new Thread(() -> {
    try {
        try (BufferedSink sink = streams.sink) {
            while (sink.isOpen()) {
                int aByte = stdin.read();
                if (aByte < 0) {
                    break;
                }
                sink.writeByte(aByte);
                sink.emit();
            }
        }
        Connection connection = chain.connection();
        if (connection != null) {
            connection.socket().shutdownOutput();
        }
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
});

Makes it work with Okhttp3 =]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stdin remains open in Docker container after closing it on docker-java side via OkHttp
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.