You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
3.5 KiB

sabe-backends: update to 1.0.31 * adds the canon_lide70 backend * avision: adds support for the KODAK i1120, fixes thread cancellation issues, disables exposure option for non-filmscanners * canon_dr: improves error reporting * dmc: fixes compiler warnings on the scan area options * epsonds: rewrites the network I/O following changes made to the * epson2 backend in 1.0.30 to fix security issues. Network support is still unsupported. * fujitsu: adds support for the fi-800R and a card scanning slot, fixes a bug when reading hardware sensors on the first invocation. Adds USB IDs for fi-7800 and fi-7900. * genesys: adds support for the Canon 5600F, Canon LiDE 90, Plustek OpticFilm 7200 and 7200 (v2), 7400, 7600i, 8100 and 8200i. Fixes several issues with the Canon 8600F. Adds 4800dpi support for the Canon LiDE 210 and fixes 3200dpi flatbed support on the Canon 8400F. Adds an option to fill dark calibration with a constant. Adds transparency support for gl847 chipset based devices. Fixes CIS scanner support for gl842 chipset based devices. Removes lineart and image enhancement emulation support. * gphoto: supports the PLANon DocuPen RC800 (with a recent enough version of gphoto2) * gt68xx: modifies scan cancellation behaviour * hp5400: adds button support, fixes a scan cancellation crash issue * pixma: add supports for the i-SENSYS MF440 Series and untested support for the PIXMMA G7000 Series and GM4000 Series as well as the i-SENSYS MF720 Series. * plustek: fixes a potential buffer overrun * test: adds gamma options Patches: - ADD: 102-pixma_Restore_old_behaviour_in_case_XML_support_is_missing.patch: pixma was failing to detect libxml2, even when it exists (https://gitlab.com/sane-project/backends/-/issues/345) - DROP: 100-fix-bigendian.patch: fix in release Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
4 years ago
  1. From a380fb089499f6b5192c07ae2feaa3376997382f Mon Sep 17 00:00:00 2001
  2. From: Olaf Meeuwissen <paddy-hack@member.fsf.org>
  3. Date: Sun, 13 Sep 2020 18:47:32 +0900
  4. Subject: [PATCH] pixma: Restore old behaviour in case XML support is missing
  5. Fixes #345.
  6. ---
  7. backend/pixma/pixma_common.c | 4 ++--
  8. backend/pixma/pixma_common.h | 2 ++
  9. backend/pixma/pixma_mp150.c | 8 ++++++++
  10. backend/pixma/pixma_mp800.c | 8 ++++++++
  11. 4 files changed, 20 insertions(+), 2 deletions(-)
  12. diff --git a/backend/pixma/pixma_common.c b/backend/pixma/pixma_common.c
  13. index ff3bd487d..2f46082e2 100644
  14. --- a/backend/pixma/pixma_common.c
  15. +++ b/backend/pixma/pixma_common.c
  16. @@ -56,8 +56,6 @@
  17. #if defined(HAVE_LIBXML2)
  18. # include <libxml/parser.h>
  19. -#else
  20. -# error "The pixma backend requires libxml2"
  21. #endif
  22. #include "pixma_rename.h"
  23. @@ -1241,6 +1239,7 @@ pixma_get_device_status (pixma_t * s, pixma_device_status_t * status)
  24. return s->ops->get_status (s, status);
  25. }
  26. +#if defined(HAVE_LIBXML2)
  27. static const char *
  28. format_xml_response(const char *resp_details)
  29. {
  30. @@ -1334,3 +1333,4 @@ clean:
  31. xmlFreeDoc(doc);
  32. return status;
  33. }
  34. +#endif
  35. diff --git a/backend/pixma/pixma_common.h b/backend/pixma/pixma_common.h
  36. index bee839c2c..1ced88d17 100644
  37. --- a/backend/pixma/pixma_common.h
  38. +++ b/backend/pixma/pixma_common.h
  39. @@ -205,7 +205,9 @@ uint8_t *pixma_newcmd (pixma_cmdbuf_t *, unsigned cmd,
  40. int pixma_exec (pixma_t *, pixma_cmdbuf_t *);
  41. int pixma_exec_short_cmd (pixma_t *, pixma_cmdbuf_t *, unsigned cmd);
  42. int pixma_map_status_errno (unsigned status);
  43. +#if defined(HAVE_LIBXML2)
  44. int pixma_parse_xml_response(const char *xml_message);
  45. +#endif
  46. /**@}*/
  47. #define pixma_fill_checksum(start, end) do { \
  48. diff --git a/backend/pixma/pixma_mp150.c b/backend/pixma/pixma_mp150.c
  49. index cd6cd3ddf..a18fbdce1 100644
  50. --- a/backend/pixma/pixma_mp150.c
  51. +++ b/backend/pixma/pixma_mp150.c
  52. @@ -322,6 +322,10 @@
  53. <ivec:param_set servicetype=\"scan\"><ivec:jobID>00000001</ivec:jobID>\
  54. </ivec:param_set></ivec:contents></cmd>"
  55. +#if !defined(HAVE_LIBXML2)
  56. +#define XML_OK "<ivec:response>OK</ivec:response>"
  57. +#endif
  58. +
  59. enum mp150_state_t
  60. {
  61. state_idle,
  62. @@ -459,7 +463,11 @@ send_xml_dialog (pixma_t * s, const char * xml_message)
  63. PDBG (pixma_dbg (10, "XML message sent to scanner:\n%s\n", xml_message));
  64. PDBG (pixma_dbg (10, "XML response back from scanner:\n%s\n", mp->cb.buf));
  65. +#if defined(HAVE_LIBXML2)
  66. return pixma_parse_xml_response((const char*)mp->cb.buf) == PIXMA_STATUS_OK;
  67. +#else
  68. + return (strcasestr ((const char *) mp->cb.buf, XML_OK) != NULL);
  69. +#endif
  70. }
  71. static int
  72. diff --git a/backend/pixma/pixma_mp800.c b/backend/pixma/pixma_mp800.c
  73. index 8b7b232fd..e05107d04 100644
  74. --- a/backend/pixma/pixma_mp800.c
  75. +++ b/backend/pixma/pixma_mp800.c
  76. @@ -152,6 +152,10 @@
  77. <ivec:param_set servicetype=\"scan\"><ivec:jobID>00000001</ivec:jobID>\
  78. </ivec:param_set></ivec:contents></cmd>"
  79. +#if !defined(HAVE_LIBXML2)
  80. +#define XML_OK "<ivec:response>OK</ivec:response>"
  81. +#endif
  82. +
  83. enum mp810_state_t
  84. {
  85. state_idle,
  86. @@ -291,7 +295,11 @@ static int send_xml_dialog (pixma_t * s, const char * xml_message)
  87. PDBG(pixma_dbg (10, "XML message sent to scanner:\n%s\n", xml_message));
  88. PDBG(pixma_dbg (10, "XML response back from scanner:\n%s\n", mp->cb.buf));
  89. +#if defined(HAVE_LIBXML2)
  90. return pixma_parse_xml_response((const char*)mp->cb.buf) == PIXMA_STATUS_OK;
  91. +#else
  92. + return (strcasestr ((const char *) mp->cb.buf, XML_OK) != NULL);
  93. +#endif
  94. }
  95. static void new_cmd_tpu_msg (pixma_t *s, pixma_cmdbuf_t * cb, uint16_t cmd)
  96. --
  97. GitLab