netcdf-c/libdap4/d4curlfunctions.h
Dennis Heimbigner d1e17b5ee7 re: pull request: https://github.com/Unidata/netcdf-c/issues/487
The use of the following version-specific curl flags
is not always properly wrapped or aliased using
config.h HAVE_CURL... ifdefs.
# CURLOPT_USERNAME is not defined until curl version 7.19.1
# CURLOPT_PASSWORD is not defined until curl version 7.19.1
# CURLOPT_KEYPASSWD is not defined until curl version 7.16.4
  -- aliased as needed to CURLOPT_SSLKEYPASSWD
# CURLINFO_RESPONSE_CODE is not defined until curl version 7.10.7
  -- aliased as needed to CURLINFO_HTTP_CODE
# CURLOPT_CHUNK_BGN_FUNCTION is not defined until curl version 7.21.0
  -- not used in our code
2017-09-18 16:44:31 -06:00

39 lines
1.2 KiB
C

/*********************************************************************
* Copyright 2016, UCAR/Unidata
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
*********************************************************************/
#ifndef D4CURLFUNCTIONS_H
#define D4CURLFUNCTIONS_H
/* Aliases to older names */
#ifndef HAVE_CURLOPT_KEYPASSWD
#define CURLOPT_KEYPASSWD CURLOPT_SSLKEYPASSWD
#endif
#ifndef HAVE_CURLINFO_RESPONSE_CODE
#define CURLINFO_RESPONSE_CODE CURLINFO_HTTP_CODE
#endif
enum CURLFLAGTYPE {CF_UNKNOWN=0,CF_OTHER=1,CF_STRING=2,CF_LONG=3};
struct CURLFLAG {
const char* name;
int flag;
int value;
enum CURLFLAGTYPE type;
};
extern ncerror NCD4_set_curlopt(NCD4INFO* state, int flag, void* value);
extern ncerror NCD4_set_flags_perfetch(NCD4INFO*);
extern ncerror NCD4_set_flags_perlink(NCD4INFO*);
extern ncerror NCD4_set_curlflag(NCD4INFO*,int);
extern ncerror NCD4_set_curlstate(NCD4INFO* state, int flag, void* value);
extern void NCD4_curl_debug(NCD4INFO* state);
extern struct CURLFLAG* NCD4_curlflagbyname(const char* name);
extern void NCD4_curl_protocols(NCD4globalstate* state);
#endif /*D4CURLFUNCTIONS_H*/