-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
bytes_read for hijacked connections? #5728
Comments
This could probably be done, but it will take some careful work :) |
I guess I will just use reflection meanwhile. :) |
I guess we can probably export |
While we are on this, can you also export |
Exporting |
Yes but that is read-only. I am trying to add to the counter... |
https://man7.org/linux/man-pages/man2/splice.2.html Linux syscall splice takes fds directly and returns copied bytes. It is not feasible to use |
Ah, that makes sense. We could maybe add an
I'm not sure I understand, are you saying "nevermind I don't need it actually" with that? |
Quite the opposite. I was explaining why I needed those. Currently I am using reflection like this. |
Okay. Would It's awkward, we can't rename |
Yes that would work, and I also would like an API for getting the underlying |
I'm not sure I understand, your code is what calls |
That is indeed what my code is doing. I am just wondering if the reflection part I highlighted above can be replaced with stable API. :) |
I wonder, should we be counting the bytes written even after a hijack? |
It would be a good idea not to for the reasons I specified above (kernel space io.Copy). Exposing a separate interface for logging bytes is preferred? |
I'm lost at this point. What's the status quo? Do we still need #5807? Is it useful? |
I think #5807 needs also support for updating read bytes... |
It's exported, you can just increment |
That's written bytes. I think the API for bytes read is |
Ah, so you're asking for @mholt are you ok with exporting that too? |
If we do, we'd essentially be replacing the interface with a concrete type: I don't know anywhere that we use the interface with another type, so that should be fine. |
@mholt I'm trying to do that now, but I get errors all over, like:
I don't quite understand how to do this, apparently it can't be an |
@Mygod at this point I don't think I'll be able to finish this, so it might make more sense if you write the PR for this. |
@Mygod If you really want to use the underlying |
Is there anyway to add
bytes_read
to the entry if the connection is hijacked, like in forwardproxy?lengthReader
is not exported. 🤔The text was updated successfully, but these errors were encountered: