From cfd27ef2ad8b005fd47ab41ef29b71d9e3d48201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Thu, 8 Oct 2015 12:32:49 +0200 Subject: Imported Upstream version 1.0.25 --- backend/net.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'backend/net.c') diff --git a/backend/net.c b/backend/net.c index 16fba2f..4beb45d 100644 --- a/backend/net.c +++ b/backend/net.c @@ -140,7 +140,7 @@ static int hang_over; client/server have different endianness. A value of -1 means, that there's no left over; otherwise the value has to be casted to SANE_Byte. left_over means, that there is a remaining byte from a previous call to sane_read, - which already is in the the correct byte order, but could not be returned, + which already is in the correct byte order, but could not be returned, e.g. because the frontend requested only one byte per call. */ static int left_over; @@ -1044,9 +1044,14 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) continue; } - +#ifdef WITH_AVAHI + avahi_threaded_poll_lock (avahi_thread); +#endif /* WITH_AVAHI */ DBG (2, "sane_init: trying to add %s\n", device_name); add_device (device_name, 0); +#ifdef WITH_AVAHI + avahi_threaded_poll_unlock (avahi_thread); +#endif /* WITH_AVAHI */ } fclose (fp); @@ -1090,8 +1095,14 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) if (host[0] == '\0') continue; #endif /* ENABLE_IPV6 */ +#ifdef WITH_AVAHI + avahi_threaded_poll_lock (avahi_thread); +#endif /* WITH_AVAHI */ DBG (2, "sane_init: trying to add %s\n", host); add_device (host, 0); +#ifdef WITH_AVAHI + avahi_threaded_poll_unlock (avahi_thread); +#endif /* WITH_AVAHI */ } free (copy); } @@ -1507,7 +1518,13 @@ sane_open (SANE_String_Const full_name, SANE_Handle * meta_handle) DBG (1, "sane_open: device %s not found, trying to register it anyway\n", nd_name); +#ifdef WITH_AVAHI + avahi_threaded_poll_lock (avahi_thread); +#endif /* WITH_AVAHI */ status = add_device (nd_name, &dev); +#ifdef WITH_AVAHI + avahi_threaded_poll_unlock (avahi_thread); +#endif /* WITH_AVAHI */ if (status != SANE_STATUS_GOOD) { DBG (1, "sane_open: could not open device\n"); -- cgit v1.2.3