cURL global init/cleanup issues.

merge-requests/297/head
thierry1970 2020-01-07 15:01:47 +01:00
rodzic dad063068d
commit 94daddc6bd
6 zmienionych plików z 2 dodań i 11 usunięć

Wyświetl plik

@ -170,7 +170,7 @@ sane_init(SANE_Int *version_code, SANE_Auth_Callback __sane_unused__ authorize)
DBG_INIT();
DBG (10, "escl sane_init\n");
SANE_Status status = SANE_STATUS_GOOD;
curl_global_init(CURL_GLOBAL_ALL);
if (version_code != NULL)
*version_code = SANE_VERSION_CODE(1, 0, 0);
if (status != SANE_STATUS_GOOD)
@ -200,6 +200,7 @@ sane_exit(void)
free (devlist);
list_devices_primary = NULL;
devlist = NULL;
curl_global_cleanup();
}
/**

Wyświetl plik

@ -343,7 +343,6 @@ escl_capabilities(SANE_String_Const name, SANE_Status *status)
*status = SANE_STATUS_NO_MEM;
var->memory = malloc(1);
var->size = 0;
curl_global_init(CURL_GLOBAL_ALL);
curl_handle = curl_easy_init();
strcpy(tmp, name);
strcat(tmp, scanner_capabilities);
@ -370,6 +369,5 @@ escl_capabilities(SANE_String_Const name, SANE_Status *status)
xmlMemoryDump();
curl_easy_cleanup(curl_handle);
free(var->memory);
curl_global_cleanup();
return (scanner);
}

Wyświetl plik

@ -152,7 +152,6 @@ escl_newjob (capabilities_t *scanner, SANE_String_Const name, SANE_Status *statu
*status = SANE_STATUS_NO_MEM;
return (NULL);
}
curl_global_init(CURL_GLOBAL_ALL);
curl_handle = curl_easy_init();
if (scanner->format_ext == 1)
{
@ -219,7 +218,6 @@ escl_newjob (capabilities_t *scanner, SANE_String_Const name, SANE_Status *statu
}
curl_easy_cleanup(curl_handle);
}
curl_global_cleanup();
if (upload != NULL)
free(upload);
if (download != NULL)

Wyświetl plik

@ -45,7 +45,6 @@ escl_scanner(SANE_String_Const name, char *result)
if (name == NULL || result == NULL)
return;
curl_global_init(CURL_GLOBAL_ALL);
CURL_CALL:
curl_handle = curl_easy_init();
if (curl_handle != NULL) {
@ -68,5 +67,4 @@ CURL_CALL:
}
curl_easy_cleanup(curl_handle);
}
curl_global_cleanup();
}

Wyświetl plik

@ -65,7 +65,6 @@ escl_scan(capabilities_t __sane_unused__ *scanner, SANE_String_Const name, char
if (name == NULL)
return (SANE_STATUS_NO_MEM);
curl_global_init(CURL_GLOBAL_ALL);
curl_handle = curl_easy_init();
if (curl_handle != NULL) {
strcpy(scan_cmd, name);
@ -90,7 +89,6 @@ escl_scan(capabilities_t __sane_unused__ *scanner, SANE_String_Const name, char
}
else
status = SANE_STATUS_NO_MEM;
curl_global_cleanup();
}
return (status);
}

Wyświetl plik

@ -132,7 +132,6 @@ escl_status(SANE_String_Const name)
return (SANE_STATUS_NO_MEM);
var->memory = malloc(1);
var->size = 0;
curl_global_init(CURL_GLOBAL_ALL);
curl_handle = curl_easy_init();
strcpy(tmp, name);
strcat(tmp, scanner_status);
@ -168,6 +167,5 @@ clean_data:
curl_easy_cleanup(curl_handle);
free(var->memory);
free(var);
curl_global_cleanup();
return (status);
}