From: Felix Fietkau Date: Wed, 9 Dec 2015 17:35:07 +0000 (+0100) Subject: libubus: add socket EOF handling to ubus_complete_request() X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=635ada42517f2fd79663a2a45f07c9461f6d20bc;p=oweals%2Fubus.git libubus: add socket EOF handling to ubus_complete_request() Signed-off-by: Felix Fietkau --- diff --git a/libubus-req.c b/libubus-req.c index bf19f36..416adab 100644 --- a/libubus-req.c +++ b/libubus-req.c @@ -160,6 +160,10 @@ int ubus_complete_request(struct ubus_context *ctx, struct ubus_request *req, ubus_poll_data(ctx, (unsigned int) timeout); uloop_cancelled = cancelled; + if (ctx->sock.eof) { + ubus_set_req_status(req, UBUS_STATUS_CONNECTION_FAILED); + break; + } } ctx->stack_depth--; if (ctx->stack_depth)