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