new
[libcurl.git] / curl_63_form.patch
blob03738dbc037c1ff723ef4fe469e402bda88c70a7
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
3 ***************
4 *** 41,47 ****
5 /*
6 Debug the form generator stand-alone by compiling this source file with:
8 ! 'make formdata'
10 run the 'formdata' executable and make sure the output is ok!
12 --- 41,47 ----
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!
20 ***************
21 *** 313,320 ****
22 if(!length)
23 length = strlen((char *)line);
25 ! newform->line = (char *)malloc(length);
26 ! memcpy(newform->line, line, length);
27 newform->length = length;
29 if(*formp) {
30 --- 313,320 ----
31 if(!length)
32 length = strlen((char *)line);
34 ! newform->line = (char *)malloc(length+1);
35 ! memcpy(newform->line, line, length+1);
36 newform->length = length;
38 if(*formp) {
39 ***************
40 *** 499,504 ****
41 --- 499,505 ----
42 size += AddFormDataf(&form,
43 "\r\n--%s--",
44 fileboundary);
45 + free(fileboundary);
48 } while((post=post->next)); /* for each field */
49 ***************
50 *** 511,518 ****
51 *sizep = size;
53 free(boundary);
54 - if(fileboundary)
55 - free(fileboundary);
57 return firstform;
59 --- 512,517 ----
60 ***************
61 *** 572,577 ****
62 --- 571,583 ----
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);
71 + }
73 return gotsize;
76 ***************
77 *** 615,621 ****
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);
85 --- 621,627 ----
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);