pull: Add http2=false remote config option
This seems to work around https://github.com/ostreedev/ostree/issues/1362 Though I'm not entirely sure why yet. But at least with this it'll be easier for people to work around things locally. Closes: #1368 Approved by: jlebon
This commit is contained in:
parent
3f4506f088
commit
7173ac76bc
|
|
@ -222,6 +222,14 @@ Boston, MA 02111-1307, USA.
|
||||||
<listitem><para>Path to file containing trusted anchors instead of the system CA database.</para></listitem>
|
<listitem><para>Path to file containing trusted anchors instead of the system CA database.</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>http2</varname></term>
|
||||||
|
<listitem><para>A boolean value, defaults to true. By
|
||||||
|
default, libostree will use HTTP2; setting this to <literal>false</literal>
|
||||||
|
will disable it. May be useful to work around broken servers.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>unconfigured-state</varname></term>
|
<term><varname>unconfigured-state</varname></term>
|
||||||
<listitem><para>If set, pulls from this remote will fail with the configured text. This is intended for OS vendors which have a subscription process to access content.</para></listitem>
|
<listitem><para>If set, pulls from this remote will fail with the configured text. This is intended for OS vendors which have a subscription process to access content.</para></listitem>
|
||||||
|
|
|
||||||
|
|
@ -771,6 +771,8 @@ initiate_next_curl_request (FetcherRequest *req,
|
||||||
* there are numerous HTTP/2 fixes since the original version in
|
* there are numerous HTTP/2 fixes since the original version in
|
||||||
* libcurl 7.43.0.
|
* libcurl 7.43.0.
|
||||||
*/
|
*/
|
||||||
|
if (!(self->config_flags & OSTREE_FETCHER_FLAGS_DISABLE_HTTP2))
|
||||||
|
{
|
||||||
#if CURL_AT_LEAST_VERSION(7, 51, 0)
|
#if CURL_AT_LEAST_VERSION(7, 51, 0)
|
||||||
curl_easy_setopt (req->easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
|
curl_easy_setopt (req->easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -779,6 +781,7 @@ initiate_next_curl_request (FetcherRequest *req,
|
||||||
/* wait for pipe connection to confirm */
|
/* wait for pipe connection to confirm */
|
||||||
curl_easy_setopt (req->easy, CURLOPT_PIPEWAIT, 1L);
|
curl_easy_setopt (req->easy, CURLOPT_PIPEWAIT, 1L);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
curl_easy_setopt (req->easy, CURLOPT_WRITEFUNCTION, write_cb);
|
curl_easy_setopt (req->easy, CURLOPT_WRITEFUNCTION, write_cb);
|
||||||
if (g_getenv ("OSTREE_DEBUG_HTTP"))
|
if (g_getenv ("OSTREE_DEBUG_HTTP"))
|
||||||
curl_easy_setopt (req->easy, CURLOPT_VERBOSE, 1L);
|
curl_easy_setopt (req->easy, CURLOPT_VERBOSE, 1L);
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,8 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(OstreeFetcher, g_object_unref)
|
||||||
typedef enum {
|
typedef enum {
|
||||||
OSTREE_FETCHER_FLAGS_NONE = 0,
|
OSTREE_FETCHER_FLAGS_NONE = 0,
|
||||||
OSTREE_FETCHER_FLAGS_TLS_PERMISSIVE = (1 << 0),
|
OSTREE_FETCHER_FLAGS_TLS_PERMISSIVE = (1 << 0),
|
||||||
OSTREE_FETCHER_FLAGS_TRANSFER_GZIP = (1 << 1)
|
OSTREE_FETCHER_FLAGS_TRANSFER_GZIP = (1 << 1),
|
||||||
|
OSTREE_FETCHER_FLAGS_DISABLE_HTTP2 = (1 << 2),
|
||||||
} OstreeFetcherConfigFlags;
|
} OstreeFetcherConfigFlags;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|
|
||||||
|
|
@ -2690,6 +2690,15 @@ _ostree_repo_remote_new_fetcher (OstreeRepo *self,
|
||||||
if (gzip)
|
if (gzip)
|
||||||
fetcher_flags |= OSTREE_FETCHER_FLAGS_TRANSFER_GZIP;
|
fetcher_flags |= OSTREE_FETCHER_FLAGS_TRANSFER_GZIP;
|
||||||
|
|
||||||
|
{ gboolean http2 = TRUE;
|
||||||
|
if (!ostree_repo_get_remote_boolean_option (self, remote_name,
|
||||||
|
"http2", TRUE,
|
||||||
|
&http2, error))
|
||||||
|
goto out;
|
||||||
|
if (!http2)
|
||||||
|
fetcher_flags |= OSTREE_FETCHER_FLAGS_DISABLE_HTTP2;
|
||||||
|
}
|
||||||
|
|
||||||
fetcher = _ostree_fetcher_new (self->tmp_dir_fd, remote_name, fetcher_flags);
|
fetcher = _ostree_fetcher_new (self->tmp_dir_fd, remote_name, fetcher_flags);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue