diff --git a/CHANGES b/CHANGES index ed3fe586e..b88683ef6 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,11 @@ Changelog +Dan F (23 July 2007) +- Implemented only the parts of Patrick Monnerat's OS/400 patch that renamed + some few internal identifiers to avoid conflicts, which could be useful on + other platforms. + Daniel S (22 July 2007) - HTTP Digest bug fix by Chris Flerackers: diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 80c61785d..48b4365b5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -48,6 +48,6 @@ advice from friends like these: Dan Fandrich, Song Ma, Daniel Black, Giancarlo Formicuccia, Shmulik Regev, Daniel Cater, Colin Hogben, Jofell Gallardo, Daniel Johnson, - Ralf S. Engelschall, James Housley, Chris Flerackers + Ralf S. Engelschall, James Housley, Chris Flerackers, Patrick Monnerat Thanks! (and sorry if I forgot to mention someone) diff --git a/lib/easy.c b/lib/easy.c index 2122f9b28..b1080a22d 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -696,10 +696,10 @@ void curl_easy_reset(CURL *curl) data->set.err = stderr; /* default stderr to stderr */ /* use fwrite as default function to store output */ - data->set.fwrite = (curl_write_callback)fwrite; + data->set.fwrite_func = (curl_write_callback)fwrite; /* use fread as default function to read input */ - data->set.fread = (curl_read_callback)fread; + data->set.fread_func = (curl_read_callback)fread; data->set.infilesize = -1; /* we don't know any size */ data->set.postfieldsize = -1; diff --git a/lib/file.c b/lib/file.c index 4cab1f1b9..8562cc21b 100644 --- a/lib/file.c +++ b/lib/file.c @@ -205,7 +205,7 @@ static CURLcode file_upload(struct connectdata *conn) * Since FILE: doesn't do the full init, we need to provide some extra * assignments here. */ - conn->fread = data->set.fread; + conn->fread_func = data->set.fread_func; conn->fread_in = data->set.in; conn->data->reqdata.upload_fromhere = buf; diff --git a/lib/ftp.c b/lib/ftp.c index 69e76a624..21d29b446 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -1477,7 +1477,7 @@ static CURLcode ftp_state_ul_setup(struct connectdata *conn, readthisamountnow = BUFSIZE; actuallyread = (curl_off_t) - conn->fread(data->state.buffer, 1, (size_t)readthisamountnow, + conn->fread_func(data->state.buffer, 1, (size_t)readthisamountnow, conn->fread_in); passed += actuallyread; diff --git a/lib/http.c b/lib/http.c index a9b483dbd..217ccf234 100644 --- a/lib/http.c +++ b/lib/http.c @@ -790,7 +790,7 @@ static size_t readmoredata(char *buffer, /* move backup data into focus and continue on that */ http->postdata = http->backup.postdata; http->postsize = http->backup.postsize; - conn->fread = http->backup.fread; + conn->fread_func = http->backup.fread_func; conn->fread_in = http->backup.fread_in; http->sending++; /* move one step up */ @@ -940,13 +940,13 @@ CURLcode add_buffer_send(send_buffer *in, ptr = in->buffer + amount; /* backup the currently set pointers */ - http->backup.fread = conn->fread; + http->backup.fread_func = conn->fread_func; http->backup.fread_in = conn->fread_in; http->backup.postdata = http->postdata; http->backup.postsize = http->postsize; /* set the new pointers for the request-sending */ - conn->fread = (curl_read_callback)readmoredata; + conn->fread_func = (curl_read_callback)readmoredata; conn->fread_in = (void *)conn; http->postdata = ptr; http->postsize = (curl_off_t)size; @@ -1606,7 +1606,7 @@ CURLcode Curl_http_done(struct connectdata *conn, (void)premature; /* not used */ /* set the proper values (possibly modified on POST) */ - conn->fread = data->set.fread; /* restore */ + conn->fread_func = data->set.fread_func; /* restore */ conn->fread_in = data->set.in; /* restore */ if (http == NULL) @@ -1991,7 +1991,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done) readthisamountnow = BUFSIZE; actuallyread = - data->set.fread(data->state.buffer, 1, (size_t)readthisamountnow, + data->set.fread_func(data->state.buffer, 1, (size_t)readthisamountnow, data->set.in); passed += actuallyread; @@ -2246,7 +2246,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done) } /* set the read function to read from the generated form data */ - conn->fread = (curl_read_callback)Curl_FormReader; + conn->fread_func = (curl_read_callback)Curl_FormReader; conn->fread_in = &http->form; http->sending = HTTPSEND_BODY; @@ -2446,7 +2446,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done) http->sending = HTTPSEND_BODY; - conn->fread = (curl_read_callback)readmoredata; + conn->fread_func = (curl_read_callback)readmoredata; conn->fread_in = (void *)conn; /* set the upload size to the progress meter */ diff --git a/lib/sendf.c b/lib/sendf.c index 7a6fd5401..9774ca0e5 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -416,7 +416,7 @@ CURLcode Curl_client_write(struct connectdata *conn, /* If the previous block of data ended with CR and this block of data is just a NL, then the length might be zero */ if (len) { - wrote = data->set.fwrite(ptr, 1, len, data->set.out); + wrote = data->set.fwrite_func(ptr, 1, len, data->set.out); } else { wrote = len; @@ -435,7 +435,7 @@ CURLcode Curl_client_write(struct connectdata *conn, * header callback function (added after version 7.7.1). */ curl_write_callback writeit= - data->set.fwrite_header?data->set.fwrite_header:data->set.fwrite; + data->set.fwrite_header?data->set.fwrite_header:data->set.fwrite_func; /* Note: The header is in the host encoding regardless of the ftp transfer mode (ASCII/Image) */ diff --git a/lib/transfer.c b/lib/transfer.c index 655369473..8cf10f20e 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -127,7 +127,7 @@ CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp) /* this function returns a size_t, so we typecast to int to prevent warnings with picky compilers */ - nread = (int)conn->fread(data->reqdata.upload_fromhere, 1, + nread = (int)conn->fread_func(data->reqdata.upload_fromhere, 1, buffersize, conn->fread_in); if(nread == CURL_READFUNC_ABORT) { @@ -237,10 +237,10 @@ CURLcode Curl_readrewind(struct connectdata *conn) (data->set.httpreq == HTTPREQ_POST_FORM)) ; /* do nothing */ else { - if(data->set.ioctl) { + if(data->set.ioctl_func) { curlioerr err; - err = (data->set.ioctl) (data, CURLIOCMD_RESTARTREAD, + err = (data->set.ioctl_func) (data, CURLIOCMD_RESTARTREAD, data->set.ioctl_client); infof(data, "the ioctl callback returned %d\n", (int)err); @@ -254,7 +254,7 @@ CURLcode Curl_readrewind(struct connectdata *conn) /* If no CURLOPT_READFUNCTION is used, we know that we operate on a given FILE * stream and we can actually attempt to rewind that ourself with fseek() */ - if(data->set.fread == (curl_read_callback)fread) { + if(data->set.fread_func == (curl_read_callback)fread) { if(-1 != fseek(data->set.in, 0, SEEK_SET)) /* successful rewind */ return CURLE_OK; diff --git a/lib/url.c b/lib/url.c index 127c5df9e..de4c59db6 100644 --- a/lib/url.c +++ b/lib/url.c @@ -546,10 +546,10 @@ CURLcode Curl_open(struct SessionHandle **curl) data->set.err = stderr; /* default stderr to stderr */ /* use fwrite as default function to store output */ - data->set.fwrite = (curl_write_callback)fwrite; + data->set.fwrite_func = (curl_write_callback)fwrite; /* use fread as default function to read input */ - data->set.fread = (curl_read_callback)fread; + data->set.fread_func = (curl_read_callback)fread; /* conversion callbacks for non-ASCII hosts */ data->set.convfromnetwork = (curl_conv_callback)ZERO_NULL; @@ -1380,19 +1380,19 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, /* * Set data write callback */ - data->set.fwrite = va_arg(param, curl_write_callback); - if(!data->set.fwrite) + data->set.fwrite_func = va_arg(param, curl_write_callback); + if(!data->set.fwrite_func) /* When set to NULL, reset to our internal default function */ - data->set.fwrite = (curl_write_callback)fwrite; + data->set.fwrite_func = (curl_write_callback)fwrite; break; case CURLOPT_READFUNCTION: /* * Read data callback */ - data->set.fread = va_arg(param, curl_read_callback); - if(!data->set.fread) + data->set.fread_func = va_arg(param, curl_read_callback); + if(!data->set.fread_func) /* When set to NULL, reset to our internal default function */ - data->set.fread = (curl_read_callback)fread; + data->set.fread_func = (curl_read_callback)fread; break; case CURLOPT_CONV_FROM_NETWORK_FUNCTION: /* @@ -1416,7 +1416,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, /* * I/O control callback. Might be NULL. */ - data->set.ioctl = va_arg(param, curl_ioctl_callback); + data->set.ioctl_func = va_arg(param, curl_ioctl_callback); break; case CURLOPT_IOCTLDATA: /* @@ -3865,7 +3865,7 @@ static CURLcode CreateConnection(struct SessionHandle *data, * * Inherit the proper values from the urldata struct AFTER we have arranged * the persistent connection stuff */ - conn->fread = data->set.fread; + conn->fread_func = data->set.fread_func; conn->fread_in = data->set.in; if ((conn->protocol&PROT_HTTP) && diff --git a/lib/urldata.h b/lib/urldata.h index 0d0d5713c..683c656d2 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -288,7 +288,7 @@ struct HTTP { struct Curl_chunker chunk; struct back { - curl_read_callback fread; /* backup storage for fread pointer */ + curl_read_callback fread_func; /* backup storage for fread pointer */ void *fread_in; /* backup storage for fread_in pointer */ char *postdata; curl_off_t postsize; @@ -965,7 +965,7 @@ struct connectdata { /*************** Request - specific items ************/ /* previously this was in the urldata struct */ - curl_read_callback fread; /* function that reads the input */ + curl_read_callback fread_func; /* function that reads the input */ void *fread_in; /* pointer to pass to the fread() above */ struct ntlmdata ntlm; /* NTLM differs from other authentication schemes @@ -1268,12 +1268,12 @@ struct UserDefined { unsigned short localport; /* local port number to bind to */ int localportrange; /* number of additional port numbers to test in case the 'localport' one can't be bind()ed */ - curl_write_callback fwrite; /* function that stores the output */ + curl_write_callback fwrite_func; /* function that stores the output */ curl_write_callback fwrite_header; /* function that stores headers */ - curl_read_callback fread; /* function that reads the input */ + curl_read_callback fread_func; /* function that reads the input */ curl_progress_callback fprogress; /* function for progress information */ curl_debug_callback fdebug; /* function that write informational data */ - curl_ioctl_callback ioctl; /* function for I/O control */ + curl_ioctl_callback ioctl_func; /* function for I/O control */ curl_sockopt_callback fsockopt; /* function for setting socket options */ void *sockopt_client; /* pointer to pass to the socket options callback */ diff --git a/tests/libtest/lib506.c b/tests/libtest/lib506.c index 3a3f9e6b9..0a2a0d163 100644 --- a/tests/libtest/lib506.c +++ b/tests/libtest/lib506.c @@ -19,13 +19,6 @@ const char *HOSTHEADER = "Host: www.host.foo.com"; const char *JAR = "log/jar506"; #define THREADS 2 -void lock(CURL *handle, curl_lock_data data, curl_lock_access access, - void *useptr ); -void unlock(CURL *handle, curl_lock_data data, void *useptr ); -struct curl_slist *sethost(struct curl_slist *headers); -void *fire(void *ptr); -char *suburl(const char *base, int i); - /* struct containing data of a thread */ struct Tdata { CURLSH *share; @@ -38,7 +31,7 @@ struct userdata { }; /* lock callback */ -void lock(CURL *handle, curl_lock_data data, curl_lock_access access, +static void my_lock(CURL *handle, curl_lock_data data, curl_lock_access access, void *useptr ) { const char *what; @@ -66,7 +59,7 @@ void lock(CURL *handle, curl_lock_data data, curl_lock_access access, } /* unlock callback */ -void unlock(CURL *handle, curl_lock_data data, void *useptr ) +static void my_unlock(CURL *handle, curl_lock_data data, void *useptr ) { const char *what; struct userdata *user = (struct userdata *)useptr; @@ -91,7 +84,7 @@ void unlock(CURL *handle, curl_lock_data data, void *useptr ) /* build host entry */ -struct curl_slist *sethost(struct curl_slist *headers) +static struct curl_slist *sethost(struct curl_slist *headers) { (void)headers; return curl_slist_append(NULL, HOSTHEADER ); @@ -99,7 +92,7 @@ struct curl_slist *sethost(struct curl_slist *headers) /* the dummy thread function */ -void *fire(void *ptr) +static void *fire(void *ptr) { CURLcode code; struct curl_slist *headers; @@ -135,7 +128,7 @@ void *fire(void *ptr) /* build request url */ -char *suburl(const char *base, int i) +static char *suburl(const char *base, int i) { return curl_maprintf("%s000%c", base, 48+i); } @@ -173,11 +166,11 @@ int test(char *URL) if ( CURLSHE_OK == scode ) { printf( "CURLSHOPT_LOCKFUNC\n" ); - scode = curl_share_setopt( share, CURLSHOPT_LOCKFUNC, lock); + scode = curl_share_setopt( share, CURLSHOPT_LOCKFUNC, my_lock); } if ( CURLSHE_OK == scode ) { printf( "CURLSHOPT_UNLOCKFUNC\n" ); - scode = curl_share_setopt( share, CURLSHOPT_UNLOCKFUNC, unlock); + scode = curl_share_setopt( share, CURLSHOPT_UNLOCKFUNC, my_unlock); } if ( CURLSHE_OK == scode ) { printf( "CURLSHOPT_USERDATA\n" );