summaryrefslogtreecommitdiffstats
path: root/src/property_list_service.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/property_list_service.c')
-rw-r--r--src/property_list_service.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/property_list_service.c b/src/property_list_service.c
index f0fc830..7b5c738 100644
--- a/src/property_list_service.c
+++ b/src/property_list_service.c
@@ -224,6 +224,7 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis
224 debug_info("received %d bytes", bytes); 224 debug_info("received %d bytes", bytes);
225 curlen += bytes; 225 curlen += bytes;
226 } 226 }
227
227 if (curlen < pktlen) { 228 if (curlen < pktlen) {
228 debug_info("received incomplete packet (%d of %d bytes)", curlen, pktlen); 229 debug_info("received incomplete packet (%d of %d bytes)", curlen, pktlen);
229 if (curlen > 0) { 230 if (curlen > 0) {
@@ -233,6 +234,7 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis
233 free(content); 234 free(content);
234 return res; 235 return res;
235 } 236 }
237
236 if ((pktlen > 8) && !memcmp(content, "bplist00", 8)) { 238 if ((pktlen > 8) && !memcmp(content, "bplist00", 8)) {
237 plist_from_bin(content, pktlen, plist); 239 plist_from_bin(content, pktlen, plist);
238 } else if ((pktlen > 5) && !memcmp(content, "<?xml", 5)) { 240 } else if ((pktlen > 5) && !memcmp(content, "<?xml", 5)) {
@@ -246,15 +248,17 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis
246 debug_info("WARNING: received unexpected non-plist content"); 248 debug_info("WARNING: received unexpected non-plist content");
247 debug_buffer(content, pktlen); 249 debug_buffer(content, pktlen);
248 } 250 }
251
249 if (*plist) { 252 if (*plist) {
250 debug_plist(*plist); 253 debug_plist(*plist);
251 res = PROPERTY_LIST_SERVICE_E_SUCCESS; 254 res = PROPERTY_LIST_SERVICE_E_SUCCESS;
252 } else { 255 } else {
253 res = PROPERTY_LIST_SERVICE_E_PLIST_ERROR; 256 res = PROPERTY_LIST_SERVICE_E_PLIST_ERROR;
254 } 257 }
258
255 free(content); 259 free(content);
256 content = NULL; 260 content = NULL;
257 261
258 return res; 262 return res;
259} 263}
260 264