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: Thu, 14 Nov 2013 11:29:39 +0900

Hi All,

Can you add my sample.pl file inside apache. then start apache and try to
access it using browser . if it displays the entire ouput. then fine.
now use the example c file as given by Daniel
http://curl.haxx.se/libcurl/c/getinmemory.html

Please let me know if you are able to get the same output with the c file
as it is shown using browser.

I just want to clarify here that the same c file i have used and still i am
not getting the entire response lines as output.

please help

On Thu, Nov 14, 2013 at 7:59 AM, Fahad Ashfaque <me_at_fahadash.com> wrote:

> I am using that example in my application, it is working perfect. I am
> using C++ under SLES 11.
>
>
> On Wed, Nov 13, 2013 at 1:30 AM, Sunil Chandrasekharan <
> sunil.kainat_at_gmail.com> wrote:
>
>> 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
>>
>
>
> -------------------------------------------------------------------
> 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-14