Message ID | CAAAtp75Fm8OaVryfDZty2bvCCMOh8pns0PXv+LpXpxcXU7hc3A@mail.gmail.com |
---|---|
State | New |
Headers | show |
Series | umdns: add timeout_lookup parameter for services | expand |
On 8/26/22 13:40, Tobias Waldvogel wrote: > From: Tobias Waldvogel <tobias.waldvogel@gmail.com> > > Printing on Android devices via mdns IPP does not work > with the default value of 60 seconds for the > lookup timeout. It seems that Androd expects an > immediate answer just when trying to print. Nevertheless > the umdns debug messages show that the answer is supressed > due to the timeout. As a result the printer does not > show up. > This patch implements an additional parameter > timeout_lookup for setting a dedicated timeout value > with a fallback to TOUT_LOOKUP (60s). > > This is a sample ipp service definition, which works > now with Android standard printing: > > { > "ipp": { > "service": "_ipp._tcp.local", > "instance": "HL3040CN @ router", > "port": 631, > "timeout_lookup": -1, > "txt": [ > "txtvers=1", > "UUID=308f65f9-5393-3027-4c83-374cb704e729", > "rp=printers/HL3040CN", > "ty=Brother HL3040CN", > "note=Office", > "pdl=application/pdf,image/jpeg,image/png,image/pwg-raster", > "Color=T", > "Copies=T" > ] > } > } > > Signed-off-by: Tobias Waldvogel <tobias.waldvogel@gmail.com> The white spaces in this patch are damaged. It is also broken in patchwork: https://patchwork.ozlabs.org/project/openwrt/patch/CAAAtp75Fm8OaVryfDZty2bvCCMOh8pns0PXv+LpXpxcXU7hc3A@mail.gmail.com/ You could use "git send-email" to send the patch for example. Hauke
diff --git a/service.c b/service.c index bd9f985..dc7f330 100644 --- a/service.c +++ b/service.c @@ -35,6 +35,7 @@ #include "announce.h" enum { + SERVICE_TOUT_LOOKUP, SERVICE_INSTANCE, SERVICE_SERVICE, SERVICE_PORT, @@ -51,12 +52,14 @@ struct service { const char *instance; const char *service; const uint8_t *txt; + int32_t tout_lookup; int txt_len; int port; int active; }; static const struct blobmsg_policy service_policy[__SERVICE_MAX] = { + [SERVICE_TOUT_LOOKUP] = { .name = "timeout_lookup", .type = BLOBMSG_TYPE_INT32 }, [SERVICE_INSTANCE] = { .name = "instance", .type = BLOBMSG_TYPE_STRING }, [SERVICE_SERVICE] = { .name = "service", .type = BLOBMSG_TYPE_STRING },