cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: reagrding error in getting complete server response

From: Sunil Chandrasekharan <sunil.kainat_at_gmail.com>
Date: Wed, 13 Nov 2013 15:30:46 +0900

Hi All,

i tried that example shown below but i couldnt get the complete response.

i followed your example..but i couldnt get the complete response in
page.data (chunk.memory).
I am using a sample.pl file installed inside apache server for testing. i
try to send request to this script and fetch the response using curl .
i will add my perl script code. can you try to install apache server and
add the lines into a sample.pl file .
Then use browser to check if it prints the output when you access it. if
all done..then can you try the curl program to get and print the output .

 If succesful please let me know.

sample.pl

#!"D:\xampp\perl\bin\perl.exe"
##
## printenv -- demo CGI program which just prints its environment
##
print "Content-type: text/plain; charset=utf-8\n\n";
foreach $var (sort(keys(%ENV))) {
 $val = $ENV{$var};
 $val =~ s|\n|\\n|g;
 $val =~ s|"|\\"|g;
 print "${var}=\"${val}\"\n";
}
print "iteration 2\n";
foreach $var (sort(keys(%ENV))) {
 $val = $ENV{$var};
 $val =~ s|\n|\\n|g;
 $val =~ s|"|\\"|g;
 print "${var}=\"${val}\"\n";
}
print "iteration 3\n";
foreach $var (sort(keys(%ENV))) {
 $val = $ENV{$var};
 $val =~ s|\n|\\n|g;
 $val =~ s|"|\\"|g;
 print "${var}=\"${val}\"\n";
}
print "iteration 4\n";
foreach $var (sort(keys(%ENV))) {
 $val = $ENV{$var};
 $val =~ s|\n|\\n|g;
 $val =~ s|"|\\"|g;
 print "${var}=\"${val}\"\n";
}

i added the foreach loop as many times, to make the response big. then i
tried to use the program as shown in the link using my android application.
But the response data gets truncated.

Can you tell me if you could get the complete response? When i try
running curl form command line, i can get the full response

On Wed, Nov 13, 2013 at 10:49 AM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Tue, 12 Nov 2013, Sunil Chandrasekharan wrote:
>
> I have given my c code snippet in my last response , regarding the buffer
>> size and allocation. Kindly help to dynamically increase the buffer to
>> accomodate the big response data
>>
>
> We did it for a long time ago:
>
> http://curl.haxx.se/libcurl/c/getinmemory.html
>
> --
>
> / daniel.haxx.se
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-11-13