cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Crash in curl library while processing HTTP HEAD response

From: isshed <isshed.sip_at_gmail.com>
Date: Thu, 18 Aug 2016 18:16:04 +0530

Please find the response inline..

On Thu, Aug 18, 2016 at 5:52 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Thu, 18 Aug 2016, isshed wrote:
>
>> Actually server is using HTTP/1.1 but the header response is coming as
>> plain text "404 - Error: Page Not Found.\r\n" and without any headers.
>
>
> Can you show us the *exact* bytes the server return? Does the response start
> with a status line at all? "HTTP/1.1 200 OK" style.
>
####### No it does not start with HTTP/1.1..after reading from socket
using function Curl_ssl_recv() in file sendf.c

if(conn->ssl[num].state == ssl_connection_complete) {
    nread = Curl_ssl_recv(conn, num, buffertofill, bytesfromsocket);

    if(nread == -1) {
      return -1; /* -1 from Curl_ssl_recv() means EWOULDBLOCK */
    }
    if(nread == 30)
    {
        printf("\n Curl_read ========== str:%s buffertofill %s nread
%d, num %d, bytesfromsocket %d", buffertofill, conn->master_buffer,
nread, num, bytesfromsocket);
        fflush(stdout);
    }
  }

I am getting "404 - Error: Page Not Found.\r\n" if I print buffertofill buffer..

>> My application is using HTTPS and sending HEAD request, and is getting
>> the above response.
>
>
> Is HTTPS a requirement or can to get the problem against a test server using
> plain HTTP?
>

############# As my customer is using HTTPS and that is the only
server I have to communicate with my app at the moment. But I feel
this same problem will be there for HTTP as well.

>> Is there anyway I can setup server as I can see this problem with one of
>> my customer servers.
>
>
> For some quick experiments to send "raw" data, using 'nc' is perfect:
>
> Run 'nc -p 8080 -l', connect your application to localhost:8080 and then
> type in the response in the window where nc runs and break control-c.
############ I am so sorry to ask the silly question ..but I have
installed Apache server and it is responding properly. can I modify
the HEAD response in apache server. I am not much aware of nc I need
to dig it.
>
>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: https://cool.haxx.se/list/listinfo/curl-library
> Etiquette: https://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-08-18