summaryrefslogtreecommitdiff
path: root/backend/escl/escl_scan.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2022-02-01 15:25:04 +0100
committerJörg Frings-Fürst <debian@jff.email>2022-02-01 15:25:04 +0100
commit8e5d399808d2270ae9d56c96560a021e594d18a4 (patch)
treecb83e4c8216cf0e8bcaa17a6f2cb64cf4d7f469a /backend/escl/escl_scan.c
parent97e55bdc5cdf59304af739e65f416320bcbcf599 (diff)
parent302276dc1b90cfc972fb726ca94a23b18f4b0088 (diff)
Update upstream source from tag 'upstream/1.1.1'
Update to upstream version '1.1.1' with Debian dir 4cb81ae9eaa2503b9c320ac1e8125f9df6e7f7b3
Diffstat (limited to 'backend/escl/escl_scan.c')
-rw-r--r--backend/escl/escl_scan.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/backend/escl/escl_scan.c b/backend/escl/escl_scan.c
index 53bd438..3350c83 100644
--- a/backend/escl/escl_scan.c
+++ b/backend/escl/escl_scan.c
@@ -57,10 +57,10 @@ write_callback(void *str, size_t size, size_t nmemb, void *userp)
* \return status (if everything is OK, status = SANE_STATUS_GOOD, otherwise, SANE_STATUS_NO_MEM/SANE_STATUS_INVAL)
*/
SANE_Status
-escl_scan(capabilities_t *scanner, const ESCL_Device *device, char *result)
+escl_scan(capabilities_t *scanner, const ESCL_Device *device, char *scanJob, char *result)
{
CURL *curl_handle = NULL;
- const char *scan_jobs = "/eSCL/ScanJobs";
+ const char *scan_jobs = "/eSCL/";
const char *scanner_start = "/NextDocument";
char scan_cmd[PATH_MAX] = { 0 };
SANE_Status status = SANE_STATUS_GOOD;
@@ -70,10 +70,12 @@ escl_scan(capabilities_t *scanner, const ESCL_Device *device, char *result)
scanner->real_read = 0;
curl_handle = curl_easy_init();
if (curl_handle != NULL) {
- snprintf(scan_cmd, sizeof(scan_cmd), "%s%s%s",
- scan_jobs, result, scanner_start);
+ snprintf(scan_cmd, sizeof(scan_cmd), "%s%s%s%s",
+ scan_jobs, scanJob, result, scanner_start);
escl_curl_url(curl_handle, device, scan_cmd);
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_callback);
+ curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
+ curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 3L);
if (scanner->tmp)
fclose(scanner->tmp);
scanner->tmp = tmpfile();