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:
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)
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;
* 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;
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;
/* 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 */
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;
(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)
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;
}
/* 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;
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 */
/* 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;
* 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) */
/* 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) {
(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);
/* 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;
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;
/*
* 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:
/*
/*
* 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:
/*
*
* 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) &&
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;
/*************** 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
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 */
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;
};
/* 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;
}
/* 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;
/* 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 );
/* the dummy thread function */
-void *fire(void *ptr)
+static void *fire(void *ptr)
{
CURLcode code;
struct curl_slist *headers;
/* 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);
}
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" );