From 8872aec759699411be45a17798dab40b9539c2ae Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 29 Oct 2019 09:56:17 +0100 Subject: property_list_service: Consider a successful 0 byte read a timeout rather than an error condition --- src/property_list_service.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/property_list_service.c b/src/property_list_service.c index 1cb8dc9..9d47fd6 100644 --- a/src/property_list_service.c +++ b/src/property_list_service.c @@ -197,6 +197,11 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis return service_to_property_list_service_error(serr); } + if (bytes == 0) { + /* success but 0 bytes length, assume timeout */ + return PROPERTY_LIST_SERVICE_E_RECEIVE_TIMEOUT; + } + debug_info("initial read=%i", bytes); uint32_t curlen = 0; -- cgit v1.1-32-gdbae