-
Notifications
You must be signed in to change notification settings - Fork 5
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
rework deproxy server #572
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to use single underscore _
for internal variables, double underscore __
is intended to avoid conflicts in subclasses.
framework/deproxy_server.py
Outdated
# This parameter controls whether to keep original data with the request | ||
# (See deproxy.HttpMessage.original_data) | ||
self.keep_original_data = kwargs.pop("keep_original_data", None) | ||
class StaticDeproxyServer(asyncore.dispatcher, stateful.Stateful, port_checks.FreePortsChecker): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Maybe we should create a base class from scratch, rather than use an async one, because we almost never use async in tests.
-
asyncore.dispatcher
is deprecated in favor ofasyncio.Protocol
Deprecated since version 3.6, will be removed in version 3.12: The asyncore module is deprecated (see PEP 594 for details). Please use asyncio instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it is a good idea. I created #573 issue about this.
… The class Server `helpers/deproxy.py` should be removed after changing old tests. The `BaseDeproxyServer` and `StaticDeproxyServer` were merged because inheritance makes it harder to work here. We have base class `asyncore.dispatcher`.
…e them in tests.
…es used in tests are available via `property`.
…t style. All variables with `__` changed to `_` because the main idea for this - restrict external access, but python does not restrict access anyway.
5e953be
to
2fe124d
Compare
… `ServerConnection.handle_close`. This method is called when FIN or RST is received from Tempesta.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
No description provided.