Skip to content

Conversation

@makavity
Copy link

Resolves #8

Maybe it is not the best solution, but it works :D
Big chunk works, small chunks also works.

Optimized tls_filter interaction with rustls: improved read operation management, non-blocking handling, and full-duplex connection support (WebSocket).

@makavity makavity marked this pull request as draft November 15, 2025 17:42
@makavity
Copy link
Author

UPD: Sometimes it hangs. Investigating.

@makavity makavity marked this pull request as ready for review November 16, 2025 15:51
@makavity
Copy link
Author

makavity commented Nov 16, 2025

@icing now it works fine.. Could you take a look on that?
https://httpd.apache.org/docs/trunk/developer/output-filters.html

Used this doc to refactor it..

@makavity
Copy link
Author

Ah, forgot to describe. Also it fixes bug with websocket session. If I send frame 427Kb, it will be closed immediately.

@icing
Copy link
Owner

icing commented Nov 17, 2025

These changes are larger than I expected. I added basic websocket test cases in #11 and we need to reproduce the problems we try to fix there. Without test cases, this would be fragile.

icing and others added 2 commits November 17, 2025 23:03
* add websocket test cases
* add websockets to python requirements
@makavity
Copy link
Author

removed some debug logs, what was treat as error

icing added a commit that referenced this pull request Nov 18, 2025
test_tls_18_04 reproduces the problem with handling pending plain
data in rustls. Disabled here, awaiting a fix like in #9.
@icing icing mentioned this pull request Nov 18, 2025
icing added a commit that referenced this pull request Nov 18, 2025
* add wss test cases for accessing a wss: server via httpd
* would like to extend that to https: but pyhtons websocket client is flaky in CI

test_tls_18_04 reproduces the problem with handling pending plain
data in rustls. Disabled here, awaiting a fix like in #9.
@icing
Copy link
Owner

icing commented Nov 18, 2025

@makavity I made a reproducer of the problem in #12 (now merged into master). Applying this PR (with some minor fixes) makes the test pass. I include my diff below. It fixes some compiler warnings and I replaced the "pending byte count" with a flag that gets clear once rustls reports everything has been read. Hope I did not break anything.

It's probably easiest if you rebase your PR on master.

My adaptations to your PR in #13

* add wss test cases for accessing a wss: server via httpd
* would like to extend that to https: but pyhtons websocket client is flaky in CI

test_tls_18_04 reproduces the problem with handling pending plain
data in rustls. Disabled here, awaiting a fix like in icing#9.
@makavity
Copy link
Author

@icing thank you, i've rebased PR.

@icing
Copy link
Owner

icing commented Nov 18, 2025

CI complains mainly about the used paramter. Could you fix that?

@makavity
Copy link
Author

Oh, one second, should I apply your patch you meant in previous message?

@makavity
Copy link
Author

I think not. I'll force push rollback. Sorry.

@icing
Copy link
Owner

icing commented Nov 18, 2025

Now, things seem a bit messed up now. I did want to confuse you.

Seeing my changes to the test code in this PR now means you cherry picked those? This confused git a little. Usually, when we say "rebasing" a PR, we mean something like the following:

PR-branch> git checkout master
master> git pull upstream master
...incoming changes...
master> git checkout PR-branch
PR-branch> git rebase master
...adds commits from mater to PR-branch, set branch anchor to current master...

This leaves only your own commits as part of a pull request and lets you resolve potential conflicts.

@icing
Copy link
Owner

icing commented Nov 18, 2025

I think not. I'll force push rollback. Sorry.

no problem, we'll get there.

@makavity
Copy link
Author

makavity commented Nov 18, 2025

Okay, now we fine. Also removed unused variable.
Sorry for my mistake :)

icing added a commit that referenced this pull request Nov 18, 2025
Taking the changes from #9, fixiing some compiler errors and replacing
the "pending data" count with a boolean flag that gets cleared when
the rustls plain text is completely read.
@icing icing mentioned this pull request Nov 18, 2025
@makavity
Copy link
Author

I think, we should close this PR due to #13

@icing
Copy link
Owner

icing commented Nov 18, 2025

I think, we should close this PR due to #13

Thanks. I think that makes sense. I am debugging the changes as CI shows failures with the changes. Will update you once I know more.

@makavity
Copy link
Author

Thank you :)

@makavity makavity closed this Nov 18, 2025
icing added a commit that referenced this pull request Nov 19, 2025
A flush of data was missing in the outgoing filter for backend
conenctions that did not end in a meta bucket. This caused stalls
of websocket frames from the client to never reach the backend.

Rework filter logging to give a better picture of what is happening.

refs #9
@icing icing mentioned this pull request Nov 19, 2025
icing added a commit that referenced this pull request Nov 19, 2025
A flush of data was missing in the outgoing filter for backend
conenctions that did not end in a meta bucket. This caused stalls
of websocket frames from the client to never reach the backend.

Rework filter logging to give a better picture of what is happening.

refs #9
@icing
Copy link
Owner

icing commented Nov 19, 2025

@makavity I fixed the issue I reproduced in #14, now merged into master. If you still see problems with this version, please open a new issue.

Thanks for your work on this!

@makavity
Copy link
Author

@icing thank you for your project. It saved a lot of my time :)

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.

Websocket connection one event behind

2 participants