kopia lustrzana https://gitlab.com/sane-project/backends
Fix scanjob for LaserJet FlowMFP M578 and LaserJet MFP M630.
rodzic
c26e9acd79
commit
b24907c8a9
|
@ -29,8 +29,6 @@
|
|||
|
||||
#include <setjmp.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include "../include/sane/saneopts.h"
|
||||
#include "../include/sane/sanei.h"
|
||||
#include "../include/sane/sanei_backend.h"
|
||||
|
@ -96,6 +94,7 @@ escl_free_device(ESCL_Device *current)
|
|||
free((void*)current->is);
|
||||
free((void*)current->uuid);
|
||||
free((void*)current->unix_socket);
|
||||
curl_slist_free_all(current->localhost);
|
||||
free(current);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -229,6 +228,9 @@ escl_device_add(int port_nb,
|
|||
}
|
||||
model = (char*)(tmp[0] != 0 ? tmp : model_name);
|
||||
current->model_name = strdup(model);
|
||||
if (strcasestr(current->model_name, "LaserJet FlowMFP M578") ||
|
||||
strcasestr(current->model_name, "LaserJet MFP M630"))
|
||||
current->localhost = curl_slist_append(NULL, "Host: localhost");
|
||||
current->ip_address = strdup(ip_address);
|
||||
memset(tmp, 0, PATH_MAX);
|
||||
snprintf(tmp, sizeof(tmp), "%s scanner", (is ? is : "flatbed or ADF"));
|
||||
|
@ -1714,6 +1716,8 @@ escl_curl_url(CURL *handle, const ESCL_Device *device, SANE_String_Const path)
|
|||
DBG( 1, "escl_curl_url: URL: %s\n", url );
|
||||
curl_easy_setopt(handle, CURLOPT_URL, url);
|
||||
free(url);
|
||||
if (device->localhost)
|
||||
curl_easy_setopt(handle, CURLOPT_HTTPHEADER, device->localhost);
|
||||
if (device->https) {
|
||||
DBG( 1, "Ignoring safety certificates, use https\n");
|
||||
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
|
|
|
@ -48,6 +48,8 @@
|
|||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#ifndef BACKEND_NAME
|
||||
#define BACKEND_NAME escl
|
||||
#endif
|
||||
|
@ -97,6 +99,7 @@ typedef struct ESCL_Device {
|
|||
char *uuid;
|
||||
char *type;
|
||||
SANE_Bool https;
|
||||
struct curl_slist *localhost;
|
||||
char *unix_socket;
|
||||
} ESCL_Device;
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <libxml/parser.h>
|
||||
|
||||
#include "../include/sane/saneopts.h"
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#ifdef PATH_MAX
|
||||
# undef PATH_MAX
|
||||
#endif
|
||||
|
|
|
@ -29,8 +29,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
static size_t
|
||||
write_callback(void __sane_unused__*str,
|
||||
size_t __sane_unused__ size,
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include "../include/sane/sanei.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <libxml/parser.h>
|
||||
|
||||
struct idle
|
||||
|
|
Ładowanie…
Reference in New Issue