Skip to content

Commit

Permalink
Make: Fix missing SSL symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
ashvardanian committed May 13, 2024
1 parent 47379b2 commit ef7e825
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
13 changes: 5 additions & 8 deletions include/ucall/ucall.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;

/**
Expand Down Expand Up @@ -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
Expand Down
13 changes: 2 additions & 11 deletions python/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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));

Expand Down

0 comments on commit ef7e825

Please sign in to comment.