Annotation of embedaddon/curl/docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.3, revision 1.1
1.1 ! misho 1: .\" **************************************************************************
! 2: .\" * _ _ ____ _
! 3: .\" * Project ___| | | | _ \| |
! 4: .\" * / __| | | | |_) | |
! 5: .\" * | (__| |_| | _ <| |___
! 6: .\" * \___|\___/|_| \_\_____|
! 7: .\" *
! 8: .\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
! 9: .\" *
! 10: .\" * This software is licensed as described in the file COPYING, which
! 11: .\" * you should have received as part of this distribution. The terms
! 12: .\" * are also available at https://curl.haxx.se/docs/copyright.html.
! 13: .\" *
! 14: .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
! 15: .\" * copies of the Software, and permit persons to whom the Software is
! 16: .\" * furnished to do so, under the terms of the COPYING file.
! 17: .\" *
! 18: .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
! 19: .\" * KIND, either express or implied.
! 20: .\" *
! 21: .\" **************************************************************************
! 22: .\"
! 23: .TH CURLOPT_ALTSVC_CTRL 3 "February 11, 2020" "libcurl 7.70.0" "curl_easy_setopt options"
! 24:
! 25: .SH NAME
! 26: CURLOPT_ALTSVC_CTRL \- control alt-svc behavior
! 27: .SH SYNOPSIS
! 28: .nf
! 29: #include <curl/curl.h>
! 30:
! 31: #define CURLALTSVC_IMMEDIATELY (1<<0)
! 32: #define CURLALTSVC_READONLYFILE (1<<2)
! 33: #define CURLALTSVC_H1 (1<<3)
! 34: #define CURLALTSVC_H2 (1<<4)
! 35: #define CURLALTSVC_H3 (1<<5)
! 36:
! 37: CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ALTSVC_CTRL, long bitmask);
! 38: .fi
! 39: .SH EXPERIMENTAL
! 40: Warning: this feature is early code and is marked as experimental. It can only
! 41: be enabled by explicitly telling configure with \fB--enable-alt-svc\fP. You are
! 42: advised to not ship this in production before the experimental label is
! 43: removed.
! 44: .SH DESCRIPTION
! 45: Populate the long \fIbitmask\fP with the correct set of features to instruct
! 46: libcurl how to handle Alt-Svc for the transfers using this handle.
! 47:
! 48: libcurl will only accept Alt-Svc headers over a secure transport, meaning
! 49: HTTPS. It will also only complete a request to an alternative origin if that
! 50: origin is properly hosted over HTTPS. These requirements are there to make
! 51: sure both the source and the destination are legitimate.
! 52:
! 53: Setting any bit will enable the alt-svc engine.
! 54: .IP "CURLALTSVC_IMMEDIATELY"
! 55: If an Alt-Svc: header is received, this instructs libcurl to switch to one of
! 56: those alternatives asap rather than to save it and use for the next
! 57: request. (Not currently supported).
! 58: .IP "CURLALTSVC_READONLYFILE"
! 59: Do not write the alt-svc cache back to the file specified with
! 60: \fICURLOPT_ALTSVC(3)\fP even if it gets updated. By default a file specified
! 61: with that option will be read and written to as deemed necessary.
! 62: .IP "CURLALTSVC_H1"
! 63: Accept alternative services offered over HTTP/1.1.
! 64: .IP "CURLALTSVC_H2"
! 65: Accept alternative services offered over HTTP/2. This will only be used if
! 66: libcurl was also built to actually support HTTP/2, otherwise this bit will be
! 67: ignored.
! 68: .IP "CURLALTSVC_H3"
! 69: Accept alternative services offered over HTTP/3. This will only be used if
! 70: libcurl was also built to actually support HTTP/3, otherwise this bit will be
! 71: ignored.
! 72: .SH DEFAULT
! 73: Alt-Svc handling is disabled by default. If \fICURLOPT_ALTSVC(3)\fP is set,
! 74: \fICURLOPT_ALTSVC_CTRL(3)\fP has a default value corresponding to
! 75: CURLALTSVC_H1 | CURLALTSVC_H2 | CURLALTSVC_H3 - the HTTP/2 and HTTP/3 bits are
! 76: only set if libcurl was built with support for those versions.
! 77: .SH PROTOCOLS
! 78: HTTPS
! 79: .SH EXAMPLE
! 80: .nf
! 81: CURL *curl = curl_easy_init();
! 82: if(curl) {
! 83: curl_easy_setopt(curl, CURLOPT_ALTSVC_CTRL, CURLALTSVC_H1);
! 84: curl_easy_setopt(curl, CURLOPT_ALTSVC, "altsvc-cache.txt");
! 85: curl_easy_perform(curl);
! 86: }
! 87: .fi
! 88: .SH AVAILABILITY
! 89: Added in 7.64.1
! 90: .SH RETURN VALUE
! 91: Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
! 92: .SH "SEE ALSO"
! 93: .BR CURLOPT_ALTSVC "(3), " CURLOPT_CONNECT_TO "(3), " CURLOPT_RESOLVE "(3), "
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>