summaryrefslogtreecommitdiff
path: root/backend/escl/escl_reset.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2022-02-01 15:24:35 +0100
committerJörg Frings-Fürst <debian@jff.email>2022-02-01 15:24:35 +0100
commit302276dc1b90cfc972fb726ca94a23b18f4b0088 (patch)
tree33d99da40fb5fa097fdab5584d7ed550d25a33bb /backend/escl/escl_reset.c
parent351b7328520c16730ceb46e5acae16038c42185e (diff)
New upstream version 1.1.1upstream/1.1.1
Diffstat (limited to 'backend/escl/escl_reset.c')
-rw-r--r--backend/escl/escl_reset.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/backend/escl/escl_reset.c b/backend/escl/escl_reset.c
index 7494dda..95e3f2d 100644
--- a/backend/escl/escl_reset.c
+++ b/backend/escl/escl_reset.c
@@ -44,10 +44,10 @@ write_callback(void __sane_unused__*str,
* This function is called in the 'sane_cancel' function.
*/
void
-escl_scanner(const ESCL_Device *device, char *result)
+escl_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 };
int i = 0;
@@ -58,10 +58,12 @@ escl_scanner(const ESCL_Device *device, char *result)
CURL_CALL:
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 (curl_easy_perform(curl_handle) == CURLE_OK) {
curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &answer);
i++;