treewide: handle result of qio_channel_set_blocking()
Currently, we just always pass NULL as errp argument. That doesn't
look good.
Some realizations of interface may actually report errors.
Channel-socket realization actually either ignore or crash on
errors, but we are going to straighten it out to always reporting
an errp in further commits.
So, convert all callers to either handle the error (where environment
allows) or explicitly use &error_abort.
Take also a chance to change the return value to more convenient
bool (keeping also in mind, that underlying realizations may
return -1 on failure, not -errno).
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
[DB: fix return type mismatch in TLS/websocket channel
impls for qio_channel_set_blocking]
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
4149afca71
commit
1ed8903916
16 changed files with 69 additions and 30 deletions
|
|
@ -733,8 +733,11 @@ static void coroutine_fn prh_co_entry(void *opaque)
|
|||
uint32_t flags;
|
||||
int r;
|
||||
|
||||
qio_channel_set_blocking(QIO_CHANNEL(client->ioc),
|
||||
false, NULL);
|
||||
if (!qio_channel_set_blocking(QIO_CHANNEL(client->ioc),
|
||||
false, &local_err)) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
qio_channel_set_follow_coroutine_ctx(QIO_CHANNEL(client->ioc), true);
|
||||
|
||||
/* A very simple negotiation for future extensibility. No features
|
||||
|
|
@ -786,6 +789,7 @@ static void coroutine_fn prh_co_entry(void *opaque)
|
|||
}
|
||||
}
|
||||
|
||||
out:
|
||||
if (local_err) {
|
||||
if (verbose == 0) {
|
||||
error_free(local_err);
|
||||
|
|
@ -794,7 +798,6 @@ static void coroutine_fn prh_co_entry(void *opaque)
|
|||
}
|
||||
}
|
||||
|
||||
out:
|
||||
object_unref(OBJECT(client->ioc));
|
||||
g_free(client);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue