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: Fri, 15 Nov 2013 19:51:54 +0900

Hi,

I am sorry about it, but i dont understand what is meant by "top-posting"
I am not doing anything intentionally. So please tell me what exactly
i need to stop

I am using Apache server and have loaded a perl script to print the
environment variables of my machine.
 I wrote the script to print the same environment variables around 7 times
to make it a big response output. When i access the page using web browser
and using curl command line i get the complete output ( 7 times )
After each section I am adding a seperator : "iteration 1" ....upto ....
"iteration 7"

e.g :

=================

COMSPEC="C:\Windows\system32\cmd.exe"
CONTEXT_DOCUMENT_ROOT="D:/xampp/cgi-bin/"
CONTEXT_PREFIX="/cgi-bin/"
DOCUMENT_ROOT="D:/xampp/htdocs"
GATEWAY_INTERFACE="CGI/1.1"

iteration 2
COMSPEC="C:\Windows\system32\cmd.exe"
CONTEXT_DOCUMENT_ROOT="D:/xampp/cgi-bin/"
CONTEXT_PREFIX="/cgi-bin/"
DOCUMENT_ROOT="D:/xampp/htdocs"
GATEWAY_INTERFACE="CGI/1.1"

iteration 3
COMSPEC="C:\Windows\system32\cmd.exe"
CONTEXT_DOCUMENT_ROOT="D:/xampp/cgi-bin/"
CONTEXT_PREFIX="/cgi-bin/"
DOCUMENT_ROOT="D:/xampp/htdocs"
GATEWAY_INTERFACE="CGI/1.1"

etc upto "iteration 7"
=============================

the answer to your queries:

*q1.* what http header you get from server

curl -I http://33.33.33/sample.pl <http://33.33.0.33/sample.pl>

HTTP/1.1 200 OK
Date: Thu, 14 Nov 2013 04:40:46 GMT
Server: Apache/2.4.4 (Win32) OpenSSL/0.9.8y PHP/5.4.19
Content-Type: text/plain; charset=utf-8

this is what i get from server. ( i am using Apache server and have loaded
a perl script to print the environment variables of my machine) .
I am priting the environment variables around 5 to 6 times to make it a big
response output. When i access the page using web browser and using curl
command line i get the complete output

*q2.* please use the example code as is and what is the failure.

Let me inform 3 things here :

*1.* added printf statement inside size_t function

  size_t size, and size_t nmemb
i see that it is printing 3 times ( means the function is being called 3
times) :
output is :

*size = 1 , nmemb = 8149 realsize (size * nmemb) = 8149*
*size= 1, nmemb = 417 realsize (size * nmemb) = 417*
*size= 1, nmemb = 3510 realsize (size * nmemb) = 3510*

*2.* added printf statement to print

  chunk.size and chunk.memory

*chunk.size = 12076*
*chunk.memory = it just prints a small section the first part upto the
starting line of "iteration 1"*

*3.* then i pass the chunk.memory to my android application (activity) and
print it on the text view. the logcat shows :

*chunk.memory = it prints upto Iteration 4 ..... ( i am not able to see
the complete output , upto iteration 7)*

so i feel the output is getting truncated in between , and hence it is not
printing the entire output.

I hope you understood the scneario and the results

On Fri, Nov 15, 2013 at 6:52 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Thu, 14 Nov 2013, Sunil Chandrasekharan wrote:
>
> I didnt intent to say that your code has issues. i know its something to
>> do with my set up.
>>
>
> That's why I ask you questions about exactly what you get and what the
> exact failures are.
>
> Please use the example code as-is and tell us how it does not work - with
> DETAILS. What HTTP headers do you get back from the server and in which way
> is the response broken when libcurl has received it?
>
> And PLEASE stop the top-posting.
>
>
> --
>
> / 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-15