diff --git a/include/ucall/ucall.h b/include/ucall/ucall.h index d01b3b0..48ec63e 100644 --- a/include/ucall/ucall.h +++ b/include/ucall/ucall.h @@ -78,6 +78,7 @@ typedef struct ucall_config_t { /// > STDOUT_FILENO: console output. /// > STDERR_FILENO: errors. int32_t logs_file_descriptor; + /// @brief Can be: /// > "human" will print human-readable unit-normalized lines. /// > "json" will output newline-delimited JSONs documents. @@ -88,14 +89,6 @@ typedef struct ucall_config_t { uint32_t max_lifetime_micro_seconds; uint32_t max_lifetime_exchanges; - /// @brief Enable SSL. - bool use_ssl; - /// @brief Private Key required for SSL. - char const* ssl_private_key_path; - /// @brief At least one certificate is required for SSL. - char const** ssl_certificates_paths; - /// @brief Certificates count. - size_t ssl_certificates_count; } ucall_config_t; /** @@ -276,7 +269,11 @@ void ucall_batch_add_procedure( // ucall_batch_callback_t callback, // ucall_callback_tag_t callback_tag); +/** + * @brief Introspects the structure of the batch request. + */ size_t ucall_batch_size(ucall_batch_call_t batch); + void ucall_batch_unpack(ucall_batch_call_t batch, ucall_call_t* call); #ifdef __cplusplus diff --git a/python/lib.c b/python/lib.c index 01a98b1..166c593 100644 --- a/python/lib.c +++ b/python/lib.c @@ -402,7 +402,6 @@ static PyMappingMethods server_mapping_methods = { static void server_dealloc(py_server_t* self) { free(self->wrappers); - free(self->config.ssl_certificates_paths); ucall_free(self->server); Py_TYPE(self)->tp_free((PyObject*)self); } @@ -429,20 +428,12 @@ static int server_init(py_server_t* self, PyObject* args, PyObject* keywords) { PyObject* certs_path = NULL; - if (!PyArg_ParseTupleAndKeywords(args, keywords, "|snnnnnpsO", (char**)keywords_list, // + if (!PyArg_ParseTupleAndKeywords(args, keywords, "|snnnnnp", (char**)keywords_list, // &self->config.hostname, &self->config.port, &self->config.queue_depth, &self->config.max_callbacks, &self->config.max_threads, &self->count_threads, - &self->quiet, &self->config.ssl_private_key_path, &certs_path)) + &self->quiet)) return -1; - if (self->config.ssl_private_key_path && certs_path && PySequence_Check(certs_path)) { - self->config.use_ssl = true; - self->config.ssl_certificates_count = PySequence_Length(certs_path); - self->config.ssl_certificates_paths = (char**)malloc(sizeof(char*) * self->config.ssl_certificates_count); - for (size_t i = 0; i < self->config.ssl_certificates_count; i++) - self->config.ssl_certificates_paths[i] = PyUnicode_AsUTF8AndSize(PySequence_GetItem(certs_path, i), NULL); - } - self->wrapper_capacity = 16; self->wrappers = (py_wrapper_t*)malloc(self->wrapper_capacity * sizeof(py_wrapper_t));