diff options
author | thierry1970 <thierry@ordissimo.com> | 2020-02-18 16:08:07 +0100 |
---|---|---|
committer | thierry1970 <thierry@ordissimo.com> | 2020-02-18 16:08:07 +0100 |
commit | 2cf467964a13138354253d3e6f844eb816b865c1 (patch) | |
tree | cdb3d1cba22e1c48d2273c63659bd1d1ac80edb9 /src | |
parent | c92405af00ea557c25f3e81da4217d44e77a4012 (diff) |
Dynamic addition of the ipp/faxout property.
Diffstat (limited to 'src')
-rw-r--r-- | src/capabilities.c | 17 | ||||
-rw-r--r-- | src/capabilities.h | 1 | ||||
-rw-r--r-- | src/dnssd.c | 4 |
3 files changed, 22 insertions, 0 deletions
diff --git a/src/capabilities.c b/src/capabilities.c index 311d240..ece503b 100644 --- a/src/capabilities.c +++ b/src/capabilities.c @@ -298,6 +298,22 @@ ipp_request(ippPrinter *printer, int port) /* next attribute */ attr = ippNextAttribute(response); } + if (!strcasecmp(httpGetField(http, HTTP_FIELD_CONNECTION), "close")) + { + httpClearFields(http); + if (httpReconnect2(http, 30000, NULL)) + { + goto close_http; + } + } + httpClearFields(http); + httpSetField(http, HTTP_FIELD_AUTHORIZATION, httpGetAuthString(http)); + httpSetField(http, HTTP_FIELD_ACCEPT_LANGUAGE, "en"); + if (!httpHead(http, "/ipp/faxout")) + { + printer->fax = strdup("T"); + } +close_http: httpClose(http); return 0; } @@ -318,6 +334,7 @@ free_printer(ippPrinter *printer) free(printer->pdl); free(printer->ty); free(printer->side); + free(printer->fax); free(printer); return NULL; } diff --git a/src/capabilities.h b/src/capabilities.h index b84874a..ffa2c0f 100644 --- a/src/capabilities.h +++ b/src/capabilities.h @@ -26,6 +26,7 @@ typedef struct { char *note; char *ty; char *side; + char *fax; } ippPrinter; int is_scanner_present(ippScanner *scanner, int port); diff --git a/src/dnssd.c b/src/dnssd.c index 7cb6e4a..c0d50e3 100644 --- a/src/dnssd.c +++ b/src/dnssd.c @@ -252,6 +252,10 @@ void * dnssd_escl_register(void *data) ipp_txt = avahi_string_list_add_printf(ipp_txt, "PaperMax=%s", printer->papermax); if (printer->side) ipp_txt = avahi_string_list_add_printf(ipp_txt, "Duplex=%s", printer->side); + if (printer->fax) { + ipp_txt = avahi_string_list_add_printf(ipp_txt, "Fax=%s", printer->fax); + ipp_txt = avahi_string_list_add_printf(ipp_txt, "rfo=ipp/faxout"); + } NOTE("Printer TXT[\n\tadminurl=%s\n\tUUID=%s\t\n]\n", printer->adminurl, printer->uuid); |