kopia lustrzana https://gitlab.com/sane-project/backends
Porównaj commity
2 Commity
a51bf66d02
...
ce29bc714a
Autor | SHA1 | Data |
---|---|---|
Ordissimo | ce29bc714a | |
Ordissimo | 7cf2add3e3 |
|
@ -38,6 +38,31 @@ write_callback(void __sane_unused__*str,
|
||||||
return nmemb;
|
return nmemb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \fn void escl_scanner(const ESCL_Device *device, char *result)
|
||||||
|
* \brief Function that resets the scanner after each scan, using curl.
|
||||||
|
* This function is called in the 'sane_cancel' function.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
escl_delete(const ESCL_Device *device, char *uri)
|
||||||
|
{
|
||||||
|
CURL *curl_handle = NULL;
|
||||||
|
long answer = 0;
|
||||||
|
|
||||||
|
if (uri == NULL)
|
||||||
|
return;
|
||||||
|
curl_handle = curl_easy_init();
|
||||||
|
if (curl_handle != NULL) {
|
||||||
|
escl_curl_url(curl_handle, device, uri);
|
||||||
|
curl_easy_setopt(curl_handle, CURLOPT_CUSTOMREQUEST, "DELETE");
|
||||||
|
if (curl_easy_perform(curl_handle) == CURLE_OK) {
|
||||||
|
curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &answer);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
curl_easy_cleanup(curl_handle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \fn void escl_scanner(const ESCL_Device *device, char *result)
|
* \fn void escl_scanner(const ESCL_Device *device, char *result)
|
||||||
* \brief Function that resets the scanner after each scan, using curl.
|
* \brief Function that resets the scanner after each scan, using curl.
|
||||||
|
@ -70,6 +95,9 @@ CURL_CALL:
|
||||||
if (i >= 15) return;
|
if (i >= 15) return;
|
||||||
}
|
}
|
||||||
curl_easy_cleanup(curl_handle);
|
curl_easy_cleanup(curl_handle);
|
||||||
|
char* end = strrchr(scan_cmd, '/');
|
||||||
|
*end = 0;
|
||||||
|
escl_delete(device, scan_cmd);
|
||||||
if (status) {
|
if (status) {
|
||||||
if (SANE_STATUS_GOOD != escl_status(device,
|
if (SANE_STATUS_GOOD != escl_status(device,
|
||||||
PLATEN,
|
PLATEN,
|
||||||
|
|
|
@ -312,26 +312,24 @@ print_xml_reset_all_jobs (xmlNode *node,
|
||||||
if (find_nodes_s(node)) {
|
if (find_nodes_s(node)) {
|
||||||
if (strcmp((const char *)node->name, "JobUri") == 0) {
|
if (strcmp((const char *)node->name, "JobUri") == 0) {
|
||||||
DBG(10, "print_xml_reset_all_jobs: %s\n", node->name);
|
DBG(10, "print_xml_reset_all_jobs: %s\n", node->name);
|
||||||
if (device != NULL) {
|
if (device != NULL) {
|
||||||
print_xml_job_finish (node, &status);
|
print_xml_job_finish (node, &status);
|
||||||
if (status == SANE_STATUS_DEVICE_BUSY) {
|
if (status == SANE_STATUS_DEVICE_BUSY) {
|
||||||
/*
|
char *jobUri = (char *)xmlNodeGetContent(node);
|
||||||
char *jobUri = (char *)xmlNodeGetContent(node);
|
char *job = strrchr((const char *)jobUri, '/');
|
||||||
char *job = strrchr((const char *)jobUri, '/');
|
char *scanj = NULL;
|
||||||
char *scanj = NULL;
|
if (job != NULL) {
|
||||||
if (job != NULL) {
|
if (strstr(jobUri,"ScanJobs"))
|
||||||
if (strstr(jobUri,"ScanJobs"))
|
scanj = strdup("ScanJobs");
|
||||||
scanj = strdup("ScanJobs");
|
else
|
||||||
else
|
scanj = strdup("ScanJob");
|
||||||
scanj = strdup("ScanJob");
|
|
||||||
DBG(10, "print_xml_reset_all_jobs: %s/%s\n", scanj, job);
|
DBG(10, "print_xml_reset_all_jobs: %s/%s\n", scanj, job);
|
||||||
escl_scanner(device, scanj, job, SANE_FALSE);
|
escl_scanner(device, scanj, job, SANE_FALSE);
|
||||||
free(scanj);
|
free(scanj);
|
||||||
}*/
|
}
|
||||||
DBG(10, "print_xml_reset_all_jobs: sleep to finish the job\n");
|
DBG(10, "print_xml_reset_all_jobs: sleep to finish the job\n");
|
||||||
sleep (3);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue