summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/formdata.c
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2007-03-15 19:22:15 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2007-03-15 19:22:15 (GMT)
commit9314bb49e09b323f1c889d95448ca5dd0a42cc61 (patch)
tree72c7e4477ba67281ddc446e8cccad11e1b46e408 /Utilities/cmcurl/formdata.c
parentf52d37c26f5fd48cc745b85c3233848d7b664368 (diff)
downloadCMake-9314bb49e09b323f1c889d95448ca5dd0a42cc61.zip
CMake-9314bb49e09b323f1c889d95448ca5dd0a42cc61.tar.gz
CMake-9314bb49e09b323f1c889d95448ca5dd0a42cc61.tar.bz2
ENH: Update Curl to 7.16.1
Diffstat (limited to 'Utilities/cmcurl/formdata.c')
-rw-r--r--Utilities/cmcurl/formdata.c336
1 files changed, 273 insertions, 63 deletions
diff --git a/Utilities/cmcurl/formdata.c b/Utilities/cmcurl/formdata.c
index 0e66e60..f10c6c7 100644
--- a/Utilities/cmcurl/formdata.c
+++ b/Utilities/cmcurl/formdata.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -24,7 +24,7 @@
/*
Debug the form generator stand-alone by compiling this source file with:
- gcc -DHAVE_CONFIG_H -I../ -g -D_FORM_DEBUG -o formdata -I../include formdata.c strequal.c
+ gcc -DHAVE_CONFIG_H -I../ -g -D_FORM_DEBUG -DCURLDEBUG -o formdata -I../include formdata.c strequal.c memdebug.c mprintf.c strerror.c
run the 'formdata' executable the output should end with:
All Tests seem to have worked ...
@@ -63,7 +63,7 @@ Content-Type: multipart/mixed, boundary=curlz1s0dkticx49MV1KGcYP5cvfSsz
Content-Disposition: attachment; filename="inet_ntoa_r.h"
Content-Type: text/plain
...
-Content-Disposition: attachment; filename="Makefile.b32.resp"
+Content-Disposition: attachment; filename="Makefile.b32"
Content-Type: text/plain
...
@@ -73,7 +73,7 @@ Content-Type: multipart/mixed, boundary=curlirkYPmPwu6FrJ1vJ1u1BmtIufh1
Content-Disposition: attachment; filename="inet_ntoa_r.h"
Content-Type: text/plain
...
-Content-Disposition: attachment; filename="Makefile.b32.resp"
+Content-Disposition: attachment; filename="Makefile.b32"
Content-Type: text/plain
...
Content-Disposition: attachment; filename="inet_ntoa_r.h"
@@ -87,7 +87,7 @@ Content-Type: multipart/mixed, boundary=curlirkYPmPwu6FrJ1vJ1u1BmtIufh1
Content-Disposition: attachment; filename="inet_ntoa_r.h"
Content-Type: text/plain
...
-Content-Disposition: attachment; filename="Makefile.b32.resp"
+Content-Disposition: attachment; filename="Makefile.b32"
Content-Type: text/plain
...
Content-Disposition: attachment; filename="inet_ntoa_r.h"
@@ -105,17 +105,24 @@ Content-Disposition: form-data; name="FILECONTENT"
/* Length of the random boundary string. */
#define BOUNDARY_LENGTH 40
-#ifndef CURL_DISABLE_HTTP
+#if !defined(CURL_DISABLE_HTTP) || defined(USE_SSLEAY)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <time.h>
+#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
+#endif
+#if defined(HAVE_LIBGEN_H) && defined(HAVE_BASENAME)
+#include <libgen.h>
+#endif
+#include "urldata.h" /* for struct SessionHandle */
+#include "easyif.h" /* for Curl_convert_... prototypes */
#include "formdata.h"
#include "strequal.h"
-#include "curl_memory.h"
+#include "memory.h"
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
@@ -123,6 +130,17 @@ Content-Disposition: form-data; name="FILECONTENT"
/* The last #include file should be: */
#include "memdebug.h"
+#endif /* !defined(CURL_DISABLE_HTTP) || defined(USE_SSLEAY) */
+
+#ifndef CURL_DISABLE_HTTP
+
+#if defined(HAVE_BASENAME) && defined(NEED_BASENAME_PROTO)
+/* This system has a basename() but no prototype for it! */
+char *basename(char *path);
+#endif
+
+static size_t readfromfile(struct Form *form, char *buffer, size_t size);
+
/* What kind of Content-Type to use on un-specified files with unrecognized
extensions. */
#define HTTPPOST_CONTENTTYPE_DEFAULT "application/octet-stream"
@@ -241,7 +259,7 @@ static FormInfo * AddFormInfo(char *value,
static const char * ContentTypeForFilename (const char *filename,
const char *prevtype)
{
- const char *contenttype;
+ const char *contenttype = NULL;
unsigned int i;
/*
* No type was specified, we scan through a few well-known
@@ -251,7 +269,7 @@ static const char * ContentTypeForFilename (const char *filename,
const char *extension;
const char *type;
};
- static struct ContentType ctts[]={
+ static const struct ContentType ctts[]={
{".gif", "image/gif"},
{".jpg", "image/jpeg"},
{".jpeg", "image/jpeg"},
@@ -374,7 +392,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
FormInfo *first_form, *current_form, *form = NULL;
CURLFORMcode return_value = CURL_FORMADD_OK;
const char *prevtype = NULL;
- struct curl_httppost *post;
+ struct curl_httppost *post = NULL;
CURLformoption option;
struct curl_forms *forms = NULL;
char *array_value=NULL; /* value read from an array */
@@ -436,7 +454,12 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
* Set the Name property.
*/
case CURLFORM_PTRNAME:
+#ifdef CURL_DOES_CONVERSIONS
+ /* treat CURLFORM_PTR like CURLFORM_COPYNAME so we'll
+ have safe memory for the eventual conversion */
+#else
current_form->flags |= HTTPPOST_PTRNAME; /* fall through */
+#endif
case CURLFORM_COPYNAME:
if (current_form->name)
return_value = CURL_FORMADD_OPTION_TWICE;
@@ -454,7 +477,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
return_value = CURL_FORMADD_OPTION_TWICE;
else
current_form->namelength =
- array_state?(long)array_value:va_arg(params, long);
+ array_state?(long)array_value:(long)va_arg(params, long);
break;
/*
@@ -512,8 +535,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
if (current_form->value) {
if (current_form->flags & HTTPPOST_FILENAME) {
if (filename) {
- if (!(current_form = AddFormInfo(strdup(filename),
- NULL, current_form)))
+ if ((current_form = AddFormInfo(strdup(filename),
+ NULL, current_form)) == NULL)
return_value = CURL_FORMADD_MEMORY;
}
else
@@ -546,8 +569,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
if (current_form->value) {
if (current_form->flags & HTTPPOST_BUFFER) {
if (filename) {
- if (!(current_form = AddFormInfo(strdup(filename),
- NULL, current_form)))
+ if ((current_form = AddFormInfo(strdup(filename),
+ NULL, current_form)) == NULL)
return_value = CURL_FORMADD_MEMORY;
}
else
@@ -598,9 +621,9 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
if (current_form->contenttype) {
if (current_form->flags & HTTPPOST_FILENAME) {
if (contenttype) {
- if (!(current_form = AddFormInfo(NULL,
- strdup(contenttype),
- current_form)))
+ if ((current_form = AddFormInfo(NULL,
+ strdup(contenttype),
+ current_form)) == NULL)
return_value = CURL_FORMADD_MEMORY;
}
else
@@ -626,15 +649,9 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
{
/* this "cast increases required alignment of target type" but
we consider it OK anyway */
- struct curl_slist* list = 0;
- if ( array_state )
- {
- memcpy(&list, &array_value, sizeof(struct curl_slist*));
- }
- else
- {
- list = va_arg(params, struct curl_slist*);
- }
+ struct curl_slist* list = array_state?
+ (struct curl_slist*)array_value:
+ va_arg(params, struct curl_slist*);
if( current_form->contentheader )
return_value = CURL_FORMADD_OPTION_TWICE;
@@ -825,13 +842,13 @@ static CURLcode AddFormData(struct FormData **formp,
*formp = newform;
if (size) {
- if(type == FORM_DATA)
+ if((type == FORM_DATA) || (type == FORM_CONTENT))
*size += length;
else {
/* Since this is a file to be uploaded here, add the size of the actual
file */
if(!strequal("-", newform->line)) {
- struct stat file;
+ struct_stat file;
if(!stat(newform->line, &file)) {
*size += file.st_size;
}
@@ -862,10 +879,11 @@ static CURLcode AddFormDataf(struct FormData **formp,
* Curl_formclean() is used from http.c, this cleans a built FormData linked
* list
*/
-void Curl_formclean(struct FormData *form)
+void Curl_formclean(struct FormData **form_ptr)
{
- struct FormData *next;
+ struct FormData *next, *form;
+ form = *form_ptr;
if(!form)
return;
@@ -874,7 +892,84 @@ void Curl_formclean(struct FormData *form)
free(form->line); /* free the line */
free(form); /* free the struct */
- } while((form=next)); /* continue */
+ } while ((form = next) != NULL); /* continue */
+
+ *form_ptr = NULL;
+}
+
+#ifdef CURL_DOES_CONVERSIONS
+/*
+ * Curl_formcovert() is used from http.c, this converts any
+ form items that need to be sent in the network encoding.
+ Returns CURLE_OK on success.
+ */
+CURLcode Curl_formconvert(struct SessionHandle *data, struct FormData *form)
+{
+ struct FormData *next;
+ CURLcode rc;
+
+ if(!form)
+ return CURLE_OK;
+
+ if(!data)
+ return CURLE_BAD_FUNCTION_ARGUMENT;
+
+ do {
+ next=form->next; /* the following form line */
+ if (form->type == FORM_DATA) {
+ rc = Curl_convert_to_network(data, form->line, form->length);
+ /* Curl_convert_to_network calls failf if unsuccessful */
+ if (rc != CURLE_OK)
+ return rc;
+ }
+ } while ((form = next) != NULL); /* continue */
+ return CURLE_OK;
+}
+#endif /* CURL_DOES_CONVERSIONS */
+
+/*
+ * curl_formget()
+ * Serialize a curl_httppost struct.
+ * Returns 0 on success.
+ */
+int curl_formget(struct curl_httppost *form, void *arg,
+ curl_formget_callback append)
+{
+ CURLcode rc;
+ curl_off_t size;
+ struct FormData *data, *ptr;
+
+ rc = Curl_getFormData(&data, form, NULL, &size);
+ if (rc != CURLE_OK)
+ return (int)rc;
+
+ for (ptr = data; ptr; ptr = ptr->next) {
+ if (ptr->type == FORM_FILE) {
+ char buffer[8192];
+ size_t read;
+ struct Form temp;
+
+ Curl_FormInit(&temp, ptr);
+
+ do {
+ read = readfromfile(&temp, buffer, sizeof(buffer));
+ if ((read == (size_t) -1) || (read != append(arg, buffer, read))) {
+ if (temp.fp) {
+ fclose(temp.fp);
+ }
+ Curl_formclean(&data);
+ return -1;
+ }
+ } while (read == sizeof(buffer));
+ } else {
+ if (ptr->length != append(arg, ptr->line, ptr->length)) {
+ Curl_formclean(&data);
+ return -1;
+ }
+ }
+ }
+ Curl_formclean(&data);
+ return 0;
}
/*
@@ -906,7 +1001,69 @@ void curl_formfree(struct curl_httppost *form)
free(form->showfilename); /* free the faked file name */
free(form); /* free the struct */
- } while((form=next)); /* continue */
+ } while ((form = next) != NULL); /* continue */
+}
+
+#ifndef HAVE_BASENAME
+/*
+ (Quote from The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004
+ Edition)
+
+ The basename() function shall take the pathname pointed to by path and
+ return a pointer to the final component of the pathname, deleting any
+ trailing '/' characters.
+
+ If the string pointed to by path consists entirely of the '/' character,
+ basename() shall return a pointer to the string "/". If the string pointed
+ to by path is exactly "//", it is implementation-defined whether '/' or "//"
+ is returned.
+
+ If path is a null pointer or points to an empty string, basename() shall
+ return a pointer to the string ".".
+
+ The basename() function may modify the string pointed to by path, and may
+ return a pointer to static storage that may then be overwritten by a
+ subsequent call to basename().
+
+ The basename() function need not be reentrant. A function that is not
+ required to be reentrant is not required to be thread-safe.
+
+*/
+static char *basename(char *path)
+{
+ /* Ignore all the details above for now and make a quick and simple
+ implementaion here */
+ char *s1;
+ char *s2;
+
+ s1=strrchr(path, '/');
+ s2=strrchr(path, '\\');
+
+ if(s1 && s2) {
+ path = (s1 > s2? s1 : s2)+1;
+ }
+ else if(s1)
+ path = s1 + 1;
+ else if(s2)
+ path = s2 + 1;
+
+ return path;
+}
+#endif
+
+static char *strippath(char *fullfile)
+{
+ char *filename;
+ char *base;
+ filename = strdup(fullfile); /* duplicate since basename() may ruin the
+ buffer it works on */
+ if(!filename)
+ return NULL;
+ base = strdup(basename(filename));
+
+ free(filename); /* free temporary buffer */
+
+ return base; /* returns an allocated string! */
}
/*
@@ -914,10 +1071,13 @@ void curl_formfree(struct curl_httppost *form)
* (possibly huge) multipart formdata. The input list is in 'post', while the
* output resulting linked lists gets stored in '*finalform'. *sizep will get
* the total size of the whole POST.
+ * A multipart/form_data content-type is built, unless a custom content-type
+ * is passed in 'custom_content_type'.
*/
CURLcode Curl_getFormData(struct FormData **finalform,
struct curl_httppost *post,
+ const char *custom_content_type,
curl_off_t *sizep)
{
struct FormData *form = NULL;
@@ -941,9 +1101,11 @@ CURLcode Curl_getFormData(struct FormData **finalform,
/* Make the first line of the output */
result = AddFormDataf(&form, NULL,
- "Content-Type: multipart/form-data;"
- " boundary=%s\r\n",
+ "%s; boundary=%s\r\n",
+ custom_content_type?custom_content_type:
+ "Content-Type: multipart/form-data",
boundary);
+
if (result) {
free(boundary);
return result;
@@ -966,6 +1128,10 @@ CURLcode Curl_getFormData(struct FormData **finalform,
if (result)
break;
+ /* Maybe later this should be disabled when a custom_content_type is
+ passed, since Content-Disposition is not meaningful for all multipart
+ types.
+ */
result = AddFormDataf(&form, &size,
"Content-Disposition: form-data; name=\"");
if (result)
@@ -1004,22 +1170,33 @@ CURLcode Curl_getFormData(struct FormData **finalform,
if(post->more) {
/* if multiple-file */
+ char *filebasename=
+ (!file->showfilename)?strippath(file->contents):NULL;
+
result = AddFormDataf(&form, &size,
"\r\n--%s\r\nContent-Disposition: "
"attachment; filename=\"%s\"",
fileboundary,
(file->showfilename?file->showfilename:
- file->contents));
+ filebasename));
+ if (filebasename)
+ free(filebasename);
if (result)
break;
}
else if((post->flags & HTTPPOST_FILENAME) ||
(post->flags & HTTPPOST_BUFFER)) {
+ char *filebasename=
+ (!post->showfilename)?strippath(post->contents):NULL;
+
result = AddFormDataf(&form, &size,
"; filename=\"%s\"",
(post->showfilename?post->showfilename:
- post->contents));
+ filebasename));
+ if (filebasename)
+ free(filebasename);
+
if (result)
break;
}
@@ -1042,7 +1219,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
curList = curList->next;
}
if (result) {
- Curl_formclean(firstform);
+ Curl_formclean(&firstform);
free(boundary);
return result;
}
@@ -1057,7 +1234,10 @@ CURLcode Curl_getFormData(struct FormData **finalform,
if(file->contenttype &&
!checkprefix("text/", file->contenttype)) {
/* this is not a text content, mention our binary encoding */
- size += AddFormData(&form, "\r\nContent-Transfer-Encoding: binary", 0);
+ result = AddFormDataf(&form, &size,
+ "\r\nContent-Transfer-Encoding: binary");
+ if (result)
+ break;
}
#endif
@@ -1094,22 +1274,27 @@ CURLcode Curl_getFormData(struct FormData **finalform,
*/
size_t nread;
char buffer[512];
- while((nread = fread(buffer, 1, sizeof(buffer), fileread))) {
- result = AddFormData(&form, FORM_DATA, buffer, nread, &size);
+ while ((nread = fread(buffer, 1, sizeof(buffer), fileread)) != 0) {
+ result = AddFormData(&form, FORM_CONTENT, buffer, nread, &size);
if (result)
break;
}
}
if (result) {
- Curl_formclean(firstform);
+ Curl_formclean(&firstform);
free(boundary);
return result;
}
}
else {
- Curl_formclean(firstform);
+#ifdef _FORM_DEBUG
+ fprintf(stderr,
+ "\n==> Curl_getFormData couldn't open/read \"%s\"\n",
+ file->contents);
+#endif
+ Curl_formclean(&firstform);
free(boundary);
*finalform = NULL;
return CURLE_READ_ERROR;
@@ -1118,7 +1303,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
}
else if (post->flags & HTTPPOST_BUFFER) {
/* include contents of buffer */
- result = AddFormData(&form, FORM_DATA, post->buffer,
+ result = AddFormData(&form, FORM_CONTENT, post->buffer,
post->bufferlength, &size);
if (result)
break;
@@ -1126,14 +1311,14 @@ CURLcode Curl_getFormData(struct FormData **finalform,
else {
/* include the contents we got */
- result = AddFormData(&form, FORM_DATA, post->contents,
+ result = AddFormData(&form, FORM_CONTENT, post->contents,
post->contentslength, &size);
if (result)
break;
}
- } while((file = file->more)); /* for each specified file for this field */
+ } while ((file = file->more) != NULL); /* for each specified file for this field */
if (result) {
- Curl_formclean(firstform);
+ Curl_formclean(&firstform);
free(boundary);
return result;
}
@@ -1149,9 +1334,9 @@ CURLcode Curl_getFormData(struct FormData **finalform,
break;
}
- } while((post=post->next)); /* for each field */
+ } while ((post = post->next) != NULL); /* for each field */
if (result) {
- Curl_formclean(firstform);
+ Curl_formclean(&firstform);
free(boundary);
return result;
}
@@ -1161,7 +1346,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
"\r\n--%s--\r\n",
boundary);
if (result) {
- Curl_formclean(firstform);
+ Curl_formclean(&firstform);
free(boundary);
return result;
}
@@ -1198,12 +1383,12 @@ static size_t readfromfile(struct Form *form, char *buffer, size_t size)
/* this file hasn't yet been opened */
form->fp = fopen(form->data->line, "rb"); /* b is for binary */
if(!form->fp)
- return -1; /* failure */
+ return (size_t)-1; /* failure */
}
nread = fread(buffer, 1, size, form->fp);
if(nread != size) {
- /* this is the last chunk form the file, move on */
+ /* this is the last chunk from the file, move on */
fclose(form->fp);
form->fp = NULL;
form->data = form->data->next;
@@ -1232,9 +1417,13 @@ size_t Curl_FormReader(char *buffer,
if(!form->data)
return 0; /* nothing, error, empty */
- if(form->data->type == FORM_FILE)
- return readfromfile(form, buffer, wantedsize);
+ if(form->data->type == FORM_FILE) {
+ gotsize = readfromfile(form, buffer, wantedsize);
+ if(gotsize)
+ /* If positive or -1, return. If zero, continue! */
+ return gotsize;
+ }
do {
if( (form->data->length - form->sent ) > wantedsize - gotsize) {
@@ -1256,7 +1445,7 @@ size_t Curl_FormReader(char *buffer,
form->data = form->data->next; /* advance */
- } while(form->data && (form->data->type == FORM_DATA));
+ } while(form->data && (form->data->type != FORM_FILE));
/* If we got an empty line and we have more data, we proceed to the next
line immediately to avoid returning zero before we've reached the end.
This is the bug reported November 22 1999 on curl 6.3. (Daniel) */
@@ -1323,7 +1512,7 @@ int main()
char value5[] = "value for PTRCONTENTS + CONTENTSLENGTH";
char value6[] = "value for PTRCOTNENTS + CONTENTSLENGTH + CONTENTTYPE";
char value7[] = "inet_ntoa_r.h";
- char value8[] = "Makefile.b32.resp";
+ char value8[] = "Makefile.b32";
char type2[] = "image/gif";
char type6[] = "text/plain";
char type7[] = "text/html";
@@ -1332,7 +1521,8 @@ int main()
int value5length = strlen(value4);
int value6length = strlen(value5);
int errors = 0;
- int size;
+ CURLcode rc;
+ size_t size;
size_t nread;
char buffer[4096];
struct curl_httppost *httppost=NULL;
@@ -1408,7 +1598,14 @@ int main()
CURLFORM_END))
++errors;
- form=Curl_getFormData(httppost, &size);
+ rc = Curl_getFormData(&form, httppost, NULL, &size);
+ if(rc != CURLE_OK) {
+ if(rc != CURLE_READ_ERROR) {
+ const char *errortext = curl_easy_strerror(rc);
+ fprintf(stdout, "\n==> Curl_getFormData error: %s\n", errortext);
+ }
+ return 0;
+ }
Curl_FormInit(&formread, form);
@@ -1416,7 +1613,7 @@ int main()
nread = Curl_FormReader(buffer, 1, sizeof(buffer),
(FILE *)&formread);
- if(-1 == nread)
+ if(nread < 1)
break;
fwrite(buffer, nread, 1, stdout);
} while(1);
@@ -1430,7 +1627,7 @@ int main()
return 0;
}
-#endif
+#endif /* _FORM_DEBUG */
#else /* CURL_DISABLE_HTTP */
CURLFORMcode curl_formadd(struct curl_httppost **httppost,
@@ -1442,6 +1639,15 @@ CURLFORMcode curl_formadd(struct curl_httppost **httppost,
return CURL_FORMADD_DISABLED;
}
+int curl_formget(struct curl_httppost *form, void *arg,
+ curl_formget_callback append)
+{
+ (void) form;
+ (void) arg;
+ (void) append;
+ return CURL_FORMADD_DISABLED;
+}
+
void curl_formfree(struct curl_httppost *form)
{
(void)form;
@@ -1450,6 +1656,8 @@ void curl_formfree(struct curl_httppost *form)
#endif /* CURL_DISABLE_HTTP */
+#if !defined(CURL_DISABLE_HTTP) || defined(USE_SSLEAY)
+
/*
* Curl_FormBoundary() creates a suitable boundary string and returns an
* allocated one. This is also used by SSL-code so it must be present even
@@ -1458,18 +1666,18 @@ void curl_formfree(struct curl_httppost *form)
char *Curl_FormBoundary(void)
{
char *retstring;
- static int randomizer=0; /* this is just so that two boundaries within
+ static int randomizer; /* this is just so that two boundaries within
the same form won't be identical */
size_t i;
- static char table16[]="abcdef0123456789";
+ static const char table16[]="abcdef0123456789";
retstring = (char *)malloc(BOUNDARY_LENGTH+1);
if(!retstring)
return NULL; /* failed */
- srand((unsigned int)((time(NULL)+randomizer++))); /* seed */
+ srand((unsigned int)time(NULL)+randomizer++); /* seed */
strcpy(retstring, "----------------------------");
@@ -1482,3 +1690,5 @@ char *Curl_FormBoundary(void)
return retstring;
}
+
+#endif /* !defined(CURL_DISABLE_HTTP) || defined(USE_SSLEAY) */