mirror of
https://github.com/jorisvink/kore
synced 2025-03-09 12:39:01 -04:00
Merge branch 'master' into 3.0.0-releng
This commit is contained in:
commit
414a42f389
26
src/python.c
26
src/python.c
@ -542,7 +542,7 @@ python_coro_run(struct python_coro *coro)
|
||||
|
||||
item = _PyGen_Send((PyGenObject *)coro->obj, NULL);
|
||||
if (item == NULL) {
|
||||
if (PyErr_Occurred() &&
|
||||
if (coro->gatherop == NULL && PyErr_Occurred() &&
|
||||
PyErr_ExceptionMatches(PyExc_StopIteration)) {
|
||||
PyErr_Fetch(&type, &coro->result, &traceback);
|
||||
Py_DECREF(type);
|
||||
@ -2190,6 +2190,7 @@ static PyObject *
|
||||
pysocket_async_recv(struct pysocket_op *op)
|
||||
{
|
||||
ssize_t ret;
|
||||
size_t len;
|
||||
u_int16_t port;
|
||||
socklen_t socklen;
|
||||
struct sockaddr *sendaddr;
|
||||
@ -2217,6 +2218,7 @@ pysocket_async_recv(struct pysocket_op *op)
|
||||
fatal("non AF_INET/AF_UNIX in %s", __func__);
|
||||
}
|
||||
|
||||
memset(sendaddr, 0, socklen);
|
||||
ret = recvfrom(op->socket->fd, op->buffer.data,
|
||||
op->buffer.length, 0, sendaddr, &socklen);
|
||||
}
|
||||
@ -2267,6 +2269,21 @@ pysocket_async_recv(struct pysocket_op *op)
|
||||
return (NULL);
|
||||
break;
|
||||
case AF_UNIX:
|
||||
len = strlen(op->sendaddr.sun.sun_path);
|
||||
#if defined(__linux__)
|
||||
if (len == 0 && socklen > 0) {
|
||||
len = socklen - sizeof(sa_family_t);
|
||||
op->sendaddr.sun.sun_path[0] = '@';
|
||||
op->sendaddr.sun.sun_path[len] = '\0';
|
||||
}
|
||||
#endif
|
||||
if (len == 0) {
|
||||
if ((tuple = Py_BuildValue("(ON)",
|
||||
Py_None, bytes)) == NULL)
|
||||
return (NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if ((tuple = Py_BuildValue("(sN)",
|
||||
op->sendaddr.sun.sun_path, bytes)) == NULL)
|
||||
return (NULL);
|
||||
@ -2313,6 +2330,13 @@ pysocket_async_send(struct pysocket_op *op)
|
||||
break;
|
||||
case AF_UNIX:
|
||||
socklen = sizeof(op->sendaddr.sun);
|
||||
#if defined(__linux__)
|
||||
if (op->sendaddr.sun.sun_path[0] == '@') {
|
||||
socklen = sizeof(sa_family_t) +
|
||||
strlen(op->sendaddr.sun.sun_path);
|
||||
op->sendaddr.sun.sun_path[0] = '\0';
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
fatal("non AF_INET/AF_UNIX in %s", __func__);
|
||||
|
@ -382,7 +382,8 @@ kore_worker_entry(struct kore_worker *kw)
|
||||
|
||||
if (!kore_quiet) {
|
||||
kore_log(LOG_NOTICE,
|
||||
"worker %d started (cpu#%d)", kw->id, kw->cpu);
|
||||
"worker %d started (cpu#%d, pid#%d)",
|
||||
kw->id, kw->cpu, kw->pid);
|
||||
}
|
||||
|
||||
rcall = kore_runtime_getcall("kore_worker_configure");
|
||||
|
Loading…
x
Reference in New Issue
Block a user