kopia lustrzana https://github.com/cirospaciari/socketify.py
Merge 5ca6ae06ec
into 2ed7ec1403
commit
5633378548
|
@ -186,6 +186,7 @@ void uws_add_server_name(int ssl, uws_app_t *app, const char *hostname_pattern,
|
|||
void uws_add_server_name_with_options(int ssl, uws_app_t *app, const char *hostname_pattern, size_t hostname_pattern_length, struct us_socket_context_options_t options);
|
||||
void uws_missing_server_name(int ssl, uws_app_t *app, uws_missing_server_handler handler, void *user_data);
|
||||
void uws_filter(int ssl, uws_app_t *app, uws_filter_handler handler, void *user_data);
|
||||
void uws_set_max_content_length(uws_app_t *app, size_t maxContentLength);
|
||||
|
||||
void uws_res_close(int ssl, uws_res_t *res);
|
||||
void uws_res_end(int ssl, uws_res_t *res, const char *data, size_t length, bool close_connection);
|
||||
|
|
|
@ -2618,6 +2618,7 @@ class App:
|
|||
task_factory_max_items=100_000,
|
||||
lifespan=True,
|
||||
idle_relaxation_time=0.01,
|
||||
max_content_length=0,
|
||||
):
|
||||
|
||||
socket_options_ptr = ffi.new("struct us_socket_context_options_t *")
|
||||
|
@ -2688,7 +2689,6 @@ class App:
|
|||
socket_options.ssl_prefer_low_memory_usage = ffi.cast(
|
||||
"int", options.ssl_prefer_low_memory_usage
|
||||
)
|
||||
|
||||
else:
|
||||
self.is_ssl = False
|
||||
self.SSL = ffi.cast("int", 0)
|
||||
|
@ -2706,6 +2706,7 @@ class App:
|
|||
self._ptr = ffi.new_handle(self)
|
||||
if bool(lib.uws_constructor_failed(self.SSL, self.app)):
|
||||
raise RuntimeError("Failed to create connection")
|
||||
lib.uws_set_max_content_length(self.app, max_content_length)
|
||||
|
||||
self.handlers = []
|
||||
self.error_handler = None
|
||||
|
|
Ładowanie…
Reference in New Issue