Skip to content

Commit

Permalink
WSDD: hotfix for Lexmark MX310dn (see #304)
Browse files Browse the repository at this point in the history
Unlike many other devices, Lexmark MX310dn sends two separate ProbeMatch
records in ProbeMatches message: first for printer and second for scanner.

This patch merges them both together. However, this patch is not good enough
for production use; we actually must threat these two ProbeMatch as two
separate, independent records. WS-Discovery proxy may behave this way,
combining information about independent devices into a single message.

So this is just a hotfix, it will be replaced with a better solution as
soon as it will be ready
  • Loading branch information
alexpevzner committed Nov 7, 2023
1 parent 2dcf4b8 commit 392cae7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions airscan-wsdd.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,14 @@ wsdd_message_parse_endpoint (wsdd_message *msg, xml_rd *xml)

if (!strcmp(path, "/d:Types")) {
val = xml_rd_node_value(xml);
msg->is_scanner = !!strstr(val, "ScanDeviceType");
msg->is_printer = !!strstr(val, "PrintDeviceType");

if (strstr(val, "ScanDeviceType")) {
msg->is_scanner = true;
}

if (strstr(val, "PrintDeviceType") != NULL) {
msg->is_printer = true;
}
} else if (!strcmp(path, "/d:XAddrs")) {
mem_free(xaddrs_text);
xaddrs_text = str_dup(xml_rd_node_value(xml));
Expand Down

0 comments on commit 392cae7

Please sign in to comment.