escl: Fix version of pwf:Version

707-xerox_mfp-scx-4521-fixes-are-not-merged
Ordissimo 2023-04-16 19:49:45 +00:00
rodzic 90cc6b1fb7
commit aa3fc1cad8
3 zmienionych plików z 4 dodań i 5 usunięć

Wyświetl plik

@ -92,7 +92,7 @@ typedef struct {
typedef struct ESCL_Device { typedef struct ESCL_Device {
struct ESCL_Device *next; struct ESCL_Device *next;
double version; char *version;
char *model_name; char *model_name;
int port_nb; int port_nb;
char *ip_address; char *ip_address;

Wyświetl plik

@ -432,7 +432,7 @@ print_xml_c(xmlNode *node, ESCL_Device *device, capabilities_t *scanner, int typ
} }
if (!strcmp((const char *)node->name, "Version")&& node->ns && node->ns->prefix){ if (!strcmp((const char *)node->name, "Version")&& node->ns && node->ns->prefix){
if (!strcmp((const char*)node->ns->prefix, "pwg")) if (!strcmp((const char*)node->ns->prefix, "pwg"))
device->version = atof ((const char *)xmlNodeGetContent(node)); device->version = strdup((const char *)xmlNodeGetContent(node));
} }
if (!strcmp((const char *)node->name, "MakeAndModel")){ if (!strcmp((const char *)node->name, "MakeAndModel")){
device->model_name = strdup((const char *)xmlNodeGetContent(node)); device->model_name = strdup((const char *)xmlNodeGetContent(node));
@ -588,7 +588,6 @@ escl_capabilities(ESCL_Device *device, char *blacklist, SANE_Status *status)
strstr(header->memory, "Server: HP_Compact_Server")) strstr(header->memory, "Server: HP_Compact_Server"))
device->hack = curl_slist_append(NULL, "Host: localhost"); device->hack = curl_slist_append(NULL, "Host: localhost");
device->version = 0.0;
scanner->source = 0; scanner->source = 0;
scanner->Sources = (SANE_String_Const *)malloc(sizeof(SANE_String_Const) * 4); scanner->Sources = (SANE_String_Const *)malloc(sizeof(SANE_String_Const) * 4);
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)

Wyświetl plik

@ -46,7 +46,7 @@ struct downloading
static const char settings[] = static const char settings[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" \ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" \
"<scan:ScanSettings xmlns:pwg=\"http://www.pwg.org/schemas/2010/12/sm\" xmlns:scan=\"http://schemas.hp.com/imaging/escl/2011/05/03\">" \ "<scan:ScanSettings xmlns:pwg=\"http://www.pwg.org/schemas/2010/12/sm\" xmlns:scan=\"http://schemas.hp.com/imaging/escl/2011/05/03\">" \
" <pwg:Version>%.2f</pwg:Version>" \ " <pwg:Version>%s</pwg:Version>" \
" <pwg:ScanRegions>" \ " <pwg:ScanRegions>" \
" <pwg:ScanRegion>" \ " <pwg:ScanRegion>" \
" <pwg:ContentRegionUnits>escl:ThreeHundredthsOfInches</pwg:ContentRegionUnits>" \ " <pwg:ContentRegionUnits>escl:ThreeHundredthsOfInches</pwg:ContentRegionUnits>" \
@ -187,7 +187,7 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st
scanner->caps[scanner->source].default_format = scanner->caps[scanner->source].default_format =
strdup(scanner->caps[scanner->source].DocumentFormats[have_pdf]); strdup(scanner->caps[scanner->source].DocumentFormats[have_pdf]);
} }
if (device->version <= 2.0) if (atof ((const char *)device->version) <= 2.0)
{ {
// For eSCL 2.0 and older clients // For eSCL 2.0 and older clients
snprintf(f_ext_tmp, sizeof(f_ext_tmp), snprintf(f_ext_tmp, sizeof(f_ext_tmp),