www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19385] New: Question: How to set curl options for HTTP from


          Issue ID: 19385
           Summary: Question: How to set curl options for HTTP from inside
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: alex.braunegg gmail.com


In Curl 7.62.0, this now defaults to using HTTP 2.0 for connections where h2 is
available, when build with h2 support. 

Is there a way to set the libcurl options to force http 1.1 for all connections
rather than using 'no flag' which lets libcurl choose the connection mechanism?

I have tried the following:

import std.net.curl;
http = HTTP();

However this generates the following error:

std.net.curl.CurlException std/net/curl.d(4340): Unsupported protocol on handle

Can anyone advise how to set the curl options so that I can tell the library to
only use http 1.1?

The issue I am trying to solve is - when DMD is using HTTP2 for file downloads,
'something' is happening when the file download is being completed which is
causing an error - as the file 'disappears'. When downgrading the curl library
to 7.61.0 (which does not enable http2 by default) there is no issue.


Nov 09 2018