mirror of
https://github.com/moparisthebest/curl
synced 2024-11-12 04:25:08 -05:00
packages/OS400: make the source code-style compliant
... and make sure 'make checksrc' in the root dir also verifies the packages/OS400 sources. Closes https://github.com/curl/curl/pull/6085
This commit is contained in:
parent
3bcd81df92
commit
f3b7d72c57
@ -328,6 +328,7 @@ checksrc:
|
|||||||
(cd tests && $(MAKE) checksrc)
|
(cd tests && $(MAKE) checksrc)
|
||||||
(cd include/curl && $(MAKE) checksrc)
|
(cd include/curl && $(MAKE) checksrc)
|
||||||
(cd docs/examples && $(MAKE) checksrc)
|
(cd docs/examples && $(MAKE) checksrc)
|
||||||
|
(cd packages && $(MAKE) checksrc)
|
||||||
|
|
||||||
.PHONY: vc-ide
|
.PHONY: vc-ide
|
||||||
|
|
||||||
|
@ -41,3 +41,11 @@ EXTRA_DIST = README \
|
|||||||
TPF/maketpf.env_curl \
|
TPF/maketpf.env_curl \
|
||||||
TPF/maketpf.env_curllib \
|
TPF/maketpf.env_curllib \
|
||||||
Android/Android.mk
|
Android/Android.mk
|
||||||
|
|
||||||
|
CHECKSRC = $(CS_$(V))
|
||||||
|
CS_0 = @echo " RUN " $@;
|
||||||
|
CS_1 =
|
||||||
|
CS_ = $(CS_0)
|
||||||
|
|
||||||
|
checksrc:
|
||||||
|
$(CHECKSRC)(@PERL@ $(top_srcdir)/lib/checksrc.pl -D$(srcdir) $(srcdir)/OS400/*.[ch])
|
||||||
|
@ -57,7 +57,6 @@
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
makeOS400IconvCode(char buf[ICONV_ID_SIZE], unsigned int ccsid)
|
makeOS400IconvCode(char buf[ICONV_ID_SIZE], unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*** Convert a CCSID to the corresponding IBM iconv_open() character
|
*** Convert a CCSID to the corresponding IBM iconv_open() character
|
||||||
@ -79,8 +78,7 @@ makeOS400IconvCode(char buf[ICONV_ID_SIZE], unsigned int ccsid)
|
|||||||
|
|
||||||
static iconv_t
|
static iconv_t
|
||||||
iconv_open_CCSID(unsigned int ccsidout, unsigned int ccsidin,
|
iconv_open_CCSID(unsigned int ccsidout, unsigned int ccsidin,
|
||||||
unsigned int cstr)
|
unsigned int cstr)
|
||||||
|
|
||||||
{
|
{
|
||||||
char fromcode[ICONV_ID_SIZE];
|
char fromcode[ICONV_ID_SIZE];
|
||||||
char tocode[ICONV_ID_SIZE];
|
char tocode[ICONV_ID_SIZE];
|
||||||
@ -106,7 +104,6 @@ iconv_open_CCSID(unsigned int ccsidout, unsigned int ccsidin,
|
|||||||
static int
|
static int
|
||||||
convert(char *d, size_t dlen, int dccsid,
|
convert(char *d, size_t dlen, int dccsid,
|
||||||
const char *s, int slen, int sccsid)
|
const char *s, int slen, int sccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
iconv_t cd;
|
iconv_t cd;
|
||||||
@ -160,9 +157,7 @@ convert(char *d, size_t dlen, int dccsid,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static char *
|
static char *dynconvert(int dccsid, const char *s, int slen, int sccsid)
|
||||||
dynconvert(int dccsid, const char *s, int slen, int sccsid)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
char *d;
|
char *d;
|
||||||
char *cp;
|
char *cp;
|
||||||
@ -214,7 +209,6 @@ dynconvert(int dccsid, const char *s, int slen, int sccsid)
|
|||||||
|
|
||||||
static struct curl_slist *
|
static struct curl_slist *
|
||||||
slist_convert(int dccsid, struct curl_slist *from, int sccsid)
|
slist_convert(int dccsid, struct curl_slist *from, int sccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct curl_slist *to = (struct curl_slist *) NULL;
|
struct curl_slist *to = (struct curl_slist *) NULL;
|
||||||
|
|
||||||
@ -238,9 +232,7 @@ slist_convert(int dccsid, struct curl_slist *from, int sccsid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *curl_version_ccsid(unsigned int ccsid)
|
||||||
curl_version_ccsid(unsigned int ccsid)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *aversion;
|
char *aversion;
|
||||||
@ -268,7 +260,6 @@ curl_version_ccsid(unsigned int ccsid)
|
|||||||
char *
|
char *
|
||||||
curl_easy_escape_ccsid(CURL *handle, const char *string, int length,
|
curl_easy_escape_ccsid(CURL *handle, const char *string, int length,
|
||||||
unsigned int sccsid, unsigned int dccsid)
|
unsigned int sccsid, unsigned int dccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
char *d;
|
char *d;
|
||||||
@ -299,7 +290,6 @@ char *
|
|||||||
curl_easy_unescape_ccsid(CURL *handle, const char *string, int length,
|
curl_easy_unescape_ccsid(CURL *handle, const char *string, int length,
|
||||||
int *outlength,
|
int *outlength,
|
||||||
unsigned int sccsid, unsigned int dccsid)
|
unsigned int sccsid, unsigned int dccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
char *d;
|
char *d;
|
||||||
@ -333,7 +323,6 @@ curl_easy_unescape_ccsid(CURL *handle, const char *string, int length,
|
|||||||
struct curl_slist *
|
struct curl_slist *
|
||||||
curl_slist_append_ccsid(struct curl_slist *list,
|
curl_slist_append_ccsid(struct curl_slist *list,
|
||||||
const char *data, unsigned int ccsid)
|
const char *data, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
@ -355,7 +344,6 @@ curl_slist_append_ccsid(struct curl_slist *list,
|
|||||||
|
|
||||||
time_t
|
time_t
|
||||||
curl_getdate_ccsid(const char *p, const time_t * unused, unsigned int ccsid)
|
curl_getdate_ccsid(const char *p, const time_t * unused, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
time_t t;
|
time_t t;
|
||||||
@ -377,7 +365,6 @@ curl_getdate_ccsid(const char *p, const time_t * unused, unsigned int ccsid)
|
|||||||
static int
|
static int
|
||||||
convert_version_info_string(const char * * stringp,
|
convert_version_info_string(const char * * stringp,
|
||||||
char * * bufp, int *left, unsigned int ccsid)
|
char * * bufp, int *left, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
/* Helper for curl_version_info_ccsid(): convert a string if defined.
|
/* Helper for curl_version_info_ccsid(): convert a string if defined.
|
||||||
Result is stored in the `*left'-byte buffer at `*bufp'.
|
Result is stored in the `*left'-byte buffer at `*bufp'.
|
||||||
@ -401,13 +388,12 @@ convert_version_info_string(const char * * stringp,
|
|||||||
|
|
||||||
curl_version_info_data *
|
curl_version_info_data *
|
||||||
curl_version_info_ccsid(CURLversion stamp, unsigned int ccsid)
|
curl_version_info_ccsid(CURLversion stamp, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
curl_version_info_data * p;
|
curl_version_info_data *p;
|
||||||
char *cp;
|
char *cp;
|
||||||
int n;
|
int n;
|
||||||
int nproto;
|
int nproto;
|
||||||
curl_version_info_data * id;
|
curl_version_info_data *id;
|
||||||
|
|
||||||
/* The assertion below is possible, because although the second operand
|
/* The assertion below is possible, because although the second operand
|
||||||
is an enum member, the first is a #define. In that case, the OS/400 C
|
is an enum member, the first is a #define. In that case, the OS/400 C
|
||||||
@ -519,7 +505,6 @@ curl_version_info_ccsid(CURLversion stamp, unsigned int ccsid)
|
|||||||
|
|
||||||
const char *
|
const char *
|
||||||
curl_easy_strerror_ccsid(CURLcode error, unsigned int ccsid)
|
curl_easy_strerror_ccsid(CURLcode error, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
const char *s;
|
const char *s;
|
||||||
@ -545,7 +530,6 @@ curl_easy_strerror_ccsid(CURLcode error, unsigned int ccsid)
|
|||||||
|
|
||||||
const char *
|
const char *
|
||||||
curl_share_strerror_ccsid(CURLSHcode error, unsigned int ccsid)
|
curl_share_strerror_ccsid(CURLSHcode error, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
const char *s;
|
const char *s;
|
||||||
@ -571,7 +555,6 @@ curl_share_strerror_ccsid(CURLSHcode error, unsigned int ccsid)
|
|||||||
|
|
||||||
const char *
|
const char *
|
||||||
curl_multi_strerror_ccsid(CURLMcode error, unsigned int ccsid)
|
curl_multi_strerror_ccsid(CURLMcode error, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
const char *s;
|
const char *s;
|
||||||
@ -597,7 +580,6 @@ curl_multi_strerror_ccsid(CURLMcode error, unsigned int ccsid)
|
|||||||
|
|
||||||
void
|
void
|
||||||
curl_certinfo_free_all(struct curl_certinfo *info)
|
curl_certinfo_free_all(struct curl_certinfo *info)
|
||||||
|
|
||||||
{
|
{
|
||||||
/* Free all memory used by certificate info. */
|
/* Free all memory used by certificate info. */
|
||||||
if(info) {
|
if(info) {
|
||||||
@ -615,12 +597,11 @@ curl_certinfo_free_all(struct curl_certinfo *info)
|
|||||||
|
|
||||||
CURLcode
|
CURLcode
|
||||||
curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...)
|
curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...)
|
||||||
|
|
||||||
{
|
{
|
||||||
va_list arg;
|
va_list arg;
|
||||||
void *paramp;
|
void *paramp;
|
||||||
CURLcode ret;
|
CURLcode ret;
|
||||||
struct Curl_easy * data;
|
struct Curl_easy *data;
|
||||||
|
|
||||||
/* WARNING: unlike curl_easy_getinfo(), the strings returned by this
|
/* WARNING: unlike curl_easy_getinfo(), the strings returned by this
|
||||||
procedure have to be free'ed. */
|
procedure have to be free'ed. */
|
||||||
@ -716,7 +697,6 @@ curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...)
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
Curl_is_formadd_string(CURLformoption option)
|
Curl_is_formadd_string(CURLformoption option)
|
||||||
|
|
||||||
{
|
{
|
||||||
switch(option) {
|
switch(option) {
|
||||||
|
|
||||||
@ -735,8 +715,7 @@ Curl_is_formadd_string(CURLformoption option)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
Curl_formadd_release_local(struct curl_forms * forms, int nargs, int skip)
|
Curl_formadd_release_local(struct curl_forms *forms, int nargs, int skip)
|
||||||
|
|
||||||
{
|
{
|
||||||
while(nargs--)
|
while(nargs--)
|
||||||
if(nargs != skip)
|
if(nargs != skip)
|
||||||
@ -749,9 +728,8 @@ Curl_formadd_release_local(struct curl_forms * forms, int nargs, int skip)
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Curl_formadd_convert(struct curl_forms * forms,
|
Curl_formadd_convert(struct curl_forms *forms,
|
||||||
int formx, int lengthx, unsigned int ccsid)
|
int formx, int lengthx, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
int l;
|
int l;
|
||||||
char *cp;
|
char *cp;
|
||||||
@ -795,14 +773,13 @@ Curl_formadd_convert(struct curl_forms * forms,
|
|||||||
CURLFORMcode
|
CURLFORMcode
|
||||||
curl_formadd_ccsid(struct curl_httppost * * httppost,
|
curl_formadd_ccsid(struct curl_httppost * * httppost,
|
||||||
struct curl_httppost * * last_post, ...)
|
struct curl_httppost * * last_post, ...)
|
||||||
|
|
||||||
{
|
{
|
||||||
va_list arg;
|
va_list arg;
|
||||||
CURLformoption option;
|
CURLformoption option;
|
||||||
CURLFORMcode result;
|
CURLFORMcode result;
|
||||||
struct curl_forms * forms;
|
struct curl_forms *forms;
|
||||||
struct curl_forms * lforms;
|
struct curl_forms *lforms;
|
||||||
struct curl_forms * tforms;
|
struct curl_forms *tforms;
|
||||||
unsigned int lformlen;
|
unsigned int lformlen;
|
||||||
const char *value;
|
const char *value;
|
||||||
unsigned int ccsid;
|
unsigned int ccsid;
|
||||||
@ -1066,18 +1043,17 @@ curl_formadd_ccsid(struct curl_httppost * * httppost,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
struct cfcdata {
|
||||||
curl_formget_callback append;
|
curl_formget_callback append;
|
||||||
void * arg;
|
void * arg;
|
||||||
unsigned int ccsid;
|
unsigned int ccsid;
|
||||||
} cfcdata;
|
};
|
||||||
|
|
||||||
|
|
||||||
static size_t
|
static size_t
|
||||||
Curl_formget_callback_ccsid(void *arg, const char *buf, size_t len)
|
Curl_formget_callback_ccsid(void *arg, const char *buf, size_t len)
|
||||||
|
|
||||||
{
|
{
|
||||||
cfcdata * p;
|
struct cfcdata *p;
|
||||||
char *b;
|
char *b;
|
||||||
int l;
|
int l;
|
||||||
size_t ret;
|
size_t ret;
|
||||||
@ -1108,7 +1084,6 @@ Curl_formget_callback_ccsid(void *arg, const char *buf, size_t len)
|
|||||||
int
|
int
|
||||||
curl_formget_ccsid(struct curl_httppost *form, void *arg,
|
curl_formget_ccsid(struct curl_httppost *form, void *arg,
|
||||||
curl_formget_callback append, unsigned int ccsid)
|
curl_formget_callback append, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
cfcdata lcfc;
|
cfcdata lcfc;
|
||||||
|
|
||||||
@ -1121,7 +1096,6 @@ curl_formget_ccsid(struct curl_httppost *form, void *arg,
|
|||||||
|
|
||||||
CURLcode
|
CURLcode
|
||||||
curl_easy_setopt_ccsid(CURL *curl, CURLoption tag, ...)
|
curl_easy_setopt_ccsid(CURL *curl, CURLoption tag, ...)
|
||||||
|
|
||||||
{
|
{
|
||||||
CURLcode result;
|
CURLcode result;
|
||||||
va_list arg;
|
va_list arg;
|
||||||
@ -1309,7 +1283,6 @@ curl_easy_setopt_ccsid(CURL *curl, CURLoption tag, ...)
|
|||||||
|
|
||||||
char *
|
char *
|
||||||
curl_form_long_value(long value)
|
curl_form_long_value(long value)
|
||||||
|
|
||||||
{
|
{
|
||||||
/* ILE/RPG cannot cast an integer to a pointer. This procedure does it. */
|
/* ILE/RPG cannot cast an integer to a pointer. This procedure does it. */
|
||||||
|
|
||||||
@ -1320,7 +1293,6 @@ curl_form_long_value(long value)
|
|||||||
char *
|
char *
|
||||||
curl_pushheader_bynum_cssid(struct curl_pushheaders *h,
|
curl_pushheader_bynum_cssid(struct curl_pushheaders *h,
|
||||||
size_t num, unsigned int ccsid)
|
size_t num, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *d = (char *) NULL;
|
char *d = (char *) NULL;
|
||||||
char *s = curl_pushheader_bynum(h, num);
|
char *s = curl_pushheader_bynum(h, num);
|
||||||
@ -1335,7 +1307,6 @@ curl_pushheader_bynum_cssid(struct curl_pushheaders *h,
|
|||||||
char *
|
char *
|
||||||
curl_pushheader_byname_ccsid(struct curl_pushheaders *h, const char *header,
|
curl_pushheader_byname_ccsid(struct curl_pushheaders *h, const char *header,
|
||||||
unsigned int ccsidin, unsigned int ccsidout)
|
unsigned int ccsidin, unsigned int ccsidout)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *d = (char *) NULL;
|
char *d = (char *) NULL;
|
||||||
|
|
||||||
@ -1357,7 +1328,6 @@ curl_pushheader_byname_ccsid(struct curl_pushheaders *h, const char *header,
|
|||||||
static CURLcode
|
static CURLcode
|
||||||
mime_string_call(curl_mimepart *part, const char *string, unsigned int ccsid,
|
mime_string_call(curl_mimepart *part, const char *string, unsigned int ccsid,
|
||||||
CURLcode (*mimefunc)(curl_mimepart *part, const char *string))
|
CURLcode (*mimefunc)(curl_mimepart *part, const char *string))
|
||||||
|
|
||||||
{
|
{
|
||||||
char *s = (char *) NULL;
|
char *s = (char *) NULL;
|
||||||
CURLcode result;
|
CURLcode result;
|
||||||
@ -1375,7 +1345,6 @@ mime_string_call(curl_mimepart *part, const char *string, unsigned int ccsid,
|
|||||||
|
|
||||||
CURLcode
|
CURLcode
|
||||||
curl_mime_name_ccsid(curl_mimepart *part, const char *name, unsigned int ccsid)
|
curl_mime_name_ccsid(curl_mimepart *part, const char *name, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
return mime_string_call(part, name, ccsid, curl_mime_name);
|
return mime_string_call(part, name, ccsid, curl_mime_name);
|
||||||
}
|
}
|
||||||
@ -1383,7 +1352,6 @@ curl_mime_name_ccsid(curl_mimepart *part, const char *name, unsigned int ccsid)
|
|||||||
CURLcode
|
CURLcode
|
||||||
curl_mime_filename_ccsid(curl_mimepart *part,
|
curl_mime_filename_ccsid(curl_mimepart *part,
|
||||||
const char *filename, unsigned int ccsid)
|
const char *filename, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
return mime_string_call(part, filename, ccsid, curl_mime_filename);
|
return mime_string_call(part, filename, ccsid, curl_mime_filename);
|
||||||
}
|
}
|
||||||
@ -1391,7 +1359,6 @@ curl_mime_filename_ccsid(curl_mimepart *part,
|
|||||||
CURLcode
|
CURLcode
|
||||||
curl_mime_type_ccsid(curl_mimepart *part,
|
curl_mime_type_ccsid(curl_mimepart *part,
|
||||||
const char *mimetype, unsigned int ccsid)
|
const char *mimetype, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
return mime_string_call(part, mimetype, ccsid, curl_mime_type);
|
return mime_string_call(part, mimetype, ccsid, curl_mime_type);
|
||||||
}
|
}
|
||||||
@ -1399,7 +1366,6 @@ curl_mime_type_ccsid(curl_mimepart *part,
|
|||||||
CURLcode
|
CURLcode
|
||||||
curl_mime_encoder_ccsid(curl_mimepart *part,
|
curl_mime_encoder_ccsid(curl_mimepart *part,
|
||||||
const char *encoding, unsigned int ccsid)
|
const char *encoding, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
return mime_string_call(part, encoding, ccsid, curl_mime_encoder);
|
return mime_string_call(part, encoding, ccsid, curl_mime_encoder);
|
||||||
}
|
}
|
||||||
@ -1407,7 +1373,6 @@ curl_mime_encoder_ccsid(curl_mimepart *part,
|
|||||||
CURLcode
|
CURLcode
|
||||||
curl_mime_filedata_ccsid(curl_mimepart *part,
|
curl_mime_filedata_ccsid(curl_mimepart *part,
|
||||||
const char *filename, unsigned int ccsid)
|
const char *filename, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
return mime_string_call(part, filename, ccsid, curl_mime_filedata);
|
return mime_string_call(part, filename, ccsid, curl_mime_filedata);
|
||||||
}
|
}
|
||||||
@ -1415,7 +1380,6 @@ curl_mime_filedata_ccsid(curl_mimepart *part,
|
|||||||
CURLcode
|
CURLcode
|
||||||
curl_mime_data_ccsid(curl_mimepart *part,
|
curl_mime_data_ccsid(curl_mimepart *part,
|
||||||
const char *data, size_t datasize, unsigned int ccsid)
|
const char *data, size_t datasize, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *s = (char *) NULL;
|
char *s = (char *) NULL;
|
||||||
CURLcode result;
|
CURLcode result;
|
||||||
@ -1434,7 +1398,6 @@ curl_mime_data_ccsid(curl_mimepart *part,
|
|||||||
CURLUcode
|
CURLUcode
|
||||||
curl_url_get_ccsid(CURLU *handle, CURLUPart what, char **part,
|
curl_url_get_ccsid(CURLU *handle, CURLUPart what, char **part,
|
||||||
unsigned int flags, unsigned int ccsid)
|
unsigned int flags, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *s = (char *)NULL;
|
char *s = (char *)NULL;
|
||||||
CURLUcode result;
|
CURLUcode result;
|
||||||
@ -1459,7 +1422,6 @@ curl_url_get_ccsid(CURLU *handle, CURLUPart what, char **part,
|
|||||||
CURLUcode
|
CURLUcode
|
||||||
curl_url_set_ccsid(CURLU *handle, CURLUPart what, const char *part,
|
curl_url_set_ccsid(CURLU *handle, CURLUPart what, const char *part,
|
||||||
unsigned int flags, unsigned int ccsid)
|
unsigned int flags, unsigned int ccsid)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *s = (char *)NULL;
|
char *s = (char *)NULL;
|
||||||
CURLUcode result;
|
CURLUcode result;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -27,37 +27,37 @@
|
|||||||
#include "multi.h"
|
#include "multi.h"
|
||||||
|
|
||||||
|
|
||||||
CURL_EXTERN char * curl_version_ccsid(unsigned int ccsid);
|
CURL_EXTERN char *curl_version_ccsid(unsigned int ccsid);
|
||||||
CURL_EXTERN char * curl_easy_escape_ccsid(CURL * handle,
|
CURL_EXTERN char *curl_easy_escape_ccsid(CURL *handle,
|
||||||
const char * string, int length,
|
const char *string, int length,
|
||||||
unsigned int sccsid,
|
unsigned int sccsid,
|
||||||
unsigned int dccsid);
|
unsigned int dccsid);
|
||||||
CURL_EXTERN char * curl_easy_unescape_ccsid(CURL * handle, const char * string,
|
CURL_EXTERN char *curl_easy_unescape_ccsid(CURL *handle, const char *string,
|
||||||
int length, int * outlength,
|
int length, int *outlength,
|
||||||
unsigned int sccsid,
|
unsigned int sccsid,
|
||||||
unsigned int dccsid);
|
unsigned int dccsid);
|
||||||
CURL_EXTERN struct curl_slist * curl_slist_append_ccsid(struct curl_slist * l,
|
CURL_EXTERN struct curl_slist *curl_slist_append_ccsid(struct curl_slist *l,
|
||||||
const char * data,
|
const char *data,
|
||||||
unsigned int ccsid);
|
unsigned int ccsid);
|
||||||
CURL_EXTERN time_t curl_getdate_ccsid(const char * p, const time_t * unused,
|
CURL_EXTERN time_t curl_getdate_ccsid(const char *p, const time_t *unused,
|
||||||
unsigned int ccsid);
|
unsigned int ccsid);
|
||||||
CURL_EXTERN curl_version_info_data * curl_version_info_ccsid(CURLversion stamp,
|
CURL_EXTERN curl_version_info_data *curl_version_info_ccsid(CURLversion stamp,
|
||||||
unsigned int cid);
|
unsigned int cid);
|
||||||
CURL_EXTERN const char * curl_easy_strerror_ccsid(CURLcode error,
|
CURL_EXTERN const char *curl_easy_strerror_ccsid(CURLcode error,
|
||||||
|
unsigned int ccsid);
|
||||||
|
CURL_EXTERN const char *curl_share_strerror_ccsid(CURLSHcode error,
|
||||||
unsigned int ccsid);
|
unsigned int ccsid);
|
||||||
CURL_EXTERN const char * curl_share_strerror_ccsid(CURLSHcode error,
|
CURL_EXTERN const char *curl_multi_strerror_ccsid(CURLMcode error,
|
||||||
unsigned int ccsid);
|
unsigned int ccsid);
|
||||||
CURL_EXTERN const char * curl_multi_strerror_ccsid(CURLMcode error,
|
CURL_EXTERN CURLcode curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...);
|
||||||
unsigned int ccsid);
|
CURL_EXTERN CURLFORMcode curl_formadd_ccsid(struct curl_httppost **httppost,
|
||||||
CURL_EXTERN CURLcode curl_easy_getinfo_ccsid(CURL * curl, CURLINFO info, ...);
|
struct curl_httppost **last_post,
|
||||||
CURL_EXTERN CURLFORMcode curl_formadd_ccsid(struct curl_httppost * * httppost,
|
|
||||||
struct curl_httppost * * last_post,
|
|
||||||
...);
|
...);
|
||||||
CURL_EXTERN char * curl_form_long_value(long value);
|
CURL_EXTERN char *curl_form_long_value(long value);
|
||||||
CURL_EXTERN int curl_formget_ccsid(struct curl_httppost * form, void * arg,
|
CURL_EXTERN int curl_formget_ccsid(struct curl_httppost *form, void *arg,
|
||||||
curl_formget_callback append,
|
curl_formget_callback append,
|
||||||
unsigned int ccsid);
|
unsigned int ccsid);
|
||||||
CURL_EXTERN CURLcode curl_easy_setopt_ccsid(CURL * curl, CURLoption tag, ...);
|
CURL_EXTERN CURLcode curl_easy_setopt_ccsid(CURL *curl, CURLoption tag, ...);
|
||||||
CURL_EXTERN void curl_certinfo_free_all(struct curl_certinfo *info);
|
CURL_EXTERN void curl_certinfo_free_all(struct curl_certinfo *info);
|
||||||
CURL_EXTERN char *curl_pushheader_bynum_cssid(struct curl_pushheaders *h,
|
CURL_EXTERN char *curl_pushheader_bynum_cssid(struct curl_pushheaders *h,
|
||||||
size_t num, unsigned int ccsid);
|
size_t num, unsigned int ccsid);
|
||||||
|
@ -25,11 +25,12 @@
|
|||||||
#include "curl_setup.h"
|
#include "curl_setup.h"
|
||||||
#include "urldata.h"
|
#include "urldata.h"
|
||||||
|
|
||||||
/* The following defines indicate the expected dupstring enum values
|
/* The following defines indicate the expected dupstring enum values in
|
||||||
* in curl_easy_setopt_ccsid() in packages/OS400/ccsidcurl.c. If a
|
* curl_easy_setopt_ccsid() in packages/OS400/ccsidcurl.c. If a mismatch is
|
||||||
* mismatch is flagged during the build, it indicates that curl_easy_setopt_ccsid()
|
* flagged during the build, it indicates that curl_easy_setopt_ccsid() may
|
||||||
* may need updating to perform data EBCDIC to ASCII data conversion on
|
* need updating to perform data EBCDIC to ASCII data conversion on the
|
||||||
* the string.
|
* string.
|
||||||
|
*
|
||||||
* Once any applicable changes to curl_easy_setopt_ccsid() have been
|
* Once any applicable changes to curl_easy_setopt_ccsid() have been
|
||||||
* made, the EXPECTED_STRING_LASTZEROTERMINATED/EXPECTED_STRING_LAST
|
* made, the EXPECTED_STRING_LASTZEROTERMINATED/EXPECTED_STRING_LAST
|
||||||
* values can be updated to match the latest enum values in urldata.h.
|
* values can be updated to match the latest enum values in urldata.h.
|
||||||
@ -41,22 +42,21 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
if (STRING_LASTZEROTERMINATED != EXPECTED_STRING_LASTZEROTERMINATED)
|
if(STRING_LASTZEROTERMINATED != EXPECTED_STRING_LASTZEROTERMINATED) {
|
||||||
{
|
fprintf(stderr,
|
||||||
fprintf(stderr,"STRING_LASTZEROTERMINATED(%d) is not expected value(%d).\n",
|
"STRING_LASTZEROTERMINATED(%d) is not expected value(%d).\n",
|
||||||
STRING_LASTZEROTERMINATED, EXPECTED_STRING_LASTZEROTERMINATED);
|
STRING_LASTZEROTERMINATED, EXPECTED_STRING_LASTZEROTERMINATED);
|
||||||
rc += 1;
|
rc += 1;
|
||||||
}
|
}
|
||||||
if (STRING_LAST != EXPECTED_STRING_LAST)
|
if(STRING_LAST != EXPECTED_STRING_LAST) {
|
||||||
{
|
fprintf(stderr, "STRING_LAST(%d) is not expected value(%d).\n",
|
||||||
fprintf(stderr,"STRING_LAST(%d) is not expected value(%d).\n",
|
|
||||||
STRING_LAST, EXPECTED_STRING_LAST);
|
STRING_LAST, EXPECTED_STRING_LAST);
|
||||||
rc += 2;
|
rc += 2;
|
||||||
}
|
}
|
||||||
if (rc != 0)
|
if(rc) {
|
||||||
{
|
fprintf(stderr, "curl_easy_setopt_ccsid() in packages/OS400/ccsidcurl.c"
|
||||||
fprintf(stderr,"curl_easy_setopt_ccsid() in packages/OS400/ccsidcurl.c"
|
" may need updating if new strings are provided as"
|
||||||
" may need updating if new strings are provided as input via the curl API.\n");
|
" input via the curl API.\n");
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -60,78 +60,70 @@
|
|||||||
|
|
||||||
#include "os400sys.h"
|
#include "os400sys.h"
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*** QADRT OS/400 ASCII runtime defines only the most used procedures, but
|
*** QADRT OS/400 ASCII runtime defines only the most used procedures, but a
|
||||||
*** but a lot of them are not supported. This module implements
|
*** lot of them are not supported. This module implements ASCII wrappers for
|
||||||
*** ASCII wrappers for those that are used by libcurl, but not
|
*** those that are used by libcurl, but not defined by QADRT.
|
||||||
*** defined by QADRT.
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#pragma convert(0) /* Restore EBCDIC. */
|
#pragma convert(0) /* Restore EBCDIC. */
|
||||||
|
|
||||||
|
|
||||||
#define MIN_BYTE_GAIN 1024 /* Minimum gain when shortening a buffer. */
|
#define MIN_BYTE_GAIN 1024 /* Minimum gain when shortening a buffer. */
|
||||||
|
|
||||||
typedef struct {
|
struct buffer_t {
|
||||||
unsigned long size; /* Buffer size. */
|
unsigned long size; /* Buffer size. */
|
||||||
char * buf; /* Buffer address. */
|
char *buf; /* Buffer address. */
|
||||||
} buffer_t;
|
};
|
||||||
|
|
||||||
|
|
||||||
static char * buffer_undef(localkey_t key, long size);
|
static char *buffer_undef(localkey_t key, long size);
|
||||||
static char * buffer_threaded(localkey_t key, long size);
|
static char *buffer_threaded(localkey_t key, long size);
|
||||||
static char * buffer_unthreaded(localkey_t key, long size);
|
static char *buffer_unthreaded(localkey_t key, long size);
|
||||||
|
|
||||||
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
static pthread_key_t thdkey;
|
static pthread_key_t thdkey;
|
||||||
static buffer_t * locbufs;
|
static struct buffer_t *locbufs;
|
||||||
|
|
||||||
char * (* Curl_thread_buffer)(localkey_t key, long size) = buffer_undef;
|
char *(*Curl_thread_buffer)(localkey_t key, long size) = buffer_undef;
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
thdbufdestroy(void * private)
|
|
||||||
|
|
||||||
|
static void thdbufdestroy(void *private)
|
||||||
{
|
{
|
||||||
if(private) {
|
if(private) {
|
||||||
buffer_t * p = (buffer_t *) private;
|
struct buffer_t *p = (struct buffer_t *) private;
|
||||||
localkey_t i;
|
localkey_t i;
|
||||||
|
|
||||||
for(i = (localkey_t) 0; i < LK_LAST; i++) {
|
for(i = (localkey_t) 0; i < LK_LAST; i++) {
|
||||||
free(p->buf);
|
free(p->buf);
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(private);
|
free(private);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
terminate(void)
|
terminate(void)
|
||||||
|
|
||||||
{
|
{
|
||||||
if(Curl_thread_buffer == buffer_threaded) {
|
if(Curl_thread_buffer == buffer_threaded) {
|
||||||
locbufs = pthread_getspecific(thdkey);
|
locbufs = pthread_getspecific(thdkey);
|
||||||
pthread_setspecific(thdkey, (void *) NULL);
|
pthread_setspecific(thdkey, (void *) NULL);
|
||||||
pthread_key_delete(thdkey);
|
pthread_key_delete(thdkey);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Curl_thread_buffer != buffer_undef) {
|
if(Curl_thread_buffer != buffer_undef) {
|
||||||
thdbufdestroy((void *) locbufs);
|
thdbufdestroy((void *) locbufs);
|
||||||
locbufs = (buffer_t *) NULL;
|
locbufs = (struct buffer_t *) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Curl_thread_buffer = buffer_undef;
|
Curl_thread_buffer = buffer_undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
get_buffer(buffer_t * buf, long size)
|
get_buffer(struct buffer_t *buf, long size)
|
||||||
|
|
||||||
{
|
{
|
||||||
char * cp;
|
char *cp;
|
||||||
|
|
||||||
/* If `size' >= 0, make sure buffer at `buf' is at least `size'-byte long.
|
/* If `size' >= 0, make sure buffer at `buf' is at least `size'-byte long.
|
||||||
Return the buffer address. */
|
Return the buffer address. */
|
||||||
@ -171,7 +163,6 @@ get_buffer(buffer_t * buf, long size)
|
|||||||
|
|
||||||
static char *
|
static char *
|
||||||
buffer_unthreaded(localkey_t key, long size)
|
buffer_unthreaded(localkey_t key, long size)
|
||||||
|
|
||||||
{
|
{
|
||||||
return get_buffer(locbufs + key, size);
|
return get_buffer(locbufs + key, size);
|
||||||
}
|
}
|
||||||
@ -179,15 +170,14 @@ buffer_unthreaded(localkey_t key, long size)
|
|||||||
|
|
||||||
static char *
|
static char *
|
||||||
buffer_threaded(localkey_t key, long size)
|
buffer_threaded(localkey_t key, long size)
|
||||||
|
|
||||||
{
|
{
|
||||||
buffer_t * bufs;
|
struct buffer_t *bufs;
|
||||||
|
|
||||||
/* Get the buffer for the given local key in the current thread, and
|
/* Get the buffer for the given local key in the current thread, and
|
||||||
make sure it is at least `size'-byte long. Set `size' to < 0 to get
|
make sure it is at least `size'-byte long. Set `size' to < 0 to get
|
||||||
its address only. */
|
its address only. */
|
||||||
|
|
||||||
bufs = (buffer_t *) pthread_getspecific(thdkey);
|
bufs = (struct buffer_t *) pthread_getspecific(thdkey);
|
||||||
|
|
||||||
if(!bufs) {
|
if(!bufs) {
|
||||||
if(size < 0)
|
if(size < 0)
|
||||||
@ -211,7 +201,6 @@ buffer_threaded(localkey_t key, long size)
|
|||||||
|
|
||||||
static char *
|
static char *
|
||||||
buffer_undef(localkey_t key, long size)
|
buffer_undef(localkey_t key, long size)
|
||||||
|
|
||||||
{
|
{
|
||||||
/* Define the buffer system, get the buffer for the given local key in
|
/* Define the buffer system, get the buffer for the given local key in
|
||||||
the current thread, and make sure it is at least `size'-byte long.
|
the current thread, and make sure it is at least `size'-byte long.
|
||||||
@ -224,15 +213,18 @@ buffer_undef(localkey_t key, long size)
|
|||||||
if(Curl_thread_buffer == buffer_undef) { /* If unchanged during lock. */
|
if(Curl_thread_buffer == buffer_undef) { /* If unchanged during lock. */
|
||||||
if(!pthread_key_create(&thdkey, thdbufdestroy))
|
if(!pthread_key_create(&thdkey, thdbufdestroy))
|
||||||
Curl_thread_buffer = buffer_threaded;
|
Curl_thread_buffer = buffer_threaded;
|
||||||
else if(!(locbufs = calloc((size_t) LK_LAST, sizeof(*locbufs)))) {
|
else {
|
||||||
pthread_mutex_unlock(&mutex);
|
locbufs = calloc((size_t) LK_LAST, sizeof(*locbufs));
|
||||||
return (char *) NULL;
|
if(!locbufs) {
|
||||||
|
pthread_mutex_unlock(&mutex);
|
||||||
|
return (char *) NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Curl_thread_buffer = buffer_unthreaded;
|
Curl_thread_buffer = buffer_unthreaded;
|
||||||
|
}
|
||||||
|
|
||||||
atexit(terminate);
|
atexit(terminate);
|
||||||
}
|
}
|
||||||
|
|
||||||
pthread_mutex_unlock(&mutex);
|
pthread_mutex_unlock(&mutex);
|
||||||
return Curl_thread_buffer(key, size);
|
return Curl_thread_buffer(key, size);
|
||||||
@ -240,11 +232,10 @@ buffer_undef(localkey_t key, long size)
|
|||||||
|
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
set_thread_string(localkey_t key, const char * s)
|
set_thread_string(localkey_t key, const char *s)
|
||||||
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char * cp;
|
char *cp;
|
||||||
|
|
||||||
if(!s)
|
if(!s)
|
||||||
return (char *) NULL;
|
return (char *) NULL;
|
||||||
@ -262,11 +253,10 @@ set_thread_string(localkey_t key, const char * s)
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Curl_getnameinfo_a(const struct sockaddr * sa, curl_socklen_t salen,
|
Curl_getnameinfo_a(const struct sockaddr *sa, curl_socklen_t salen,
|
||||||
char * nodename, curl_socklen_t nodenamelen,
|
char *nodename, curl_socklen_t nodenamelen,
|
||||||
char * servname, curl_socklen_t servnamelen,
|
char *servname, curl_socklen_t servnamelen,
|
||||||
int flags)
|
int flags)
|
||||||
|
|
||||||
{
|
{
|
||||||
char *enodename = NULL;
|
char *enodename = NULL;
|
||||||
char *eservname = NULL;
|
char *eservname = NULL;
|
||||||
@ -293,31 +283,29 @@ Curl_getnameinfo_a(const struct sockaddr * sa, curl_socklen_t salen,
|
|||||||
int i;
|
int i;
|
||||||
if(enodename) {
|
if(enodename) {
|
||||||
i = QadrtConvertE2A(nodename, enodename,
|
i = QadrtConvertE2A(nodename, enodename,
|
||||||
nodenamelen - 1, strlen(enodename));
|
nodenamelen - 1, strlen(enodename));
|
||||||
nodename[i] = '\0';
|
nodename[i] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(eservname) {
|
if(eservname) {
|
||||||
i = QadrtConvertE2A(servname, eservname,
|
i = QadrtConvertE2A(servname, eservname,
|
||||||
servnamelen - 1, strlen(eservname));
|
servnamelen - 1, strlen(eservname));
|
||||||
servname[i] = '\0';
|
servname[i] = '\0';
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
free(enodename);
|
free(enodename);
|
||||||
free(eservname);
|
free(eservname);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Curl_getaddrinfo_a(const char * nodename, const char * servname,
|
Curl_getaddrinfo_a(const char *nodename, const char *servname,
|
||||||
const struct addrinfo * hints,
|
const struct addrinfo *hints,
|
||||||
struct addrinfo * * res)
|
struct addrinfo **res)
|
||||||
|
|
||||||
{
|
{
|
||||||
char * enodename;
|
char *enodename;
|
||||||
char * eservname;
|
char *eservname;
|
||||||
int status;
|
int status;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -354,7 +342,6 @@ Curl_getaddrinfo_a(const char * nodename, const char * servname,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_GSKIT
|
#ifdef USE_GSKIT
|
||||||
|
|
||||||
/* ASCII wrappers for the GSKit procedures. */
|
/* ASCII wrappers for the GSKit procedures. */
|
||||||
@ -370,22 +357,19 @@ Curl_getaddrinfo_a(const char * nodename, const char * servname,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
struct gskstrlist {
|
struct gskstrlist {
|
||||||
struct gskstrlist * next;
|
struct gskstrlist *next;
|
||||||
const char * ebcdicstr;
|
const char *ebcdicstr;
|
||||||
const char * asciistr;
|
const char *asciistr;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Curl_gsk_descriptor {
|
struct Curl_gsk_descriptor {
|
||||||
gsk_handle h;
|
gsk_handle h;
|
||||||
struct gskstrlist * strlist;
|
struct gskstrlist *strlist;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int Curl_gsk_environment_open(gsk_handle *my_env_handle)
|
||||||
int
|
|
||||||
Curl_gsk_environment_open(gsk_handle * my_env_handle)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if(!my_env_handle)
|
if(!my_env_handle)
|
||||||
@ -402,13 +386,10 @@ Curl_gsk_environment_open(gsk_handle * my_env_handle)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Curl_gsk_secure_soc_open(gsk_handle my_env_handle,
|
||||||
int
|
gsk_handle *my_session_handle)
|
||||||
Curl_gsk_secure_soc_open(gsk_handle my_env_handle,
|
|
||||||
gsk_handle * my_session_handle)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
gsk_handle h;
|
gsk_handle h;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
@ -429,12 +410,9 @@ Curl_gsk_secure_soc_open(gsk_handle my_env_handle,
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void gsk_free_handle(struct Curl_gsk_descriptor *p)
|
||||||
static void
|
|
||||||
gsk_free_handle(struct Curl_gsk_descriptor * p)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
struct gskstrlist * q;
|
struct gskstrlist *q;
|
||||||
|
|
||||||
while((q = p->strlist)) {
|
while((q = p->strlist)) {
|
||||||
p->strlist = q;
|
p->strlist = q;
|
||||||
@ -444,12 +422,9 @@ gsk_free_handle(struct Curl_gsk_descriptor * p)
|
|||||||
free(p);
|
free(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Curl_gsk_environment_close(gsk_handle *my_env_handle)
|
||||||
int
|
|
||||||
Curl_gsk_environment_close(gsk_handle * my_env_handle)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if(!my_env_handle)
|
if(!my_env_handle)
|
||||||
@ -466,11 +441,9 @@ Curl_gsk_environment_close(gsk_handle * my_env_handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int Curl_gsk_secure_soc_close(gsk_handle *my_session_handle)
|
||||||
Curl_gsk_secure_soc_close(gsk_handle * my_session_handle)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if(!my_session_handle)
|
if(!my_session_handle)
|
||||||
@ -486,12 +459,9 @@ Curl_gsk_secure_soc_close(gsk_handle * my_session_handle)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Curl_gsk_environment_init(gsk_handle my_env_handle)
|
||||||
int
|
|
||||||
Curl_gsk_environment_init(gsk_handle my_env_handle)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
|
|
||||||
if(!my_env_handle)
|
if(!my_env_handle)
|
||||||
return GSK_INVALID_HANDLE;
|
return GSK_INVALID_HANDLE;
|
||||||
@ -500,11 +470,9 @@ Curl_gsk_environment_init(gsk_handle my_env_handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int Curl_gsk_secure_soc_init(gsk_handle my_session_handle)
|
||||||
Curl_gsk_secure_soc_init(gsk_handle my_session_handle)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
|
|
||||||
if(!my_session_handle)
|
if(!my_session_handle)
|
||||||
return GSK_INVALID_HANDLE;
|
return GSK_INVALID_HANDLE;
|
||||||
@ -515,11 +483,10 @@ Curl_gsk_secure_soc_init(gsk_handle my_session_handle)
|
|||||||
|
|
||||||
int
|
int
|
||||||
Curl_gsk_attribute_set_buffer_a(gsk_handle my_gsk_handle, GSK_BUF_ID bufID,
|
Curl_gsk_attribute_set_buffer_a(gsk_handle my_gsk_handle, GSK_BUF_ID bufID,
|
||||||
const char * buffer, int bufSize)
|
const char *buffer, int bufSize)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
char * ebcdicbuf;
|
char *ebcdicbuf;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if(!my_gsk_handle)
|
if(!my_gsk_handle)
|
||||||
@ -545,9 +512,8 @@ Curl_gsk_attribute_set_buffer_a(gsk_handle my_gsk_handle, GSK_BUF_ID bufID,
|
|||||||
int
|
int
|
||||||
Curl_gsk_attribute_set_enum(gsk_handle my_gsk_handle, GSK_ENUM_ID enumID,
|
Curl_gsk_attribute_set_enum(gsk_handle my_gsk_handle, GSK_ENUM_ID enumID,
|
||||||
GSK_ENUM_VALUE enumValue)
|
GSK_ENUM_VALUE enumValue)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
|
|
||||||
if(!my_gsk_handle)
|
if(!my_gsk_handle)
|
||||||
return GSK_INVALID_HANDLE;
|
return GSK_INVALID_HANDLE;
|
||||||
@ -559,9 +525,8 @@ Curl_gsk_attribute_set_enum(gsk_handle my_gsk_handle, GSK_ENUM_ID enumID,
|
|||||||
int
|
int
|
||||||
Curl_gsk_attribute_set_numeric_value(gsk_handle my_gsk_handle,
|
Curl_gsk_attribute_set_numeric_value(gsk_handle my_gsk_handle,
|
||||||
GSK_NUM_ID numID, int numValue)
|
GSK_NUM_ID numID, int numValue)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
|
|
||||||
if(!my_gsk_handle)
|
if(!my_gsk_handle)
|
||||||
return GSK_INVALID_HANDLE;
|
return GSK_INVALID_HANDLE;
|
||||||
@ -573,10 +538,9 @@ Curl_gsk_attribute_set_numeric_value(gsk_handle my_gsk_handle,
|
|||||||
int
|
int
|
||||||
Curl_gsk_attribute_set_callback(gsk_handle my_gsk_handle,
|
Curl_gsk_attribute_set_callback(gsk_handle my_gsk_handle,
|
||||||
GSK_CALLBACK_ID callBackID,
|
GSK_CALLBACK_ID callBackID,
|
||||||
void * callBackAreaPtr)
|
void *callBackAreaPtr)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
|
|
||||||
if(!my_gsk_handle)
|
if(!my_gsk_handle)
|
||||||
return GSK_INVALID_HANDLE;
|
return GSK_INVALID_HANDLE;
|
||||||
@ -586,13 +550,12 @@ Curl_gsk_attribute_set_callback(gsk_handle my_gsk_handle,
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cachestring(struct Curl_gsk_descriptor * p,
|
cachestring(struct Curl_gsk_descriptor *p,
|
||||||
const char * ebcdicbuf, int bufsize, const char * * buffer)
|
const char *ebcdicbuf, int bufsize, const char **buffer)
|
||||||
|
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
char * asciibuf;
|
char *asciibuf;
|
||||||
struct gskstrlist * sp;
|
struct gskstrlist *sp;
|
||||||
|
|
||||||
for(sp = p->strlist; sp; sp = sp->next)
|
for(sp = p->strlist; sp; sp = sp->next)
|
||||||
if(sp->ebcdicstr == ebcdicbuf)
|
if(sp->ebcdicstr == ebcdicbuf)
|
||||||
@ -620,12 +583,11 @@ cachestring(struct Curl_gsk_descriptor * p,
|
|||||||
|
|
||||||
int
|
int
|
||||||
Curl_gsk_attribute_get_buffer_a(gsk_handle my_gsk_handle, GSK_BUF_ID bufID,
|
Curl_gsk_attribute_get_buffer_a(gsk_handle my_gsk_handle, GSK_BUF_ID bufID,
|
||||||
const char * * buffer, int * bufSize)
|
const char **buffer, int *bufSize)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
int rc;
|
int rc;
|
||||||
const char * mybuf;
|
const char *mybuf;
|
||||||
int mylen;
|
int mylen;
|
||||||
|
|
||||||
if(!my_gsk_handle)
|
if(!my_gsk_handle)
|
||||||
@ -645,10 +607,9 @@ Curl_gsk_attribute_get_buffer_a(gsk_handle my_gsk_handle, GSK_BUF_ID bufID,
|
|||||||
|
|
||||||
int
|
int
|
||||||
Curl_gsk_attribute_get_enum(gsk_handle my_gsk_handle, GSK_ENUM_ID enumID,
|
Curl_gsk_attribute_get_enum(gsk_handle my_gsk_handle, GSK_ENUM_ID enumID,
|
||||||
GSK_ENUM_VALUE * enumValue)
|
GSK_ENUM_VALUE *enumValue)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
|
|
||||||
if(!my_gsk_handle)
|
if(!my_gsk_handle)
|
||||||
return GSK_INVALID_HANDLE;
|
return GSK_INVALID_HANDLE;
|
||||||
@ -659,10 +620,9 @@ Curl_gsk_attribute_get_enum(gsk_handle my_gsk_handle, GSK_ENUM_ID enumID,
|
|||||||
|
|
||||||
int
|
int
|
||||||
Curl_gsk_attribute_get_numeric_value(gsk_handle my_gsk_handle,
|
Curl_gsk_attribute_get_numeric_value(gsk_handle my_gsk_handle,
|
||||||
GSK_NUM_ID numID, int * numValue)
|
GSK_NUM_ID numID, int *numValue)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
|
|
||||||
if(!my_gsk_handle)
|
if(!my_gsk_handle)
|
||||||
return GSK_INVALID_HANDLE;
|
return GSK_INVALID_HANDLE;
|
||||||
@ -674,11 +634,10 @@ Curl_gsk_attribute_get_numeric_value(gsk_handle my_gsk_handle,
|
|||||||
int
|
int
|
||||||
Curl_gsk_attribute_get_cert_info(gsk_handle my_gsk_handle,
|
Curl_gsk_attribute_get_cert_info(gsk_handle my_gsk_handle,
|
||||||
GSK_CERT_ID certID,
|
GSK_CERT_ID certID,
|
||||||
const gsk_cert_data_elem * * certDataElem,
|
const gsk_cert_data_elem **certDataElem,
|
||||||
int * certDataElementCount)
|
int *certDataElementCount)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
|
|
||||||
if(!my_gsk_handle)
|
if(!my_gsk_handle)
|
||||||
return GSK_INVALID_HANDLE;
|
return GSK_INVALID_HANDLE;
|
||||||
@ -691,9 +650,8 @@ Curl_gsk_attribute_get_cert_info(gsk_handle my_gsk_handle,
|
|||||||
|
|
||||||
int
|
int
|
||||||
Curl_gsk_secure_soc_misc(gsk_handle my_session_handle, GSK_MISC_ID miscID)
|
Curl_gsk_secure_soc_misc(gsk_handle my_session_handle, GSK_MISC_ID miscID)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
|
|
||||||
if(!my_session_handle)
|
if(!my_session_handle)
|
||||||
return GSK_INVALID_HANDLE;
|
return GSK_INVALID_HANDLE;
|
||||||
@ -703,11 +661,10 @@ Curl_gsk_secure_soc_misc(gsk_handle my_session_handle, GSK_MISC_ID miscID)
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Curl_gsk_secure_soc_read(gsk_handle my_session_handle, char * readBuffer,
|
Curl_gsk_secure_soc_read(gsk_handle my_session_handle, char *readBuffer,
|
||||||
int readBufSize, int * amtRead)
|
int readBufSize, int *amtRead)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
|
|
||||||
if(!my_session_handle)
|
if(!my_session_handle)
|
||||||
return GSK_INVALID_HANDLE;
|
return GSK_INVALID_HANDLE;
|
||||||
@ -717,11 +674,10 @@ Curl_gsk_secure_soc_read(gsk_handle my_session_handle, char * readBuffer,
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Curl_gsk_secure_soc_write(gsk_handle my_session_handle, char * writeBuffer,
|
Curl_gsk_secure_soc_write(gsk_handle my_session_handle, char *writeBuffer,
|
||||||
int writeBufSize, int * amtWritten)
|
int writeBufSize, int *amtWritten)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
|
|
||||||
if(!my_session_handle)
|
if(!my_session_handle)
|
||||||
return GSK_INVALID_HANDLE;
|
return GSK_INVALID_HANDLE;
|
||||||
@ -732,7 +688,6 @@ Curl_gsk_secure_soc_write(gsk_handle my_session_handle, char * writeBuffer,
|
|||||||
|
|
||||||
const char *
|
const char *
|
||||||
Curl_gsk_strerror_a(int gsk_return_value)
|
Curl_gsk_strerror_a(int gsk_return_value)
|
||||||
|
|
||||||
{
|
{
|
||||||
return set_thread_string(LK_GSK_ERROR, gsk_strerror(gsk_return_value));
|
return set_thread_string(LK_GSK_ERROR, gsk_strerror(gsk_return_value));
|
||||||
}
|
}
|
||||||
@ -740,10 +695,9 @@ Curl_gsk_strerror_a(int gsk_return_value)
|
|||||||
int
|
int
|
||||||
Curl_gsk_secure_soc_startInit(gsk_handle my_session_handle,
|
Curl_gsk_secure_soc_startInit(gsk_handle my_session_handle,
|
||||||
int IOCompletionPort,
|
int IOCompletionPort,
|
||||||
Qso_OverlappedIO_t * communicationsArea)
|
Qso_OverlappedIO_t *communicationsArea)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct Curl_gsk_descriptor * p;
|
struct Curl_gsk_descriptor *p;
|
||||||
|
|
||||||
if(!my_session_handle)
|
if(!my_session_handle)
|
||||||
return GSK_INVALID_HANDLE;
|
return GSK_INVALID_HANDLE;
|
||||||
@ -753,15 +707,12 @@ Curl_gsk_secure_soc_startInit(gsk_handle my_session_handle,
|
|||||||
|
|
||||||
#endif /* USE_GSKIT */
|
#endif /* USE_GSKIT */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_GSSAPI
|
#ifdef HAVE_GSSAPI
|
||||||
|
|
||||||
/* ASCII wrappers for the GSSAPI procedures. */
|
/* ASCII wrappers for the GSSAPI procedures. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
Curl_gss_convert_in_place(OM_uint32 * minor_status, gss_buffer_t buf)
|
Curl_gss_convert_in_place(OM_uint32 *minor_status, gss_buffer_t buf)
|
||||||
|
|
||||||
{
|
{
|
||||||
unsigned int i = buf->length;
|
unsigned int i = buf->length;
|
||||||
|
|
||||||
@ -789,9 +740,8 @@ Curl_gss_convert_in_place(OM_uint32 * minor_status, gss_buffer_t buf)
|
|||||||
|
|
||||||
|
|
||||||
OM_uint32
|
OM_uint32
|
||||||
Curl_gss_import_name_a(OM_uint32 * minor_status, gss_buffer_t in_name,
|
Curl_gss_import_name_a(OM_uint32 *minor_status, gss_buffer_t in_name,
|
||||||
gss_OID in_name_type, gss_name_t * out_name)
|
gss_OID in_name_type, gss_name_t *out_name)
|
||||||
|
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@ -818,17 +768,16 @@ Curl_gss_import_name_a(OM_uint32 * minor_status, gss_buffer_t in_name,
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
OM_uint32
|
OM_uint32
|
||||||
Curl_gss_display_status_a(OM_uint32 * minor_status, OM_uint32 status_value,
|
Curl_gss_display_status_a(OM_uint32 *minor_status, OM_uint32 status_value,
|
||||||
int status_type, gss_OID mech_type,
|
int status_type, gss_OID mech_type,
|
||||||
gss_msg_ctx_t * message_context, gss_buffer_t status_string)
|
gss_msg_ctx_t *message_context,
|
||||||
|
gss_buffer_t status_string)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
rc = gss_display_status(minor_status, status_value, status_type,
|
rc = gss_display_status(minor_status, status_value, status_type,
|
||||||
mech_type, message_context, status_string);
|
mech_type, message_context, status_string);
|
||||||
|
|
||||||
if(rc != GSS_S_COMPLETE || !status_string ||
|
if(rc != GSS_S_COMPLETE || !status_string ||
|
||||||
!status_string->length || !status_string->value)
|
!status_string->length || !status_string->value)
|
||||||
@ -844,19 +793,17 @@ Curl_gss_display_status_a(OM_uint32 * minor_status, OM_uint32 status_value,
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
OM_uint32
|
OM_uint32
|
||||||
Curl_gss_init_sec_context_a(OM_uint32 * minor_status,
|
Curl_gss_init_sec_context_a(OM_uint32 *minor_status,
|
||||||
gss_cred_id_t cred_handle,
|
gss_cred_id_t cred_handle,
|
||||||
gss_ctx_id_t * context_handle,
|
gss_ctx_id_t *context_handle,
|
||||||
gss_name_t target_name, gss_OID mech_type,
|
gss_name_t target_name, gss_OID mech_type,
|
||||||
gss_flags_t req_flags, OM_uint32 time_req,
|
gss_flags_t req_flags, OM_uint32 time_req,
|
||||||
gss_channel_bindings_t input_chan_bindings,
|
gss_channel_bindings_t input_chan_bindings,
|
||||||
gss_buffer_t input_token,
|
gss_buffer_t input_token,
|
||||||
gss_OID * actual_mech_type,
|
gss_OID *actual_mech_type,
|
||||||
gss_buffer_t output_token, gss_flags_t * ret_flags,
|
gss_buffer_t output_token, gss_flags_t *ret_flags,
|
||||||
OM_uint32 * time_rec)
|
OM_uint32 *time_rec)
|
||||||
|
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
gss_buffer_desc in;
|
gss_buffer_desc in;
|
||||||
@ -885,13 +832,13 @@ Curl_gss_init_sec_context_a(OM_uint32 * minor_status,
|
|||||||
}
|
}
|
||||||
|
|
||||||
rc = gss_init_sec_context(minor_status, cred_handle, context_handle,
|
rc = gss_init_sec_context(minor_status, cred_handle, context_handle,
|
||||||
target_name, mech_type, req_flags, time_req,
|
target_name, mech_type, req_flags, time_req,
|
||||||
input_chan_bindings, inp, actual_mech_type,
|
input_chan_bindings, inp, actual_mech_type,
|
||||||
output_token, ret_flags, time_rec);
|
output_token, ret_flags, time_rec);
|
||||||
free(in.value);
|
free(in.value);
|
||||||
|
|
||||||
if(rc != GSS_S_COMPLETE || !output_token ||
|
if(rc != GSS_S_COMPLETE || !output_token ||
|
||||||
!output_token->length || !output_token->value)
|
!output_token->length || !output_token->value)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
/* No way to allocate a buffer here, because it will be released by
|
/* No way to allocate a buffer here, because it will be released by
|
||||||
@ -906,17 +853,16 @@ Curl_gss_init_sec_context_a(OM_uint32 * minor_status,
|
|||||||
|
|
||||||
|
|
||||||
OM_uint32
|
OM_uint32
|
||||||
Curl_gss_delete_sec_context_a(OM_uint32 * minor_status,
|
Curl_gss_delete_sec_context_a(OM_uint32 *minor_status,
|
||||||
gss_ctx_id_t * context_handle,
|
gss_ctx_id_t *context_handle,
|
||||||
gss_buffer_t output_token)
|
gss_buffer_t output_token)
|
||||||
|
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
rc = gss_delete_sec_context(minor_status, context_handle, output_token);
|
rc = gss_delete_sec_context(minor_status, context_handle, output_token);
|
||||||
|
|
||||||
if(rc != GSS_S_COMPLETE || !output_token ||
|
if(rc != GSS_S_COMPLETE || !output_token ||
|
||||||
!output_token->length || !output_token->value)
|
!output_token->length || !output_token->value)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
/* No way to allocate a buffer here, because it will be released by
|
/* No way to allocate a buffer here, because it will be released by
|
||||||
@ -931,18 +877,16 @@ Curl_gss_delete_sec_context_a(OM_uint32 * minor_status,
|
|||||||
|
|
||||||
#endif /* HAVE_GSSAPI */
|
#endif /* HAVE_GSSAPI */
|
||||||
|
|
||||||
|
|
||||||
#ifndef CURL_DISABLE_LDAP
|
#ifndef CURL_DISABLE_LDAP
|
||||||
|
|
||||||
/* ASCII wrappers for the LDAP procedures. */
|
/* ASCII wrappers for the LDAP procedures. */
|
||||||
|
|
||||||
void *
|
void *
|
||||||
Curl_ldap_init_a(char * host, int port)
|
Curl_ldap_init_a(char *host, int port)
|
||||||
|
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
char * ehost;
|
char *ehost;
|
||||||
void * result;
|
void *result;
|
||||||
|
|
||||||
if(!host)
|
if(!host)
|
||||||
return (void *) ldap_init(host, port);
|
return (void *) ldap_init(host, port);
|
||||||
@ -960,14 +904,12 @@ Curl_ldap_init_a(char * host, int port)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Curl_ldap_simple_bind_s_a(void * ld, char * dn, char * passwd)
|
Curl_ldap_simple_bind_s_a(void *ld, char *dn, char *passwd)
|
||||||
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char * edn;
|
char *edn;
|
||||||
char * epasswd;
|
char *epasswd;
|
||||||
|
|
||||||
edn = (char *) NULL;
|
edn = (char *) NULL;
|
||||||
epasswd = (char *) NULL;
|
epasswd = (char *) NULL;
|
||||||
@ -1002,22 +944,20 @@ Curl_ldap_simple_bind_s_a(void * ld, char * dn, char * passwd)
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Curl_ldap_search_s_a(void * ld, char * base, int scope, char * filter,
|
Curl_ldap_search_s_a(void *ld, char *base, int scope, char *filter,
|
||||||
char * * attrs, int attrsonly, LDAPMessage * * res)
|
char **attrs, int attrsonly, LDAPMessage **res)
|
||||||
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
char * ebase;
|
char *ebase;
|
||||||
char * efilter;
|
char *efilter;
|
||||||
char * * eattrs;
|
char **eattrs;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
ebase = (char *) NULL;
|
ebase = (char *) NULL;
|
||||||
efilter = (char *) NULL;
|
efilter = (char *) NULL;
|
||||||
eattrs = (char * *) NULL;
|
eattrs = (char **) NULL;
|
||||||
status = LDAP_SUCCESS;
|
status = LDAP_SUCCESS;
|
||||||
|
|
||||||
if(base) {
|
if(base) {
|
||||||
@ -1063,9 +1003,9 @@ Curl_ldap_search_s_a(void * ld, char * base, int scope, char * filter,
|
|||||||
|
|
||||||
QadrtConvertA2E(eattrs[j], attrs[j], i, i);
|
QadrtConvertA2E(eattrs[j], attrs[j], i, i);
|
||||||
eattrs[j][i] = '\0';
|
eattrs[j][i] = '\0';
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(status == LDAP_SUCCESS)
|
if(status == LDAP_SUCCESS)
|
||||||
status = ldap_search_s(ld, ebase? ebase: "", scope,
|
status = ldap_search_s(ld, ebase? ebase: "", scope,
|
||||||
@ -1077,7 +1017,7 @@ Curl_ldap_search_s_a(void * ld, char * base, int scope, char * filter,
|
|||||||
free(eattrs[j]);
|
free(eattrs[j]);
|
||||||
|
|
||||||
free(eattrs);
|
free(eattrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(efilter);
|
free(efilter);
|
||||||
free(ebase);
|
free(ebase);
|
||||||
@ -1085,12 +1025,11 @@ Curl_ldap_search_s_a(void * ld, char * base, int scope, char * filter,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct berval * *
|
struct berval **
|
||||||
Curl_ldap_get_values_len_a(void * ld, LDAPMessage * entry, const char * attr)
|
Curl_ldap_get_values_len_a(void *ld, LDAPMessage *entry, const char *attr)
|
||||||
|
|
||||||
{
|
{
|
||||||
char * cp;
|
char *cp;
|
||||||
struct berval * * result;
|
struct berval **result;
|
||||||
|
|
||||||
cp = (char *) NULL;
|
cp = (char *) NULL;
|
||||||
|
|
||||||
@ -1101,7 +1040,7 @@ Curl_ldap_get_values_len_a(void * ld, LDAPMessage * entry, const char * attr)
|
|||||||
if(!cp) {
|
if(!cp) {
|
||||||
ldap_set_lderrno(ld, LDAP_NO_MEMORY, NULL,
|
ldap_set_lderrno(ld, LDAP_NO_MEMORY, NULL,
|
||||||
ldap_err2string(LDAP_NO_MEMORY));
|
ldap_err2string(LDAP_NO_MEMORY));
|
||||||
return (struct berval * *) NULL;
|
return (struct berval **) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
QadrtConvertA2E(cp, attr, i, i);
|
QadrtConvertA2E(cp, attr, i, i);
|
||||||
@ -1117,22 +1056,18 @@ Curl_ldap_get_values_len_a(void * ld, LDAPMessage * entry, const char * attr)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
Curl_ldap_err2string_a(int error)
|
Curl_ldap_err2string_a(int error)
|
||||||
|
|
||||||
{
|
{
|
||||||
return set_thread_string(LK_LDAP_ERROR, ldap_err2string(error));
|
return set_thread_string(LK_LDAP_ERROR, ldap_err2string(error));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
Curl_ldap_get_dn_a(void * ld, LDAPMessage * entry)
|
Curl_ldap_get_dn_a(void *ld, LDAPMessage *entry)
|
||||||
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char * cp;
|
char *cp;
|
||||||
char * cp2;
|
char *cp2;
|
||||||
|
|
||||||
cp = ldap_get_dn(ld, entry);
|
cp = ldap_get_dn(ld, entry);
|
||||||
|
|
||||||
@ -1157,15 +1092,13 @@ Curl_ldap_get_dn_a(void * ld, LDAPMessage * entry)
|
|||||||
return cp;
|
return cp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
Curl_ldap_first_attribute_a(void * ld,
|
Curl_ldap_first_attribute_a(void *ld,
|
||||||
LDAPMessage * entry, BerElement * * berptr)
|
LDAPMessage *entry, BerElement **berptr)
|
||||||
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char * cp;
|
char *cp;
|
||||||
char * cp2;
|
char *cp2;
|
||||||
|
|
||||||
cp = ldap_first_attribute(ld, entry, berptr);
|
cp = ldap_first_attribute(ld, entry, berptr);
|
||||||
|
|
||||||
@ -1190,15 +1123,13 @@ Curl_ldap_first_attribute_a(void * ld,
|
|||||||
return cp;
|
return cp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
Curl_ldap_next_attribute_a(void * ld,
|
Curl_ldap_next_attribute_a(void *ld,
|
||||||
LDAPMessage * entry, BerElement * berptr)
|
LDAPMessage *entry, BerElement *berptr)
|
||||||
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char * cp;
|
char *cp;
|
||||||
char * cp2;
|
char *cp2;
|
||||||
|
|
||||||
cp = ldap_next_attribute(ld, entry, berptr);
|
cp = ldap_next_attribute(ld, entry, berptr);
|
||||||
|
|
||||||
@ -1225,7 +1156,6 @@ Curl_ldap_next_attribute_a(void * ld,
|
|||||||
|
|
||||||
#endif /* CURL_DISABLE_LDAP */
|
#endif /* CURL_DISABLE_LDAP */
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
sockaddr2ebcdic(struct sockaddr_storage *dstaddr,
|
sockaddr2ebcdic(struct sockaddr_storage *dstaddr,
|
||||||
const struct sockaddr *srcaddr, int srclen)
|
const struct sockaddr *srcaddr, int srclen)
|
||||||
@ -1241,11 +1171,11 @@ sockaddr2ebcdic(struct sockaddr_storage *dstaddr,
|
|||||||
sizeof(srcaddr->sa_family) || srclen > sizeof(*dstaddr)) {
|
sizeof(srcaddr->sa_family) || srclen > sizeof(*dstaddr)) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy((char *) dstaddr, (char *) srcaddr, srclen);
|
memcpy((char *) dstaddr, (char *) srcaddr, srclen);
|
||||||
|
|
||||||
switch (srcaddr->sa_family) {
|
switch(srcaddr->sa_family) {
|
||||||
|
|
||||||
case AF_UNIX:
|
case AF_UNIX:
|
||||||
srcu = (const struct sockaddr_un *) srcaddr;
|
srcu = (const struct sockaddr_un *) srcaddr;
|
||||||
@ -1255,7 +1185,7 @@ sockaddr2ebcdic(struct sockaddr_storage *dstaddr,
|
|||||||
i = QadrtConvertA2E(dstu->sun_path, srcu->sun_path, dstsize - 1, srclen);
|
i = QadrtConvertA2E(dstu->sun_path, srcu->sun_path, dstsize - 1, srclen);
|
||||||
dstu->sun_path[i] = '\0';
|
dstu->sun_path[i] = '\0';
|
||||||
srclen = i + offsetof(struct sockaddr_un, sun_path);
|
srclen = i + offsetof(struct sockaddr_un, sun_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
return srclen;
|
return srclen;
|
||||||
}
|
}
|
||||||
@ -1278,13 +1208,13 @@ sockaddr2ascii(struct sockaddr *dstaddr, int dstlen,
|
|||||||
if(!srcaddr || srclen < 0) {
|
if(!srcaddr || srclen < 0) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy((char *) dstaddr, (char *) srcaddr, srclen);
|
memcpy((char *) dstaddr, (char *) srcaddr, srclen);
|
||||||
|
|
||||||
if(srclen >= offsetof(struct sockaddr_storage, ss_family) +
|
if(srclen >= offsetof(struct sockaddr_storage, ss_family) +
|
||||||
sizeof(srcaddr->ss_family)) {
|
sizeof(srcaddr->ss_family)) {
|
||||||
switch (srcaddr->ss_family) {
|
switch(srcaddr->ss_family) {
|
||||||
|
|
||||||
case AF_UNIX:
|
case AF_UNIX:
|
||||||
srcu = (const struct sockaddr_un *) srcaddr;
|
srcu = (const struct sockaddr_un *) srcaddr;
|
||||||
@ -1303,9 +1233,8 @@ sockaddr2ascii(struct sockaddr *dstaddr, int dstlen,
|
|||||||
return srclen;
|
return srclen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Curl_os400_connect(int sd, struct sockaddr * destaddr, int addrlen)
|
Curl_os400_connect(int sd, struct sockaddr *destaddr, int addrlen)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct sockaddr_storage laddr;
|
struct sockaddr_storage laddr;
|
||||||
@ -1318,9 +1247,8 @@ Curl_os400_connect(int sd, struct sockaddr * destaddr, int addrlen)
|
|||||||
return connect(sd, (struct sockaddr *) &laddr, i);
|
return connect(sd, (struct sockaddr *) &laddr, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Curl_os400_bind(int sd, struct sockaddr * localaddr, int addrlen)
|
Curl_os400_bind(int sd, struct sockaddr *localaddr, int addrlen)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct sockaddr_storage laddr;
|
struct sockaddr_storage laddr;
|
||||||
@ -1333,10 +1261,9 @@ Curl_os400_bind(int sd, struct sockaddr * localaddr, int addrlen)
|
|||||||
return bind(sd, (struct sockaddr *) &laddr, i);
|
return bind(sd, (struct sockaddr *) &laddr, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Curl_os400_sendto(int sd, char * buffer, int buflen, int flags,
|
Curl_os400_sendto(int sd, char *buffer, int buflen, int flags,
|
||||||
struct sockaddr * dstaddr, int addrlen)
|
struct sockaddr *dstaddr, int addrlen)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct sockaddr_storage laddr;
|
struct sockaddr_storage laddr;
|
||||||
@ -1349,10 +1276,9 @@ Curl_os400_sendto(int sd, char * buffer, int buflen, int flags,
|
|||||||
return sendto(sd, buffer, buflen, flags, (struct sockaddr *) &laddr, i);
|
return sendto(sd, buffer, buflen, flags, (struct sockaddr *) &laddr, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Curl_os400_recvfrom(int sd, char * buffer, int buflen, int flags,
|
Curl_os400_recvfrom(int sd, char *buffer, int buflen, int flags,
|
||||||
struct sockaddr * fromaddr, int * addrlen)
|
struct sockaddr *fromaddr, int *addrlen)
|
||||||
{
|
{
|
||||||
int rcvlen;
|
int rcvlen;
|
||||||
struct sockaddr_storage laddr;
|
struct sockaddr_storage laddr;
|
||||||
@ -1379,7 +1305,6 @@ Curl_os400_recvfrom(int sd, char * buffer, int buflen, int flags,
|
|||||||
return rcvlen;
|
return rcvlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Curl_os400_getpeername(int sd, struct sockaddr *addr, int *addrlen)
|
Curl_os400_getpeername(int sd, struct sockaddr *addr, int *addrlen)
|
||||||
{
|
{
|
||||||
@ -1397,7 +1322,6 @@ Curl_os400_getpeername(int sd, struct sockaddr *addr, int *addrlen)
|
|||||||
return retcode;
|
return retcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Curl_os400_getsockname(int sd, struct sockaddr *addr, int *addrlen)
|
Curl_os400_getsockname(int sd, struct sockaddr *addr, int *addrlen)
|
||||||
{
|
{
|
||||||
@ -1419,17 +1343,15 @@ Curl_os400_getsockname(int sd, struct sockaddr *addr, int *addrlen)
|
|||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_LIBZ
|
||||||
const char *
|
const char *
|
||||||
Curl_os400_zlibVersion(void)
|
Curl_os400_zlibVersion(void)
|
||||||
|
|
||||||
{
|
{
|
||||||
return set_thread_string(LK_ZLIB_VERSION, zlibVersion());
|
return set_thread_string(LK_ZLIB_VERSION, zlibVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Curl_os400_inflateInit_(z_streamp strm, const char * version, int stream_size)
|
Curl_os400_inflateInit_(z_streamp strm, const char *version, int stream_size)
|
||||||
|
|
||||||
{
|
{
|
||||||
z_const char * msgb4 = strm->msg;
|
z_const char *msgb4 = strm->msg;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = inflateInit(strm);
|
ret = inflateInit(strm);
|
||||||
@ -1440,13 +1362,11 @@ Curl_os400_inflateInit_(z_streamp strm, const char * version, int stream_size)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Curl_os400_inflateInit2_(z_streamp strm, int windowBits,
|
Curl_os400_inflateInit2_(z_streamp strm, int windowBits,
|
||||||
const char * version, int stream_size)
|
const char *version, int stream_size)
|
||||||
|
|
||||||
{
|
{
|
||||||
z_const char * msgb4 = strm->msg;
|
z_const char *msgb4 = strm->msg;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = inflateInit2(strm, windowBits);
|
ret = inflateInit2(strm, windowBits);
|
||||||
@ -1457,12 +1377,10 @@ Curl_os400_inflateInit2_(z_streamp strm, int windowBits,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Curl_os400_inflate(z_streamp strm, int flush)
|
Curl_os400_inflate(z_streamp strm, int flush)
|
||||||
|
|
||||||
{
|
{
|
||||||
z_const char * msgb4 = strm->msg;
|
z_const char *msgb4 = strm->msg;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = inflate(strm, flush);
|
ret = inflate(strm, flush);
|
||||||
@ -1473,12 +1391,10 @@ Curl_os400_inflate(z_streamp strm, int flush)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Curl_os400_inflateEnd(z_streamp strm)
|
Curl_os400_inflateEnd(z_streamp strm)
|
||||||
|
|
||||||
{
|
{
|
||||||
z_const char * msgb4 = strm->msg;
|
z_const char *msgb4 = strm->msg;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = inflateEnd(strm);
|
ret = inflateEnd(strm);
|
||||||
|
Loading…
Reference in New Issue
Block a user