summaryrefslogtreecommitdiff
path: root/backend/escl/escl_newjob.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2022-02-07 06:56:10 +0100
committerJörg Frings-Fürst <debian@jff.email>2022-02-07 06:56:10 +0100
commit43f33c72804e63306580755049c09d5a81ad83e3 (patch)
tree805caeb00a832ed96a331907987d4e6a2056a391 /backend/escl/escl_newjob.c
parent0f86c5490ea7c2218a4394bf4c21bf3f9267a47c (diff)
parent6427d36e269d8c14e6bc55373102a4ebc971ca38 (diff)
Merge branch 'release/debian/1.1.1-1'debian/1.1.1-1
Diffstat (limited to 'backend/escl/escl_newjob.c')
-rw-r--r--backend/escl/escl_newjob.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/backend/escl/escl_newjob.c b/backend/escl/escl_newjob.c
index 24bfbc9..98a953f 100644
--- a/backend/escl/escl_newjob.c
+++ b/backend/escl/escl_newjob.c
@@ -277,6 +277,8 @@ wake_up_device:
curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDSIZE, upload->size);
curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, download_callback);
curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, (void *)download);
+ curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
+ curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 3L);
CURLcode res = curl_easy_perform(curl_handle);
if (res != CURLE_OK) {
DBG( 1, "Create NewJob : the scanner responded incorrectly: %s\n", curl_easy_strerror(res));
@@ -296,7 +298,17 @@ wake_up_device:
result = strdup(location);
DBG( 1, "Create NewJob : %s\n", result);
*temporary = '\n';
+ *location = '\0';
+ location = strrchr(tmp_location,'/');
wakup_count = 0;
+ if (location) {
+ location++;
+ scanner->scanJob = strdup(location);
+ DBG( 1, "Full location header [%s]\n", scanner->scanJob);
+ }
+ else
+ scanner->scanJob = strdup("ScanJobs");
+ *location = '/';
}
}
if (result == NULL) {