From 2163af58b5e631a2a8d2acd79b541ed884ab7b57 Mon Sep 17 00:00:00 2001 From: Samuel Mendoza-Jonas Date: Mon, 16 May 2016 16:06:30 +1000 Subject: discover/pxe-parser: Retrieve configs asynchronously Depending on the configuration of the DHCP server and the network, tftp requests made by the pxe parser can timeout. The pxe parser makes these requests synchronously so several timeouts can block the server completely for several minutes, leaving the server unresponsive to UI requests. Rework the pxe parser such that it handles the result of each tftp request in a callback, which can complete after iterate_parsers() has returned. Each callback is allocated its own conf_context which takes a talloc reference on the discover_context so that each callback can commit new boot options after the initial iterate loop has completed. This also means talloc_unlink must be used instead by the original parent of the discover_context. Signed-off-by: Samuel Mendoza-Jonas --- lib/talloc/talloc.c | 2 +- lib/talloc/talloc.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/talloc') diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c index f233541..d3e2065 100644 --- a/lib/talloc/talloc.c +++ b/lib/talloc/talloc.c @@ -760,7 +760,7 @@ off_t talloc_total_blocks(const void *ptr) /* return the number of external references to a pointer */ -static int talloc_reference_count(const void *ptr) +int talloc_reference_count(const void *ptr) { struct talloc_chunk *tc = talloc_chunk_from_ptr(ptr); struct talloc_reference_handle *h; diff --git a/lib/talloc/talloc.h b/lib/talloc/talloc.h index b5fca44..b9afc22 100644 --- a/lib/talloc/talloc.h +++ b/lib/talloc/talloc.h @@ -133,6 +133,7 @@ void *_talloc_realloc_array(const void *ctx, void *ptr, size_t el_size, unsigned void *talloc_realloc_fn(const void *context, void *ptr, size_t size); void *talloc_autofree_context(void); size_t talloc_get_size(const void *ctx); +int talloc_reference_count(const void *ptr); #endif -- cgit v1.2.1