Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ message (STATUS "Searching dependent libraries. This may take a few minutes...")
find_package (NETCDF REQUIRED)
include_directories (${NETCDF_INCLUDE_DIR})

# libcurl is required since 5.4
find_package (CURL REQUIRED)
# libcurl is required since GMT 5.4
# At least version 7.55.0 is needed for src/gmt_remote.c
find_package (CURL 7.55.0 REQUIRED)
include_directories (${CURL_INCLUDE_DIRS})
list (APPEND GMT_OPTIONAL_LIBRARIES ${CURL_LIBRARIES})
set (CURL_LIBRARY ${CURL_LIBRARIES} CACHE INTERNAL "")
Expand Down
6 changes: 3 additions & 3 deletions src/gmt_remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ GMT_LOCAL size_t gmtremote_skip_large_files (struct GMT_CTRL *GMT, char * URL, s
/* Get the remote file's size and if too large we refuse to download */
CURL *curl = NULL;
CURLcode res;
double filesize = 0.0;
curl_off_t filesize = 0;
size_t action = 0;
char curl_useragent[GMT_LEN64];

Expand Down Expand Up @@ -677,10 +677,10 @@ GMT_LOCAL size_t gmtremote_skip_large_files (struct GMT_CTRL *GMT, char * URL, s
res = curl_easy_perform (curl);

if ((res = curl_easy_perform (curl)) == CURLE_OK) {
res = curl_easy_getinfo (curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &filesize);
res = curl_easy_getinfo (curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &filesize);
if ((res == CURLE_OK) && (filesize > 0.0)) { /* Got the size */
GMT_Report (GMT->parent, GMT_MSG_INFORMATION, "Remote file %s: Size is %0.0f bytes\n", URL, filesize);
action = (filesize < (double)limit) ? 0 : (size_t)filesize;
action = ((size_t)filesize < limit) ? 0 : (size_t)filesize;
}
}
else /* We failed */
Expand Down
Loading