commit b4aba48fade220bd18ddf4539e61a257de126b63
parent 41366ba583a292608fee940fdc46cb6b9948b73f
Author: Joris Vink <joris@coders.se>
Date: Thu, 16 May 2019 21:07:42 +0200
small python improvements.
- Check for an exception when in a timer context and log it if uncaught.
- Make sure tlsverify is settable regardless of client certs being specified.
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/python.c b/src/python.c
@@ -1675,6 +1675,8 @@ pytimer_run(void *arg, u_int64_t now)
ret = PyObject_CallObject(timer->callable, NULL);
Py_XDECREF(ret);
+ kore_python_log_error("pytimer_run");
+
if (timer->flags & KORE_TIMER_ONESHOT) {
timer->run = NULL;
Py_DECREF((PyObject *)timer);
@@ -4238,13 +4240,11 @@ pyhttp_client_request(struct pyhttp_client *client, int m, PyObject *kwargs)
client->tlscert);
curl_easy_setopt(op->curl.handle, CURLOPT_SSLKEY,
client->tlskey);
+ }
- if (client->tlsverify == 0) {
- curl_easy_setopt(op->curl.handle,
- CURLOPT_SSL_VERIFYHOST, 0);
- curl_easy_setopt(op->curl.handle,
- CURLOPT_SSL_VERIFYPEER, 0);
- }
+ if (client->tlsverify == 0) {
+ curl_easy_setopt(op->curl.handle, CURLOPT_SSL_VERIFYHOST, 0);
+ curl_easy_setopt(op->curl.handle, CURLOPT_SSL_VERIFYPEER, 0);
}
if (client->cabundle != NULL) {