mirror of
https://github.com/jorisvink/kore
synced 2025-03-09 20:49:01 -04:00
Merge branch 'master' into 3.3.0-releng
This commit is contained in:
commit
f389d5119b
@ -675,6 +675,7 @@ struct pyhttp_client_op {
|
|||||||
int headers;
|
int headers;
|
||||||
struct kore_curl curl;
|
struct kore_curl curl;
|
||||||
struct python_coro *coro;
|
struct python_coro *coro;
|
||||||
|
struct pyhttp_client *client;
|
||||||
};
|
};
|
||||||
|
|
||||||
static PyObject *pyhttp_client_op_await(PyObject *);
|
static PyObject *pyhttp_client_op_await(PyObject *);
|
||||||
|
@ -3159,11 +3159,14 @@ pyhttp_response(struct pyhttp_request *pyreq, PyObject *args)
|
|||||||
} else if (obj == Py_None) {
|
} else if (obj == Py_None) {
|
||||||
http_response(pyreq->req, status, NULL, 0);
|
http_response(pyreq->req, status, NULL, 0);
|
||||||
} else {
|
} else {
|
||||||
|
c = pyreq->req->owner;
|
||||||
|
if (c->state == CONN_STATE_DISCONNECTING) {
|
||||||
|
Py_RETURN_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if ((iterator = PyObject_GetIter(obj)) == NULL)
|
if ((iterator = PyObject_GetIter(obj)) == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
c = pyreq->req->owner;
|
|
||||||
|
|
||||||
iterobj = kore_pool_get(&iterobj_pool);
|
iterobj = kore_pool_get(&iterobj_pool);
|
||||||
iterobj->iterator = iterator;
|
iterobj->iterator = iterator;
|
||||||
iterobj->connection = c;
|
iterobj->connection = c;
|
||||||
@ -4228,6 +4231,7 @@ pyhttp_client_request(struct pyhttp_client *client, int m, PyObject *kwargs)
|
|||||||
op->state = PYHTTP_CLIENT_OP_RUN;
|
op->state = PYHTTP_CLIENT_OP_RUN;
|
||||||
|
|
||||||
Py_INCREF(client);
|
Py_INCREF(client);
|
||||||
|
op->client = client;
|
||||||
|
|
||||||
kore_curl_http_setup(&op->curl, m, ptr, length);
|
kore_curl_http_setup(&op->curl, m, ptr, length);
|
||||||
kore_curl_bind_callback(&op->curl, python_curl_callback, op);
|
kore_curl_bind_callback(&op->curl, python_curl_callback, op);
|
||||||
@ -4302,6 +4306,7 @@ pyhttp_client_request(struct pyhttp_client *client, int m, PyObject *kwargs)
|
|||||||
static void
|
static void
|
||||||
pyhttp_client_op_dealloc(struct pyhttp_client_op *op)
|
pyhttp_client_op_dealloc(struct pyhttp_client_op *op)
|
||||||
{
|
{
|
||||||
|
Py_DECREF(op->client);
|
||||||
kore_curl_cleanup(&op->curl);
|
kore_curl_cleanup(&op->curl);
|
||||||
PyObject_Del((PyObject *)op);
|
PyObject_Del((PyObject *)op);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user