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

bufferevent_ssl is missing evbuffer_freeze protection #1469

Open
thefallentree opened this issue Jun 4, 2023 · 4 comments
Open

bufferevent_ssl is missing evbuffer_freeze protection #1469

thefallentree opened this issue Jun 4, 2023 · 4 comments

Comments

@thefallentree
Copy link

if (evbuffer_drain(output, n_written))

in here bufferevent_ssl is doing a evbuffer_drain without unfreezing and freezing the output . And further more, the consider_writing() return code isn't actually checked, which means if the buffer is freezed from outside , the bufferevent_ssl will repeatedly send same content over and over without draining it from the buffeer.

@thefallentree
Copy link
Author

actually what is the protocol for freeze and unfreeze? should evbuffer be kept frozen most of the time or should it not ? It's unclear from the doc. evbuffer_sock , evbuffer_sockpari, and evbuffer_ssl does different things. evhttp also kept the buffer freezed

@azat
Copy link
Member

azat commented Jun 21, 2023

Hello, thanks for the report!

It is a good idea to add freezing to SSL layer.
Can you submit a PR?

@thefallentree
Copy link
Author

@azat : is there documentation around what freezing is intended for and the what is the right protocol here? (For example: should various layer keep buffer freezed in front at all time, and unfreezed in the tail or something else? )

@azat
Copy link
Member

azat commented Jul 9, 2023

Sorry for the delay.

is there documentation around what freezing is intended for and the what is the right protocol here? (For example: should various layer keep buffer freezed in front at all time, and unfreezed in the tail or something else? )

There is not a lot of developers-related documentation (sadly), but all bufferevents implementations should follow the same patterns or describe why it is not possible. I don't see any reasons for not freeze the buffer for SSL.

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

No branches or pull requests

2 participants