1 *** /homes/qradlsg/curl-org/lib/formdata.c Thu Oct 14 00:27:12 1999
2 --- formdata.c Mon Nov 22 16:55:20 1999
6 Debug the form generator stand-alone by compiling this source file with:
10 run the 'formdata' executable and make sure the output is ok!
14 Debug the form generator stand-alone by compiling this source file with:
16 ! gcc -DHAVE_CONFIG_H -I../ -g -D_FORM_DEBUG -o formdata -I../include formdata.c
18 run the 'formdata' executable and make sure the output is ok!
23 length = strlen((char *)line);
25 ! newform->line = (char *)malloc(length);
26 ! memcpy(newform->line, line, length);
27 newform->length = length;
32 length = strlen((char *)line);
34 ! newform->line = (char *)malloc(length+1);
35 ! memcpy(newform->line, line, length+1);
36 newform->length = length;
42 size += AddFormDataf(&form,
48 } while((post=post->next)); /* for each field */
64 form->data = form->data->next; /* advance */
66 + if(!gotsize && form->data) {
67 + /* If we got an empty line and we have more data, we proceed to the next
68 + line immediately to avoid returning zero before we've reached the end.
69 + This is the bug reported November 22 1999 on curl 6.3. (Daniel) */
70 + gotsize = FormReader(buffer, size, nitems, mydata);
78 FormInit(&formread, form);
80 while(nread = FormReader(buffer, 1, sizeof(buffer), (FILE *)&formread)) {
81 ! fwrite(buffer, nread, 1, stdout);
84 fprintf(stderr, "size: %d\n", size);
86 FormInit(&formread, form);
88 while(nread = FormReader(buffer, 1, sizeof(buffer), (FILE *)&formread)) {
89 ! fwrite(buffer, nread, 1, stderr);
92 fprintf(stderr, "size: %d\n", size);