hyper: drop support
lib : remove all hyper code configure: stop detecting hyper docs: no more mention of hyper tests: mo more special-handling of hyper builds CI: no jobs using hyper Closes #15120
This commit is contained in:
parent
46093d9e0e
commit
fc3e1cbc50
8
.github/labeler.yml
vendored
8
.github/labeler.yml
vendored
@ -292,14 +292,6 @@ HTTP/3:
|
|||||||
tests/nghttpx.conf\
|
tests/nghttpx.conf\
|
||||||
}"
|
}"
|
||||||
|
|
||||||
Hyper:
|
|
||||||
- all:
|
|
||||||
- changed-files:
|
|
||||||
- any-glob-to-all-files: "{\
|
|
||||||
docs/HYPER.md,\
|
|
||||||
lib/c-hyper.*\
|
|
||||||
}"
|
|
||||||
|
|
||||||
IMAP:
|
IMAP:
|
||||||
- all:
|
- all:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
|
|||||||
2
.github/scripts/binarycheck.sums
vendored
2
.github/scripts/binarycheck.sums
vendored
@ -18,7 +18,7 @@ b967734c9bfe3d7a1a7795f348f0bce4d9ba15ca9590697ef2d4d15b92822db0 ./tests/certs/
|
|||||||
d640923e45809a3fe277e0af90459d82d32603aacc7b8db88754fcb335bf98df ./tests/data/test1531
|
d640923e45809a3fe277e0af90459d82d32603aacc7b8db88754fcb335bf98df ./tests/data/test1531
|
||||||
6f51bc318104fb5fe4b6013fc4e8e1c3c8dec1819202e8ea025bdbc4bbc8c02d ./tests/data/test1938
|
6f51bc318104fb5fe4b6013fc4e8e1c3c8dec1819202e8ea025bdbc4bbc8c02d ./tests/data/test1938
|
||||||
28a957ec3397881bbafd0d97879cedfd475bcd1ece903e531576affd7aa3865c ./tests/data/test2080
|
28a957ec3397881bbafd0d97879cedfd475bcd1ece903e531576affd7aa3865c ./tests/data/test2080
|
||||||
db99126801fd5e7cb0c1ec1a0078e5599038c8c07073f3d62ed51f155e0e3d38 ./tests/data/test262
|
33809cab2442488e5985b4939727bc4ead9fc65150f53008e3e4c93140675a94 ./tests/data/test262
|
||||||
2d073a52984bab1f196d80464ea8ab6dafd887bd5fee9ed58603f8510df0c6a5 ./tests/data/test35
|
2d073a52984bab1f196d80464ea8ab6dafd887bd5fee9ed58603f8510df0c6a5 ./tests/data/test35
|
||||||
4cc9fd6f31d0bb4dcb38e1565796e7ec5e48ea5ac9d3c1101de576be618786ba ./tests/data/test463
|
4cc9fd6f31d0bb4dcb38e1565796e7ec5e48ea5ac9d3c1101de576be618786ba ./tests/data/test463
|
||||||
d655a29dcf2423b420b508c9e381b0fad0b88feb74caa8978725e22c9f7c374d ./tests/data/test467
|
d655a29dcf2423b420b508c9e381b0fad0b88feb74caa8978725e22c9f7c374d ./tests/data/test467
|
||||||
|
|||||||
105
configure.ac
105
configure.ac
@ -677,7 +677,7 @@ AS_HELP_STRING([--disable-http],[Disable HTTP support]),
|
|||||||
dnl toggle off alt-svc too when HTTP is disabled
|
dnl toggle off alt-svc too when HTTP is disabled
|
||||||
AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
|
AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
|
||||||
AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable HSTS])
|
AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable HSTS])
|
||||||
curl_h1_msg="no (--enable-http, --with-hyper)"
|
curl_h1_msg="no (--enable-http)"
|
||||||
curl_altsvc_msg="no";
|
curl_altsvc_msg="no";
|
||||||
curl_hsts_msg="no (--enable-hsts)";
|
curl_hsts_msg="no (--enable-hsts)";
|
||||||
enable_altsvc="no"
|
enable_altsvc="no"
|
||||||
@ -800,104 +800,6 @@ AS_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
|
|||||||
fi ]
|
fi ]
|
||||||
)
|
)
|
||||||
|
|
||||||
dnl **********************************************************************
|
|
||||||
dnl Check for Hyper
|
|
||||||
dnl **********************************************************************
|
|
||||||
|
|
||||||
OPT_HYPER="no"
|
|
||||||
|
|
||||||
AC_ARG_WITH(hyper,
|
|
||||||
AS_HELP_STRING([--with-hyper=PATH],[Enable hyper usage])
|
|
||||||
AS_HELP_STRING([--without-hyper],[Disable hyper usage]),
|
|
||||||
[OPT_HYPER=$withval])
|
|
||||||
case "$OPT_HYPER" in
|
|
||||||
no)
|
|
||||||
dnl --without-hyper option used
|
|
||||||
want_hyper="no"
|
|
||||||
;;
|
|
||||||
yes)
|
|
||||||
dnl --with-hyper option used without path
|
|
||||||
want_hyper="default"
|
|
||||||
want_hyper_path=""
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
dnl --with-hyper option used with path
|
|
||||||
want_hyper="yes"
|
|
||||||
want_hyper_path="$withval"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if test X"$want_hyper" != Xno; then
|
|
||||||
if test "x$disable_http" = "xyes"; then
|
|
||||||
AC_MSG_ERROR([--with-hyper is not compatible with --disable-http])
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl backup the pre-hyper variables
|
|
||||||
CLEANLDFLAGS="$LDFLAGS"
|
|
||||||
CLEANCPPFLAGS="$CPPFLAGS"
|
|
||||||
CLEANLIBS="$LIBS"
|
|
||||||
|
|
||||||
CURL_CHECK_PKGCONFIG(hyper, $want_hyper_path)
|
|
||||||
|
|
||||||
if test "$PKGCONFIG" != "no"; then
|
|
||||||
LIB_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
|
|
||||||
$PKGCONFIG --libs-only-l hyper`
|
|
||||||
CPP_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path]) dnl
|
|
||||||
$PKGCONFIG --cflags-only-I hyper`
|
|
||||||
LD_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
|
|
||||||
$PKGCONFIG --libs-only-L hyper`
|
|
||||||
else
|
|
||||||
dnl no hyper pkg-config found
|
|
||||||
LIB_HYPER="-lhyper -ldl -lpthread -lm"
|
|
||||||
if test X"$want_hyper" != Xdefault; then
|
|
||||||
CPP_HYPER=-I"$want_hyper_path/capi/include"
|
|
||||||
LD_HYPER="-L$want_hyper_path/target/release -L$want_hyper_path/target/debug"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if test -n "$LIB_HYPER"; then
|
|
||||||
AC_MSG_NOTICE([-l is $LIB_HYPER])
|
|
||||||
AC_MSG_NOTICE([-I is $CPP_HYPER])
|
|
||||||
AC_MSG_NOTICE([-L is $LD_HYPER])
|
|
||||||
|
|
||||||
LDFLAGS="$LDFLAGS $LD_HYPER"
|
|
||||||
CPPFLAGS="$CPPFLAGS $CPP_HYPER"
|
|
||||||
LIBS="$LIB_HYPER $LIBS"
|
|
||||||
|
|
||||||
if test "x$cross_compiling" != "xyes"; then
|
|
||||||
dnl remove -L, separate with colon if more than one
|
|
||||||
DIR_HYPER=`echo $LD_HYPER | $SED -e 's/^-L//' -e 's/ -L/:/g'`
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_CHECK_LIB(hyper, hyper_io_new,
|
|
||||||
[
|
|
||||||
AC_CHECK_HEADERS(hyper.h,
|
|
||||||
experimental="$experimental Hyper"
|
|
||||||
AC_MSG_NOTICE([Hyper support is experimental])
|
|
||||||
curl_h1_msg="enabled (Hyper)"
|
|
||||||
HYPER_ENABLED=1
|
|
||||||
AC_DEFINE(USE_HYPER, 1, [if hyper is in use])
|
|
||||||
AC_SUBST(USE_HYPER, [1])
|
|
||||||
CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_HYPER"
|
|
||||||
export CURL_LIBRARY_PATH
|
|
||||||
AC_MSG_NOTICE([Added $DIR_HYPER to CURL_LIBRARY_PATH])
|
|
||||||
LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE hyper"
|
|
||||||
)
|
|
||||||
],
|
|
||||||
for d in `echo $DIR_HYPER | $SED -e 's/:/ /'`; do
|
|
||||||
if test -f "$d/libhyper.a"; then
|
|
||||||
AC_MSG_ERROR([hyper was found in $d but was probably built with wrong flags. See docs/HYPER.md.])
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
AC_MSG_ERROR([--with-hyper but hyper was not found. See docs/HYPER.md.])
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test X"$want_hyper" != Xno; then
|
|
||||||
AC_MSG_NOTICE([Disable RTSP support with hyper])
|
|
||||||
AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
|
|
||||||
CURL_DISABLE_RTSP=1
|
|
||||||
else
|
|
||||||
AC_MSG_CHECKING([whether to support rtsp])
|
AC_MSG_CHECKING([whether to support rtsp])
|
||||||
AC_ARG_ENABLE(rtsp,
|
AC_ARG_ENABLE(rtsp,
|
||||||
AS_HELP_STRING([--enable-rtsp],[Enable RTSP support])
|
AS_HELP_STRING([--enable-rtsp],[Enable RTSP support])
|
||||||
@ -924,7 +826,6 @@ AS_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
|
|||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
fi
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to support proxies])
|
AC_MSG_CHECKING([whether to support proxies])
|
||||||
AC_ARG_ENABLE(proxy,
|
AC_ARG_ENABLE(proxy,
|
||||||
@ -2989,8 +2890,8 @@ dnl **********************************************************************
|
|||||||
|
|
||||||
OPT_H2="yes"
|
OPT_H2="yes"
|
||||||
|
|
||||||
if test "x$disable_http" = "xyes" -o X"$want_hyper" != Xno; then
|
if test "x$disable_http" = "xyes"; then
|
||||||
# without HTTP or with Hyper, nghttp2 is no use
|
# without HTTP nghttp2 is no use
|
||||||
OPT_H2="no"
|
OPT_H2="no"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -23,36 +23,6 @@ and use TLS 1.3, or else it is not good enough.
|
|||||||
As of May 2024, the libraries that need to get fixed to remain supported after
|
As of May 2024, the libraries that need to get fixed to remain supported after
|
||||||
May 2025 are: BearSSL and Secure Transport.
|
May 2025 are: BearSSL and Secure Transport.
|
||||||
|
|
||||||
## Hyper
|
|
||||||
|
|
||||||
Hyper is an alternative HTTP backend for curl. It uses the hyper library and
|
|
||||||
could in theory be used for HTTP/1, HTTP/2 and even HTTP/3 in the future with
|
|
||||||
curl.
|
|
||||||
|
|
||||||
The original plan and goal was that we would add this HTTP alternative (using
|
|
||||||
a memory-safe library) and that users could eventually build and use libcurl
|
|
||||||
exactly as previously but with parts of the core being more memory-safe.
|
|
||||||
|
|
||||||
The hyper implementation ran into some snags and 10-15 tests and HTTP/2
|
|
||||||
support have remained disabled with hyper. For these reasons, hyper support
|
|
||||||
has remained tagged EXPERIMENTAL.
|
|
||||||
|
|
||||||
It is undoubtedly hard work to fix these remaining problems, as they typically
|
|
||||||
require both rust and C knowledge in addition to deep HTTP familiarity. There
|
|
||||||
does not seem to be that many persons interested or available for this
|
|
||||||
challenge. Meanwhile, there is little if any demand for hyper from existing
|
|
||||||
(lib)curl users.
|
|
||||||
|
|
||||||
Finally: having support for hyper in curl has a significant cost: we need to
|
|
||||||
maintain and develop a lot of functionality and tests twice to make sure
|
|
||||||
libcurl works identically using either HTTP backend.
|
|
||||||
|
|
||||||
The only way to keep hyper support in curl is to give it a good polish by
|
|
||||||
someone with time, skill and energy to spend on this task.
|
|
||||||
|
|
||||||
Unless a significant overhaul has proven to be in progress, hyper support is
|
|
||||||
removed from curl in January 2025.
|
|
||||||
|
|
||||||
## Past removals
|
## Past removals
|
||||||
|
|
||||||
- Pipelining
|
- Pipelining
|
||||||
@ -65,3 +35,4 @@ removed from curl in January 2025.
|
|||||||
- MinGW v1
|
- MinGW v1
|
||||||
- NTLM_WB
|
- NTLM_WB
|
||||||
- space-separated `NOPROXY` patterns
|
- space-separated `NOPROXY` patterns
|
||||||
|
- hyper
|
||||||
|
|||||||
@ -34,14 +34,6 @@ Experimental support in curl means:
|
|||||||
|
|
||||||
## Experimental features right now
|
## Experimental features right now
|
||||||
|
|
||||||
### The Hyper HTTP backend
|
|
||||||
|
|
||||||
Graduation requirements:
|
|
||||||
|
|
||||||
- HTTP/1 and HTTP/2 support, including multiplexing
|
|
||||||
|
|
||||||
(Hyper is marked for deprecation. It cannot graduate.)
|
|
||||||
|
|
||||||
### HTTP/3 support (non-ngtcp2 backends)
|
### HTTP/3 support (non-ngtcp2 backends)
|
||||||
|
|
||||||
Graduation requirements:
|
Graduation requirements:
|
||||||
|
|||||||
@ -50,7 +50,6 @@ INTERNALDOCS = \
|
|||||||
internals/CONNECTION-FILTERS.md \
|
internals/CONNECTION-FILTERS.md \
|
||||||
internals/DYNBUF.md \
|
internals/DYNBUF.md \
|
||||||
internals/HASH.md \
|
internals/HASH.md \
|
||||||
internals/HYPER.md \
|
|
||||||
internals/LLIST.md \
|
internals/LLIST.md \
|
||||||
internals/MQTT.md \
|
internals/MQTT.md \
|
||||||
internals/NEW-PROTOCOL.md \
|
internals/NEW-PROTOCOL.md \
|
||||||
|
|||||||
@ -15,11 +15,9 @@ Example:
|
|||||||
|
|
||||||
# `--ignore-content-length`
|
# `--ignore-content-length`
|
||||||
|
|
||||||
For HTTP, Ignore the Content-Length header. This is particularly useful for
|
For HTTP, ignore the Content-Length header. This is particularly useful for
|
||||||
servers running Apache 1.x, which reports incorrect Content-Length for
|
servers running Apache 1.x, which reports incorrect Content-Length for files
|
||||||
files larger than 2 gigabytes.
|
larger than 2 gigabytes.
|
||||||
|
|
||||||
For FTP, this makes curl skip the SIZE command to figure out the size before
|
For FTP, this makes curl skip the SIZE command to figure out the size before
|
||||||
downloading a file (added in 7.46.0).
|
downloading a file (added in 7.46.0).
|
||||||
|
|
||||||
This option does not work for HTTP if libcurl was built to use hyper.
|
|
||||||
|
|||||||
@ -1,78 +0,0 @@
|
|||||||
<!--
|
|
||||||
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
|
||||||
|
|
||||||
SPDX-License-Identifier: curl
|
|
||||||
-->
|
|
||||||
|
|
||||||
# Hyper
|
|
||||||
|
|
||||||
Hyper is a separate HTTP library written in Rust. curl can be told to use this
|
|
||||||
library as a backend to deal with HTTP.
|
|
||||||
|
|
||||||
## EXPERIMENTAL
|
|
||||||
|
|
||||||
Hyper support in curl is considered **EXPERIMENTAL** until further notice. It
|
|
||||||
needs to be explicitly enabled at build-time.
|
|
||||||
|
|
||||||
Further development and tweaking of the Hyper backend support in curl happens
|
|
||||||
in the master branch using pull-requests, just like ordinary changes.
|
|
||||||
|
|
||||||
## Hyper version
|
|
||||||
|
|
||||||
The C API for Hyper is brand new and is still under development.
|
|
||||||
|
|
||||||
## Build curl with hyper
|
|
||||||
|
|
||||||
Using Rust 1.64.0 or later, build hyper and enable its C API like this:
|
|
||||||
|
|
||||||
% git clone https://github.com/hyperium/hyper
|
|
||||||
% cd hyper
|
|
||||||
% RUSTFLAGS="--cfg hyper_unstable_ffi" cargo rustc --features client,http1,http2,ffi --crate-type cdylib
|
|
||||||
|
|
||||||
Also, `--release` can be added for a release (optimized) build.
|
|
||||||
|
|
||||||
Build curl to use hyper's C API:
|
|
||||||
|
|
||||||
% git clone https://github.com/curl/curl
|
|
||||||
% cd curl
|
|
||||||
% autoreconf -fi
|
|
||||||
% ./configure LDFLAGS="-Wl,-rpath,<hyper-dir>/target/debug -Wl,-rpath,<hyper-dir>/target/release" --with-openssl --with-hyper=<hyper-dir>
|
|
||||||
% make
|
|
||||||
|
|
||||||
# Using Hyper internally
|
|
||||||
|
|
||||||
Hyper is a low level HTTP transport library. curl itself provides all HTTP
|
|
||||||
headers and Hyper provides all received headers back to curl.
|
|
||||||
|
|
||||||
Therefore, most of the "header logic" in curl as in responding to and acting
|
|
||||||
on specific input and output headers are done the same way in curl code.
|
|
||||||
|
|
||||||
The API in Hyper delivers received HTTP headers as (cleaned up) name=value
|
|
||||||
pairs, making it impossible for curl to know the exact byte representation
|
|
||||||
over the wire with Hyper.
|
|
||||||
|
|
||||||
## Limitations
|
|
||||||
|
|
||||||
The hyper backend does not support
|
|
||||||
|
|
||||||
- `CURLOPT_IGNORE_CONTENT_LENGTH`
|
|
||||||
- `--raw` and disabling `CURLOPT_HTTP_TRANSFER_DECODING`
|
|
||||||
- RTSP
|
|
||||||
- hyper is much stricter about what HTTP header contents it allows
|
|
||||||
- leading whitespace in first HTTP/1 response header
|
|
||||||
- HTTP/0.9
|
|
||||||
- HTTP/2 upgrade using HTTP:// URLs. Aka 'h2c'
|
|
||||||
- HTTP/2 in general. Hyper has support for HTTP/2 but the curl side
|
|
||||||
needs changes so that a `hyper_clientconn` can last for the duration
|
|
||||||
of a connection. Probably this means turning the Hyper HTTP/2 backend
|
|
||||||
into a connection filter.
|
|
||||||
|
|
||||||
## Remaining issues
|
|
||||||
|
|
||||||
This backend is still not feature complete with the native backend. Areas that
|
|
||||||
still need attention and verification include:
|
|
||||||
|
|
||||||
- multiplexed HTTP/2
|
|
||||||
- h2 Upgrade:
|
|
||||||
- receiving HTTP/1 trailers
|
|
||||||
- sending HTTP/1 trailers
|
|
||||||
@ -99,7 +99,6 @@ Ideas:
|
|||||||
|
|
||||||
- Verify the Sec-WebSocket-Accept response. It requires a sha-1 function.
|
- Verify the Sec-WebSocket-Accept response. It requires a sha-1 function.
|
||||||
- Verify Sec-WebSocket-Extensions and Sec-WebSocket-Protocol in the response
|
- Verify Sec-WebSocket-Extensions and Sec-WebSocket-Protocol in the response
|
||||||
- Make WebSocket work with hyper
|
|
||||||
- Consider a `curl_ws_poll()`
|
- Consider a `curl_ws_poll()`
|
||||||
- Make sure WebSocket code paths are fuzzed
|
- Make sure WebSocket code paths are fuzzed
|
||||||
- Add client-side PING interval
|
- Add client-side PING interval
|
||||||
|
|||||||
@ -31,11 +31,6 @@ Pass a long to tell libcurl how to act on transfer decoding. If set to zero,
|
|||||||
transfer decoding is disabled, if set to 1 it is enabled (default). libcurl
|
transfer decoding is disabled, if set to 1 it is enabled (default). libcurl
|
||||||
does chunked transfer decoding by default unless this option is set to zero.
|
does chunked transfer decoding by default unless this option is set to zero.
|
||||||
|
|
||||||
# NOTES
|
|
||||||
|
|
||||||
This option does not work with the hyper backend as that always has transfer
|
|
||||||
decoding enabled.
|
|
||||||
|
|
||||||
# DEFAULT
|
# DEFAULT
|
||||||
|
|
||||||
1
|
1
|
||||||
|
|||||||
@ -69,11 +69,6 @@ int main(void)
|
|||||||
|
|
||||||
Support for FTP added in 7.46.0.
|
Support for FTP added in 7.46.0.
|
||||||
|
|
||||||
# NOTES
|
|
||||||
|
|
||||||
This option is not working for HTTP when libcurl is built to use the hyper
|
|
||||||
backend.
|
|
||||||
|
|
||||||
# %AVAILABILITY%
|
# %AVAILABILITY%
|
||||||
|
|
||||||
# RETURN VALUE
|
# RETURN VALUE
|
||||||
|
|||||||
@ -114,7 +114,6 @@ LIB_CFILES = \
|
|||||||
base64.c \
|
base64.c \
|
||||||
bufq.c \
|
bufq.c \
|
||||||
bufref.c \
|
bufref.c \
|
||||||
c-hyper.c \
|
|
||||||
cf-h1-proxy.c \
|
cf-h1-proxy.c \
|
||||||
cf-h2-proxy.c \
|
cf-h2-proxy.c \
|
||||||
cf-haproxy.c \
|
cf-haproxy.c \
|
||||||
@ -248,7 +247,6 @@ LIB_HFILES = \
|
|||||||
asyn.h \
|
asyn.h \
|
||||||
bufq.h \
|
bufq.h \
|
||||||
bufref.h \
|
bufref.h \
|
||||||
c-hyper.h \
|
|
||||||
cf-h1-proxy.h \
|
cf-h1-proxy.h \
|
||||||
cf-h2-proxy.h \
|
cf-h2-proxy.h \
|
||||||
cf-haproxy.h \
|
cf-haproxy.h \
|
||||||
|
|||||||
1254
lib/c-hyper.c
1254
lib/c-hyper.c
File diff suppressed because it is too large
Load Diff
@ -1,63 +0,0 @@
|
|||||||
#ifndef HEADER_CURL_HYPER_H
|
|
||||||
#define HEADER_CURL_HYPER_H
|
|
||||||
/***************************************************************************
|
|
||||||
* _ _ ____ _
|
|
||||||
* Project ___| | | | _ \| |
|
|
||||||
* / __| | | | |_) | |
|
|
||||||
* | (__| |_| | _ <| |___
|
|
||||||
* \___|\___/|_| \_\_____|
|
|
||||||
*
|
|
||||||
* Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
|
||||||
*
|
|
||||||
* This software is licensed as described in the file COPYING, which
|
|
||||||
* you should have received as part of this distribution. The terms
|
|
||||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
|
||||||
*
|
|
||||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
||||||
* copies of the Software, and permit persons to whom the Software is
|
|
||||||
* furnished to do so, under the terms of the COPYING file.
|
|
||||||
*
|
|
||||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
||||||
* KIND, either express or implied.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: curl
|
|
||||||
*
|
|
||||||
***************************************************************************/
|
|
||||||
#include "curl_setup.h"
|
|
||||||
|
|
||||||
#if !defined(CURL_DISABLE_HTTP) && defined(USE_HYPER)
|
|
||||||
|
|
||||||
#include <hyper.h>
|
|
||||||
|
|
||||||
struct hyp_io_ctx {
|
|
||||||
struct Curl_easy *data;
|
|
||||||
int sockindex;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* per-transfer data for the Hyper backend */
|
|
||||||
struct hyptransfer {
|
|
||||||
hyper_waker *write_waker;
|
|
||||||
hyper_waker *read_waker;
|
|
||||||
const hyper_executor *exec;
|
|
||||||
hyper_waker *send_body_waker;
|
|
||||||
struct hyp_io_ctx io_ctx;
|
|
||||||
};
|
|
||||||
|
|
||||||
size_t Curl_hyper_recv(void *userp, hyper_context *ctx,
|
|
||||||
uint8_t *buf, size_t buflen);
|
|
||||||
size_t Curl_hyper_send(void *userp, hyper_context *ctx,
|
|
||||||
const uint8_t *buf, size_t buflen);
|
|
||||||
CURLcode Curl_hyper_stream(struct Curl_easy *data,
|
|
||||||
struct connectdata *conn,
|
|
||||||
int *didwhat,
|
|
||||||
int select_res);
|
|
||||||
|
|
||||||
CURLcode Curl_hyper_header(struct Curl_easy *data, hyper_headers *headers,
|
|
||||||
const char *line);
|
|
||||||
void Curl_hyper_done(struct Curl_easy *);
|
|
||||||
|
|
||||||
#else
|
|
||||||
#define Curl_hyper_done(x)
|
|
||||||
|
|
||||||
#endif /* !defined(CURL_DISABLE_HTTP) && defined(USE_HYPER) */
|
|
||||||
#endif /* HEADER_CURL_HYPER_H */
|
|
||||||
@ -27,9 +27,6 @@
|
|||||||
#if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP)
|
#if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP)
|
||||||
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#ifdef USE_HYPER
|
|
||||||
#include <hyper.h>
|
|
||||||
#endif
|
|
||||||
#include "urldata.h"
|
#include "urldata.h"
|
||||||
#include "dynbuf.h"
|
#include "dynbuf.h"
|
||||||
#include "sendf.h"
|
#include "sendf.h"
|
||||||
@ -184,9 +181,6 @@ static void h1_tunnel_go_state(struct Curl_cfilter *cf,
|
|||||||
make sure that it is not accidentally used for the document request
|
make sure that it is not accidentally used for the document request
|
||||||
after we have connected. So let's free and clear it here. */
|
after we have connected. So let's free and clear it here. */
|
||||||
Curl_safefree(data->state.aptr.proxyuserpwd);
|
Curl_safefree(data->state.aptr.proxyuserpwd);
|
||||||
#ifdef USE_HYPER
|
|
||||||
data->state.hconnect = FALSE;
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -212,7 +206,6 @@ static bool tunnel_want_send(struct h1_tunnel_state *ts)
|
|||||||
return (ts->tunnel_state == H1_TUNNEL_CONNECT);
|
return (ts->tunnel_state == H1_TUNNEL_CONNECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef USE_HYPER
|
|
||||||
static CURLcode start_CONNECT(struct Curl_cfilter *cf,
|
static CURLcode start_CONNECT(struct Curl_cfilter *cf,
|
||||||
struct Curl_easy *data,
|
struct Curl_easy *data,
|
||||||
struct h1_tunnel_state *ts)
|
struct h1_tunnel_state *ts)
|
||||||
@ -529,337 +522,6 @@ static CURLcode recv_CONNECT_resp(struct Curl_cfilter *cf,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* USE_HYPER */
|
|
||||||
|
|
||||||
static CURLcode CONNECT_host(struct Curl_cfilter *cf,
|
|
||||||
struct Curl_easy *data,
|
|
||||||
char **pauthority,
|
|
||||||
char **phost_header)
|
|
||||||
{
|
|
||||||
const char *hostname;
|
|
||||||
int port;
|
|
||||||
bool ipv6_ip;
|
|
||||||
CURLcode result;
|
|
||||||
char *authority; /* for CONNECT, the destination host + port */
|
|
||||||
char *host_header = NULL; /* Host: authority */
|
|
||||||
|
|
||||||
result = Curl_http_proxy_get_destination(cf, &hostname, &port, &ipv6_ip);
|
|
||||||
if(result)
|
|
||||||
return result;
|
|
||||||
|
|
||||||
authority = aprintf("%s%s%s:%d", ipv6_ip ? "[":"", hostname,
|
|
||||||
ipv6_ip ? "]" : "", port);
|
|
||||||
if(!authority)
|
|
||||||
return CURLE_OUT_OF_MEMORY;
|
|
||||||
|
|
||||||
/* If user is not overriding the Host header later */
|
|
||||||
if(!Curl_checkProxyheaders(data, cf->conn, STRCONST("Host"))) {
|
|
||||||
host_header = aprintf("Host: %s\r\n", authority);
|
|
||||||
if(!host_header) {
|
|
||||||
free(authority);
|
|
||||||
return CURLE_OUT_OF_MEMORY;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*pauthority = authority;
|
|
||||||
*phost_header = host_header;
|
|
||||||
return CURLE_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The Hyper version of CONNECT */
|
|
||||||
static CURLcode start_CONNECT(struct Curl_cfilter *cf,
|
|
||||||
struct Curl_easy *data,
|
|
||||||
struct h1_tunnel_state *ts)
|
|
||||||
{
|
|
||||||
struct connectdata *conn = cf->conn;
|
|
||||||
struct hyptransfer *h = &data->hyp;
|
|
||||||
curl_socket_t tunnelsocket = Curl_conn_cf_get_socket(cf, data);
|
|
||||||
hyper_io *io = NULL;
|
|
||||||
hyper_request *req = NULL;
|
|
||||||
hyper_headers *headers = NULL;
|
|
||||||
hyper_clientconn_options *options = NULL;
|
|
||||||
hyper_task *handshake = NULL;
|
|
||||||
hyper_task *task = NULL; /* for the handshake */
|
|
||||||
hyper_clientconn *client = NULL;
|
|
||||||
hyper_task *sendtask = NULL; /* for the send */
|
|
||||||
char *authority = NULL; /* for CONNECT */
|
|
||||||
char *host_header = NULL; /* Host: */
|
|
||||||
CURLcode result = CURLE_OUT_OF_MEMORY;
|
|
||||||
(void)ts;
|
|
||||||
|
|
||||||
io = hyper_io_new();
|
|
||||||
if(!io) {
|
|
||||||
failf(data, "Couldn't create hyper IO");
|
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
/* tell Hyper how to read/write network data */
|
|
||||||
h->io_ctx.data = data;
|
|
||||||
h->io_ctx.sockindex = cf->sockindex;
|
|
||||||
hyper_io_set_userdata(io, &h->io_ctx);
|
|
||||||
hyper_io_set_read(io, Curl_hyper_recv);
|
|
||||||
hyper_io_set_write(io, Curl_hyper_send);
|
|
||||||
conn->sockfd = tunnelsocket;
|
|
||||||
|
|
||||||
data->state.hconnect = TRUE;
|
|
||||||
|
|
||||||
/* create an executor to poll futures */
|
|
||||||
if(!h->exec) {
|
|
||||||
h->exec = hyper_executor_new();
|
|
||||||
if(!h->exec) {
|
|
||||||
failf(data, "Couldn't create hyper executor");
|
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
options = hyper_clientconn_options_new();
|
|
||||||
if(!options) {
|
|
||||||
failf(data, "Couldn't create hyper client options");
|
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
hyper_clientconn_options_set_preserve_header_case(options, 1);
|
|
||||||
hyper_clientconn_options_set_preserve_header_order(options, 1);
|
|
||||||
|
|
||||||
hyper_clientconn_options_exec(options, h->exec);
|
|
||||||
|
|
||||||
/* "Both the `io` and the `options` are consumed in this function
|
|
||||||
call" */
|
|
||||||
handshake = hyper_clientconn_handshake(io, options);
|
|
||||||
if(!handshake) {
|
|
||||||
failf(data, "Couldn't create hyper client handshake");
|
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
io = NULL;
|
|
||||||
options = NULL;
|
|
||||||
|
|
||||||
if(HYPERE_OK != hyper_executor_push(h->exec, handshake)) {
|
|
||||||
failf(data, "Couldn't hyper_executor_push the handshake");
|
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
handshake = NULL; /* ownership passed on */
|
|
||||||
|
|
||||||
task = hyper_executor_poll(h->exec);
|
|
||||||
if(!task) {
|
|
||||||
failf(data, "Couldn't hyper_executor_poll the handshake");
|
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
client = hyper_task_value(task);
|
|
||||||
hyper_task_free(task);
|
|
||||||
|
|
||||||
req = hyper_request_new();
|
|
||||||
if(!req) {
|
|
||||||
failf(data, "Couldn't hyper_request_new");
|
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
if(hyper_request_set_method(req, (uint8_t *)"CONNECT",
|
|
||||||
strlen("CONNECT"))) {
|
|
||||||
failf(data, "error setting method");
|
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This only happens if we have looped here due to authentication
|
|
||||||
reasons, and we do not really use the newly cloned URL here
|
|
||||||
then. Just free() it. */
|
|
||||||
Curl_safefree(data->req.newurl);
|
|
||||||
|
|
||||||
result = CONNECT_host(cf, data, &authority, &host_header);
|
|
||||||
if(result)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
infof(data, "Establish HTTP proxy tunnel to %s", authority);
|
|
||||||
|
|
||||||
if(hyper_request_set_uri(req, (uint8_t *)authority,
|
|
||||||
strlen(authority))) {
|
|
||||||
failf(data, "error setting path");
|
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
if(data->set.verbose) {
|
|
||||||
char *se = aprintf("CONNECT %s HTTP/1.1\r\n", authority);
|
|
||||||
if(!se) {
|
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
Curl_debug(data, CURLINFO_HEADER_OUT, se, strlen(se));
|
|
||||||
free(se);
|
|
||||||
}
|
|
||||||
/* Setup the proxy-authorization header, if any */
|
|
||||||
result = Curl_http_output_auth(data, conn, "CONNECT", HTTPREQ_GET,
|
|
||||||
authority, TRUE);
|
|
||||||
if(result)
|
|
||||||
goto error;
|
|
||||||
Curl_safefree(authority);
|
|
||||||
|
|
||||||
/* default is 1.1 */
|
|
||||||
if((conn->http_proxy.proxytype == CURLPROXY_HTTP_1_0) &&
|
|
||||||
(HYPERE_OK != hyper_request_set_version(req,
|
|
||||||
HYPER_HTTP_VERSION_1_0))) {
|
|
||||||
failf(data, "error setting HTTP version");
|
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
headers = hyper_request_headers(req);
|
|
||||||
if(!headers) {
|
|
||||||
failf(data, "hyper_request_headers");
|
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
if(host_header) {
|
|
||||||
result = Curl_hyper_header(data, headers, host_header);
|
|
||||||
if(result)
|
|
||||||
goto error;
|
|
||||||
Curl_safefree(host_header);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(data->state.aptr.proxyuserpwd) {
|
|
||||||
result = Curl_hyper_header(data, headers,
|
|
||||||
data->state.aptr.proxyuserpwd);
|
|
||||||
if(result)
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!Curl_checkProxyheaders(data, conn, STRCONST("User-Agent")) &&
|
|
||||||
data->set.str[STRING_USERAGENT] && *data->set.str[STRING_USERAGENT]) {
|
|
||||||
struct dynbuf ua;
|
|
||||||
Curl_dyn_init(&ua, DYN_HTTP_REQUEST);
|
|
||||||
result = Curl_dyn_addf(&ua, "User-Agent: %s\r\n",
|
|
||||||
data->set.str[STRING_USERAGENT]);
|
|
||||||
if(result)
|
|
||||||
goto error;
|
|
||||||
result = Curl_hyper_header(data, headers, Curl_dyn_ptr(&ua));
|
|
||||||
if(result)
|
|
||||||
goto error;
|
|
||||||
Curl_dyn_free(&ua);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!Curl_checkProxyheaders(data, conn, STRCONST("Proxy-Connection"))) {
|
|
||||||
result = Curl_hyper_header(data, headers,
|
|
||||||
"Proxy-Connection: Keep-Alive");
|
|
||||||
if(result)
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
result = Curl_add_custom_headers(data, TRUE, headers);
|
|
||||||
if(result)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
result = Curl_creader_set_null(data);
|
|
||||||
if(result)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
sendtask = hyper_clientconn_send(client, req);
|
|
||||||
if(!sendtask) {
|
|
||||||
failf(data, "hyper_clientconn_send");
|
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
req = NULL;
|
|
||||||
|
|
||||||
if(HYPERE_OK != hyper_executor_push(h->exec, sendtask)) {
|
|
||||||
failf(data, "Couldn't hyper_executor_push the send");
|
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
sendtask = NULL; /* ownership passed on */
|
|
||||||
|
|
||||||
hyper_clientconn_free(client);
|
|
||||||
client = NULL;
|
|
||||||
|
|
||||||
error:
|
|
||||||
free(host_header);
|
|
||||||
free(authority);
|
|
||||||
if(io)
|
|
||||||
hyper_io_free(io);
|
|
||||||
if(options)
|
|
||||||
hyper_clientconn_options_free(options);
|
|
||||||
if(handshake)
|
|
||||||
hyper_task_free(handshake);
|
|
||||||
if(client)
|
|
||||||
hyper_clientconn_free(client);
|
|
||||||
if(req)
|
|
||||||
hyper_request_free(req);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
static CURLcode send_CONNECT(struct Curl_cfilter *cf,
|
|
||||||
struct Curl_easy *data,
|
|
||||||
struct h1_tunnel_state *ts,
|
|
||||||
bool *done)
|
|
||||||
{
|
|
||||||
struct hyptransfer *h = &data->hyp;
|
|
||||||
struct connectdata *conn = cf->conn;
|
|
||||||
hyper_task *task = NULL;
|
|
||||||
hyper_error *hypererr = NULL;
|
|
||||||
CURLcode result = CURLE_OK;
|
|
||||||
|
|
||||||
(void)ts;
|
|
||||||
(void)conn;
|
|
||||||
do {
|
|
||||||
task = hyper_executor_poll(h->exec);
|
|
||||||
if(task) {
|
|
||||||
bool error = hyper_task_type(task) == HYPER_TASK_ERROR;
|
|
||||||
if(error)
|
|
||||||
hypererr = hyper_task_value(task);
|
|
||||||
hyper_task_free(task);
|
|
||||||
if(error) {
|
|
||||||
/* this could probably use a better error code? */
|
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} while(task);
|
|
||||||
error:
|
|
||||||
*done = (result == CURLE_OK);
|
|
||||||
if(hypererr) {
|
|
||||||
uint8_t errbuf[256];
|
|
||||||
size_t errlen = hyper_error_print(hypererr, errbuf, sizeof(errbuf));
|
|
||||||
failf(data, "Hyper: %.*s", (int)errlen, errbuf);
|
|
||||||
hyper_error_free(hypererr);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
static CURLcode recv_CONNECT_resp(struct Curl_cfilter *cf,
|
|
||||||
struct Curl_easy *data,
|
|
||||||
struct h1_tunnel_state *ts,
|
|
||||||
bool *done)
|
|
||||||
{
|
|
||||||
struct hyptransfer *h = &data->hyp;
|
|
||||||
CURLcode result;
|
|
||||||
int didwhat;
|
|
||||||
|
|
||||||
(void)ts;
|
|
||||||
result = Curl_hyper_stream(data, cf->conn, &didwhat,
|
|
||||||
CURL_CSELECT_IN | CURL_CSELECT_OUT);
|
|
||||||
*done = data->req.done;
|
|
||||||
if(result || !*done)
|
|
||||||
return result;
|
|
||||||
if(h->exec) {
|
|
||||||
hyper_executor_free(h->exec);
|
|
||||||
h->exec = NULL;
|
|
||||||
}
|
|
||||||
if(h->read_waker) {
|
|
||||||
hyper_waker_free(h->read_waker);
|
|
||||||
h->read_waker = NULL;
|
|
||||||
}
|
|
||||||
if(h->write_waker) {
|
|
||||||
hyper_waker_free(h->write_waker);
|
|
||||||
h->write_waker = NULL;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* USE_HYPER */
|
|
||||||
|
|
||||||
static CURLcode H1_CONNECT(struct Curl_cfilter *cf,
|
static CURLcode H1_CONNECT(struct Curl_cfilter *cf,
|
||||||
struct Curl_easy *data,
|
struct Curl_easy *data,
|
||||||
struct h1_tunnel_state *ts)
|
struct h1_tunnel_state *ts)
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include "curl_setup.h"
|
#include "curl_setup.h"
|
||||||
|
|
||||||
#if !defined(CURL_DISABLE_HTTP) && !defined(USE_HYPER)
|
#if !defined(CURL_DISABLE_HTTP)
|
||||||
|
|
||||||
#include "urldata.h"
|
#include "urldata.h"
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
@ -617,4 +617,4 @@ out:
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !defined(CURL_DISABLE_HTTP) && !defined(USE_HYPER) */
|
#endif /* !defined(CURL_DISABLE_HTTP) */
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include "curl_setup.h"
|
#include "curl_setup.h"
|
||||||
|
|
||||||
#if !defined(CURL_DISABLE_HTTP) && !defined(USE_HYPER)
|
#if !defined(CURL_DISABLE_HTTP)
|
||||||
|
|
||||||
struct Curl_cfilter;
|
struct Curl_cfilter;
|
||||||
struct Curl_easy;
|
struct Curl_easy;
|
||||||
@ -54,5 +54,5 @@ CURLcode Curl_cf_https_setup(struct Curl_easy *data,
|
|||||||
const struct Curl_dns_entry *remotehost);
|
const struct Curl_dns_entry *remotehost);
|
||||||
|
|
||||||
|
|
||||||
#endif /* !defined(CURL_DISABLE_HTTP) && !defined(USE_HYPER) */
|
#endif /* !defined(CURL_DISABLE_HTTP) */
|
||||||
#endif /* HEADER_CURL_CF_HTTP_H */
|
#endif /* HEADER_CURL_CF_HTTP_H */
|
||||||
|
|||||||
@ -1485,7 +1485,7 @@ CURLcode Curl_conn_setup(struct Curl_easy *data,
|
|||||||
DEBUGASSERT(data);
|
DEBUGASSERT(data);
|
||||||
DEBUGASSERT(conn->handler);
|
DEBUGASSERT(conn->handler);
|
||||||
|
|
||||||
#if !defined(CURL_DISABLE_HTTP) && !defined(USE_HYPER)
|
#if !defined(CURL_DISABLE_HTTP)
|
||||||
if(!conn->cfilter[sockindex] &&
|
if(!conn->cfilter[sockindex] &&
|
||||||
conn->handler->protocol == CURLPROTO_HTTPS) {
|
conn->handler->protocol == CURLPROTO_HTTPS) {
|
||||||
DEBUGASSERT(ssl_mode != CURL_CF_SSL_DISABLE);
|
DEBUGASSERT(ssl_mode != CURL_CF_SSL_DISABLE);
|
||||||
@ -1493,7 +1493,7 @@ CURLcode Curl_conn_setup(struct Curl_easy *data,
|
|||||||
if(result)
|
if(result)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
#endif /* !defined(CURL_DISABLE_HTTP) && !defined(USE_HYPER) */
|
#endif /* !defined(CURL_DISABLE_HTTP) */
|
||||||
|
|
||||||
/* Still no cfilter set, apply default. */
|
/* Still no cfilter set, apply default. */
|
||||||
if(!conn->cfilter[sockindex]) {
|
if(!conn->cfilter[sockindex]) {
|
||||||
|
|||||||
@ -939,7 +939,6 @@ int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf,
|
|||||||
#define UNITTEST static
|
#define UNITTEST static
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Hyper supports HTTP2 also, but Curl's integration with Hyper does not */
|
|
||||||
#if defined(USE_NGHTTP2)
|
#if defined(USE_NGHTTP2)
|
||||||
#define USE_HTTP2
|
#define USE_HTTP2
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -319,7 +319,7 @@ static struct trc_cft_def trc_cfts[] = {
|
|||||||
#ifdef USE_HTTP3
|
#ifdef USE_HTTP3
|
||||||
{ &Curl_cft_http3, TRC_CT_PROTOCOL },
|
{ &Curl_cft_http3, TRC_CT_PROTOCOL },
|
||||||
#endif
|
#endif
|
||||||
#if !defined(CURL_DISABLE_HTTP) && !defined(USE_HYPER)
|
#if !defined(CURL_DISABLE_HTTP)
|
||||||
{ &Curl_cft_http_connect, TRC_CT_PROTOCOL },
|
{ &Curl_cft_http_connect, TRC_CT_PROTOCOL },
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|||||||
131
lib/http.c
131
lib/http.c
@ -47,10 +47,6 @@
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_HYPER
|
|
||||||
#include <hyper.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "urldata.h"
|
#include "urldata.h"
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#include "transfer.h"
|
#include "transfer.h"
|
||||||
@ -88,7 +84,6 @@
|
|||||||
#include "altsvc.h"
|
#include "altsvc.h"
|
||||||
#include "hsts.h"
|
#include "hsts.h"
|
||||||
#include "ws.h"
|
#include "ws.h"
|
||||||
#include "c-hyper.h"
|
|
||||||
#include "curl_ctype.h"
|
#include "curl_ctype.h"
|
||||||
|
|
||||||
/* The last 3 #include files should be in this order */
|
/* The last 3 #include files should be in this order */
|
||||||
@ -104,6 +99,31 @@ static bool http_should_fail(struct Curl_easy *data, int httpcode);
|
|||||||
static bool http_exp100_is_waiting(struct Curl_easy *data);
|
static bool http_exp100_is_waiting(struct Curl_easy *data);
|
||||||
static CURLcode http_exp100_add_reader(struct Curl_easy *data);
|
static CURLcode http_exp100_add_reader(struct Curl_easy *data);
|
||||||
static void http_exp100_send_anyway(struct Curl_easy *data);
|
static void http_exp100_send_anyway(struct Curl_easy *data);
|
||||||
|
static bool http_exp100_is_selected(struct Curl_easy *data);
|
||||||
|
static void http_exp100_got100(struct Curl_easy *data);
|
||||||
|
static CURLcode http_firstwrite(struct Curl_easy *data);
|
||||||
|
static CURLcode http_header(struct Curl_easy *data,
|
||||||
|
const char *hd, size_t hdlen);
|
||||||
|
static CURLcode http_host(struct Curl_easy *data, struct connectdata *conn);
|
||||||
|
static CURLcode http_range(struct Curl_easy *data,
|
||||||
|
Curl_HttpReq httpreq);
|
||||||
|
static CURLcode http_req_complete(struct Curl_easy *data,
|
||||||
|
struct dynbuf *r, Curl_HttpReq httpreq);
|
||||||
|
static CURLcode http_req_set_reader(struct Curl_easy *data,
|
||||||
|
Curl_HttpReq httpreq,
|
||||||
|
const char **tep);
|
||||||
|
static CURLcode http_size(struct Curl_easy *data);
|
||||||
|
static CURLcode http_statusline(struct Curl_easy *data,
|
||||||
|
struct connectdata *conn);
|
||||||
|
static CURLcode http_target(struct Curl_easy *data, struct connectdata *conn,
|
||||||
|
struct dynbuf *req);
|
||||||
|
static CURLcode http_useragent(struct Curl_easy *data);
|
||||||
|
#ifdef HAVE_LIBZ
|
||||||
|
static CURLcode http_transferencode(struct Curl_easy *data);
|
||||||
|
#endif
|
||||||
|
static bool use_http_1_1plus(const struct Curl_easy *data,
|
||||||
|
const struct connectdata *conn);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* HTTP handler interface.
|
* HTTP handler interface.
|
||||||
@ -1169,7 +1189,6 @@ CURLcode Curl_http_done(struct Curl_easy *data,
|
|||||||
data->state.authproxy.multipass = FALSE;
|
data->state.authproxy.multipass = FALSE;
|
||||||
|
|
||||||
Curl_dyn_reset(&data->state.headerb);
|
Curl_dyn_reset(&data->state.headerb);
|
||||||
Curl_hyper_done(data);
|
|
||||||
|
|
||||||
if(status)
|
if(status)
|
||||||
return status;
|
return status;
|
||||||
@ -1202,7 +1221,7 @@ CURLcode Curl_http_done(struct Curl_easy *data,
|
|||||||
* - if any server previously contacted to handle this request only supports
|
* - if any server previously contacted to handle this request only supports
|
||||||
* 1.0.
|
* 1.0.
|
||||||
*/
|
*/
|
||||||
bool Curl_use_http_1_1plus(const struct Curl_easy *data,
|
static bool use_http_1_1plus(const struct Curl_easy *data,
|
||||||
const struct connectdata *conn)
|
const struct connectdata *conn)
|
||||||
{
|
{
|
||||||
if((data->state.httpversion == 10) || (conn->httpversion == 10))
|
if((data->state.httpversion == 10) || (conn->httpversion == 10))
|
||||||
@ -1214,7 +1233,6 @@ bool Curl_use_http_1_1plus(const struct Curl_easy *data,
|
|||||||
(data->state.httpwant >= CURL_HTTP_VERSION_1_1));
|
(data->state.httpwant >= CURL_HTTP_VERSION_1_1));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef USE_HYPER
|
|
||||||
static const char *get_http_string(const struct Curl_easy *data,
|
static const char *get_http_string(const struct Curl_easy *data,
|
||||||
const struct connectdata *conn)
|
const struct connectdata *conn)
|
||||||
{
|
{
|
||||||
@ -1222,21 +1240,15 @@ static const char *get_http_string(const struct Curl_easy *data,
|
|||||||
return "3";
|
return "3";
|
||||||
if(Curl_conn_is_http2(data, conn, FIRSTSOCKET))
|
if(Curl_conn_is_http2(data, conn, FIRSTSOCKET))
|
||||||
return "2";
|
return "2";
|
||||||
if(Curl_use_http_1_1plus(data, conn))
|
if(use_http_1_1plus(data, conn))
|
||||||
return "1.1";
|
return "1.1";
|
||||||
|
|
||||||
return "1.0";
|
return "1.0";
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
CURLcode Curl_add_custom_headers(struct Curl_easy *data,
|
CURLcode Curl_add_custom_headers(struct Curl_easy *data,
|
||||||
bool is_connect,
|
bool is_connect,
|
||||||
#ifndef USE_HYPER
|
struct dynbuf *req)
|
||||||
struct dynbuf *req
|
|
||||||
#else
|
|
||||||
void *req
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
struct connectdata *conn = data->conn;
|
struct connectdata *conn = data->conn;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
@ -1303,9 +1315,7 @@ CURLcode Curl_add_custom_headers(struct Curl_easy *data,
|
|||||||
/* copy the source */
|
/* copy the source */
|
||||||
semicolonp = strdup(headers->data);
|
semicolonp = strdup(headers->data);
|
||||||
if(!semicolonp) {
|
if(!semicolonp) {
|
||||||
#ifndef USE_HYPER
|
|
||||||
Curl_dyn_free(req);
|
Curl_dyn_free(req);
|
||||||
#endif
|
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
/* put a colon where the semicolon is */
|
/* put a colon where the semicolon is */
|
||||||
@ -1364,11 +1374,7 @@ CURLcode Curl_add_custom_headers(struct Curl_easy *data,
|
|||||||
!Curl_auth_allowed_to_host(data))
|
!Curl_auth_allowed_to_host(data))
|
||||||
;
|
;
|
||||||
else {
|
else {
|
||||||
#ifdef USE_HYPER
|
|
||||||
result = Curl_hyper_header(data, req, compare);
|
|
||||||
#else
|
|
||||||
result = Curl_dyn_addf(req, "%s\r\n", compare);
|
result = Curl_dyn_addf(req, "%s\r\n", compare);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
if(semicolonp)
|
if(semicolonp)
|
||||||
free(semicolonp);
|
free(semicolonp);
|
||||||
@ -1385,12 +1391,7 @@ CURLcode Curl_add_custom_headers(struct Curl_easy *data,
|
|||||||
|
|
||||||
#ifndef CURL_DISABLE_PARSEDATE
|
#ifndef CURL_DISABLE_PARSEDATE
|
||||||
CURLcode Curl_add_timecondition(struct Curl_easy *data,
|
CURLcode Curl_add_timecondition(struct Curl_easy *data,
|
||||||
#ifndef USE_HYPER
|
struct dynbuf *req)
|
||||||
struct dynbuf *req
|
|
||||||
#else
|
|
||||||
void *req
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
const struct tm *tm;
|
const struct tm *tm;
|
||||||
struct tm keeptime;
|
struct tm keeptime;
|
||||||
@ -1453,12 +1454,7 @@ CURLcode Curl_add_timecondition(struct Curl_easy *data,
|
|||||||
tm->tm_min,
|
tm->tm_min,
|
||||||
tm->tm_sec);
|
tm->tm_sec);
|
||||||
|
|
||||||
#ifndef USE_HYPER
|
|
||||||
result = Curl_dyn_add(req, datestr);
|
result = Curl_dyn_add(req, datestr);
|
||||||
#else
|
|
||||||
result = Curl_hyper_header(data, req, datestr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -1512,7 +1508,7 @@ void Curl_http_method(struct Curl_easy *data, struct connectdata *conn,
|
|||||||
*reqp = httpreq;
|
*reqp = httpreq;
|
||||||
}
|
}
|
||||||
|
|
||||||
CURLcode Curl_http_useragent(struct Curl_easy *data)
|
static CURLcode http_useragent(struct Curl_easy *data)
|
||||||
{
|
{
|
||||||
/* The User-Agent string might have been allocated in url.c already, because
|
/* The User-Agent string might have been allocated in url.c already, because
|
||||||
it might have been used in the proxy connect, but if we have got a header
|
it might have been used in the proxy connect, but if we have got a header
|
||||||
@ -1526,7 +1522,7 @@ CURLcode Curl_http_useragent(struct Curl_easy *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CURLcode Curl_http_host(struct Curl_easy *data, struct connectdata *conn)
|
static CURLcode http_host(struct Curl_easy *data, struct connectdata *conn)
|
||||||
{
|
{
|
||||||
const char *ptr;
|
const char *ptr;
|
||||||
struct dynamically_allocated_data *aptr = &data->state.aptr;
|
struct dynamically_allocated_data *aptr = &data->state.aptr;
|
||||||
@ -1616,7 +1612,7 @@ CURLcode Curl_http_host(struct Curl_easy *data, struct connectdata *conn)
|
|||||||
/*
|
/*
|
||||||
* Append the request-target to the HTTP request
|
* Append the request-target to the HTTP request
|
||||||
*/
|
*/
|
||||||
CURLcode Curl_http_target(struct Curl_easy *data,
|
static CURLcode http_target(struct Curl_easy *data,
|
||||||
struct connectdata *conn,
|
struct connectdata *conn,
|
||||||
struct dynbuf *r)
|
struct dynbuf *r)
|
||||||
{
|
{
|
||||||
@ -1898,7 +1894,7 @@ static CURLcode http_resume(struct Curl_easy *data, Curl_HttpReq httpreq)
|
|||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
CURLcode Curl_http_req_set_reader(struct Curl_easy *data,
|
static CURLcode http_req_set_reader(struct Curl_easy *data,
|
||||||
Curl_HttpReq httpreq,
|
Curl_HttpReq httpreq,
|
||||||
const char **tep)
|
const char **tep)
|
||||||
{
|
{
|
||||||
@ -1920,7 +1916,7 @@ CURLcode Curl_http_req_set_reader(struct Curl_easy *data,
|
|||||||
Curl_compareheader(ptr,
|
Curl_compareheader(ptr,
|
||||||
STRCONST("Transfer-Encoding:"), STRCONST("chunked"));
|
STRCONST("Transfer-Encoding:"), STRCONST("chunked"));
|
||||||
if(data->req.upload_chunky &&
|
if(data->req.upload_chunky &&
|
||||||
Curl_use_http_1_1plus(data, data->conn) &&
|
use_http_1_1plus(data, data->conn) &&
|
||||||
(data->conn->httpversion >= 20)) {
|
(data->conn->httpversion >= 20)) {
|
||||||
infof(data, "suppressing chunked transfer encoding on connection "
|
infof(data, "suppressing chunked transfer encoding on connection "
|
||||||
"using HTTP version 2 or higher");
|
"using HTTP version 2 or higher");
|
||||||
@ -1932,7 +1928,7 @@ CURLcode Curl_http_req_set_reader(struct Curl_easy *data,
|
|||||||
|
|
||||||
if(req_clen < 0) {
|
if(req_clen < 0) {
|
||||||
/* indeterminate request content length */
|
/* indeterminate request content length */
|
||||||
if(Curl_use_http_1_1plus(data, data->conn)) {
|
if(use_http_1_1plus(data, data->conn)) {
|
||||||
/* On HTTP/1.1, enable chunked, on HTTP/2 and later we do not
|
/* On HTTP/1.1, enable chunked, on HTTP/2 and later we do not
|
||||||
* need it */
|
* need it */
|
||||||
data->req.upload_chunky = (data->conn->httpversion < 20);
|
data->req.upload_chunky = (data->conn->httpversion < 20);
|
||||||
@ -1974,7 +1970,7 @@ static CURLcode addexpect(struct Curl_easy *data, struct dynbuf *r,
|
|||||||
Curl_compareheader(ptr, STRCONST("Expect:"), STRCONST("100-continue"));
|
Curl_compareheader(ptr, STRCONST("Expect:"), STRCONST("100-continue"));
|
||||||
}
|
}
|
||||||
else if(!data->state.disableexpect &&
|
else if(!data->state.disableexpect &&
|
||||||
Curl_use_http_1_1plus(data, data->conn) &&
|
use_http_1_1plus(data, data->conn) &&
|
||||||
(data->conn->httpversion < 20)) {
|
(data->conn->httpversion < 20)) {
|
||||||
/* if not doing HTTP 1.0 or version 2, or disabled explicitly, we add an
|
/* if not doing HTTP 1.0 or version 2, or disabled explicitly, we add an
|
||||||
Expect: 100-continue to the headers which actually speeds up post
|
Expect: 100-continue to the headers which actually speeds up post
|
||||||
@ -1990,7 +1986,7 @@ static CURLcode addexpect(struct Curl_easy *data, struct dynbuf *r,
|
|||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
CURLcode Curl_http_req_complete(struct Curl_easy *data,
|
static CURLcode http_req_complete(struct Curl_easy *data,
|
||||||
struct dynbuf *r, Curl_HttpReq httpreq)
|
struct dynbuf *r, Curl_HttpReq httpreq)
|
||||||
{
|
{
|
||||||
CURLcode result = CURLE_OK;
|
CURLcode result = CURLE_OK;
|
||||||
@ -1998,13 +1994,11 @@ CURLcode Curl_http_req_complete(struct Curl_easy *data,
|
|||||||
bool announced_exp100 = FALSE;
|
bool announced_exp100 = FALSE;
|
||||||
|
|
||||||
DEBUGASSERT(data->conn);
|
DEBUGASSERT(data->conn);
|
||||||
#ifndef USE_HYPER
|
|
||||||
if(data->req.upload_chunky) {
|
if(data->req.upload_chunky) {
|
||||||
result = Curl_httpchunk_add_reader(data);
|
result = Curl_httpchunk_add_reader(data);
|
||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Get the request body length that has been set up */
|
/* Get the request body length that has been set up */
|
||||||
req_clen = Curl_creader_total_length(data);
|
req_clen = Curl_creader_total_length(data);
|
||||||
@ -2079,7 +2073,7 @@ out:
|
|||||||
|
|
||||||
#if !defined(CURL_DISABLE_COOKIES)
|
#if !defined(CURL_DISABLE_COOKIES)
|
||||||
|
|
||||||
CURLcode Curl_http_cookies(struct Curl_easy *data,
|
static CURLcode http_cookies(struct Curl_easy *data,
|
||||||
struct connectdata *conn,
|
struct connectdata *conn,
|
||||||
struct dynbuf *r)
|
struct dynbuf *r)
|
||||||
{
|
{
|
||||||
@ -2157,7 +2151,7 @@ CURLcode Curl_http_cookies(struct Curl_easy *data,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CURLcode Curl_http_range(struct Curl_easy *data,
|
static CURLcode http_range(struct Curl_easy *data,
|
||||||
Curl_HttpReq httpreq)
|
Curl_HttpReq httpreq)
|
||||||
{
|
{
|
||||||
if(data->state.use_range) {
|
if(data->state.use_range) {
|
||||||
@ -2214,7 +2208,7 @@ CURLcode Curl_http_range(struct Curl_easy *data,
|
|||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
CURLcode Curl_http_firstwrite(struct Curl_easy *data)
|
static CURLcode http_firstwrite(struct Curl_easy *data)
|
||||||
{
|
{
|
||||||
struct connectdata *conn = data->conn;
|
struct connectdata *conn = data->conn;
|
||||||
struct SingleRequest *k = &data->req;
|
struct SingleRequest *k = &data->req;
|
||||||
@ -2277,7 +2271,7 @@ CURLcode Curl_http_firstwrite(struct Curl_easy *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_LIBZ
|
||||||
CURLcode Curl_transferencode(struct Curl_easy *data)
|
static CURLcode http_transferencode(struct Curl_easy *data)
|
||||||
{
|
{
|
||||||
if(!Curl_checkheaders(data, STRCONST("TE")) &&
|
if(!Curl_checkheaders(data, STRCONST("TE")) &&
|
||||||
data->set.http_transfer_encoding) {
|
data->set.http_transfer_encoding) {
|
||||||
@ -2309,7 +2303,6 @@ CURLcode Curl_transferencode(struct Curl_easy *data)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef USE_HYPER
|
|
||||||
/*
|
/*
|
||||||
* Curl_http() gets called from the generic multi_do() function when an HTTP
|
* Curl_http() gets called from the generic multi_do() function when an HTTP
|
||||||
* request is to be performed. This creates and sends a properly constructed
|
* request is to be performed. This creates and sends a properly constructed
|
||||||
@ -2370,11 +2363,11 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
|
|||||||
if(result)
|
if(result)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
result = Curl_http_host(data, conn);
|
result = http_host(data, conn);
|
||||||
if(result)
|
if(result)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
result = Curl_http_useragent(data);
|
result = http_useragent(data);
|
||||||
if(result)
|
if(result)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
@ -2415,19 +2408,19 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
|
|||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_LIBZ
|
||||||
/* we only consider transfer-encoding magic if libz support is built-in */
|
/* we only consider transfer-encoding magic if libz support is built-in */
|
||||||
result = Curl_transferencode(data);
|
result = http_transferencode(data);
|
||||||
if(result)
|
if(result)
|
||||||
goto fail;
|
goto fail;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
result = Curl_http_req_set_reader(data, httpreq, &te);
|
result = http_req_set_reader(data, httpreq, &te);
|
||||||
if(result)
|
if(result)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
p_accept = Curl_checkheaders(data,
|
p_accept = Curl_checkheaders(data,
|
||||||
STRCONST("Accept")) ? NULL : "Accept: */*\r\n";
|
STRCONST("Accept")) ? NULL : "Accept: */*\r\n";
|
||||||
|
|
||||||
result = Curl_http_range(data, httpreq);
|
result = http_range(data, httpreq);
|
||||||
if(result)
|
if(result)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
@ -2444,7 +2437,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
|
|||||||
/* GET/HEAD/POST/PUT */
|
/* GET/HEAD/POST/PUT */
|
||||||
result = Curl_dyn_addf(&req, "%s ", request);
|
result = Curl_dyn_addf(&req, "%s ", request);
|
||||||
if(!result)
|
if(!result)
|
||||||
result = Curl_http_target(data, conn, &req);
|
result = http_target(data, conn, &req);
|
||||||
if(result) {
|
if(result) {
|
||||||
Curl_dyn_free(&req);
|
Curl_dyn_free(&req);
|
||||||
goto fail;
|
goto fail;
|
||||||
@ -2538,7 +2531,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result = Curl_http_cookies(data, conn, &req);
|
result = http_cookies(data, conn, &req);
|
||||||
#ifndef CURL_DISABLE_WEBSOCKETS
|
#ifndef CURL_DISABLE_WEBSOCKETS
|
||||||
if(!result && conn->handler->protocol&(CURLPROTO_WS|CURLPROTO_WSS))
|
if(!result && conn->handler->protocol&(CURLPROTO_WS|CURLPROTO_WSS))
|
||||||
result = Curl_ws_request(data, &req);
|
result = Curl_ws_request(data, &req);
|
||||||
@ -2550,7 +2543,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
|
|||||||
|
|
||||||
if(!result) {
|
if(!result) {
|
||||||
/* req_send takes ownership of the 'req' memory on success */
|
/* req_send takes ownership of the 'req' memory on success */
|
||||||
result = Curl_http_req_complete(data, &req, httpreq);
|
result = http_req_complete(data, &req, httpreq);
|
||||||
if(!result)
|
if(!result)
|
||||||
result = Curl_req_send(data, &req);
|
result = Curl_req_send(data, &req);
|
||||||
}
|
}
|
||||||
@ -2569,8 +2562,6 @@ fail:
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* USE_HYPER */
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
STATUS_UNKNOWN, /* not enough data to tell yet */
|
STATUS_UNKNOWN, /* not enough data to tell yet */
|
||||||
STATUS_DONE, /* a status line was read */
|
STATUS_DONE, /* a status line was read */
|
||||||
@ -2657,9 +2648,9 @@ checkprotoprefix(struct Curl_easy *data, struct connectdata *conn,
|
|||||||
Curl_compareheader(hd, STRCONST(n), STRCONST(v)))
|
Curl_compareheader(hd, STRCONST(n), STRCONST(v)))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Curl_http_header() parses a single response header.
|
* http_header() parses a single response header.
|
||||||
*/
|
*/
|
||||||
CURLcode Curl_http_header(struct Curl_easy *data,
|
static CURLcode http_header(struct Curl_easy *data,
|
||||||
const char *hd, size_t hdlen)
|
const char *hd, size_t hdlen)
|
||||||
{
|
{
|
||||||
struct connectdata *conn = data->conn;
|
struct connectdata *conn = data->conn;
|
||||||
@ -3022,7 +3013,7 @@ CURLcode Curl_http_header(struct Curl_easy *data,
|
|||||||
* Called after the first HTTP response line (the status line) has been
|
* Called after the first HTTP response line (the status line) has been
|
||||||
* received and parsed.
|
* received and parsed.
|
||||||
*/
|
*/
|
||||||
CURLcode Curl_http_statusline(struct Curl_easy *data,
|
static CURLcode http_statusline(struct Curl_easy *data,
|
||||||
struct connectdata *conn)
|
struct connectdata *conn)
|
||||||
{
|
{
|
||||||
struct SingleRequest *k = &data->req;
|
struct SingleRequest *k = &data->req;
|
||||||
@ -3116,7 +3107,7 @@ CURLcode Curl_http_statusline(struct Curl_easy *data,
|
|||||||
figured out here after all headers have been received but before the final
|
figured out here after all headers have been received but before the final
|
||||||
call to the user's header callback, so that a valid content length can be
|
call to the user's header callback, so that a valid content length can be
|
||||||
retrieved by the user in the final call. */
|
retrieved by the user in the final call. */
|
||||||
CURLcode Curl_http_size(struct Curl_easy *data)
|
static CURLcode http_size(struct Curl_easy *data)
|
||||||
{
|
{
|
||||||
struct SingleRequest *k = &data->req;
|
struct SingleRequest *k = &data->req;
|
||||||
if(data->req.ignore_cl || k->chunk) {
|
if(data->req.ignore_cl || k->chunk) {
|
||||||
@ -3264,7 +3255,7 @@ static CURLcode http_on_response(struct Curl_easy *data,
|
|||||||
* that tells us that the server is OK with this and ready
|
* that tells us that the server is OK with this and ready
|
||||||
* to receive the data.
|
* to receive the data.
|
||||||
*/
|
*/
|
||||||
Curl_http_exp100_got100(data);
|
http_exp100_got100(data);
|
||||||
break;
|
break;
|
||||||
case 101:
|
case 101:
|
||||||
/* Switching Protocols only allowed from HTTP/1.1 */
|
/* Switching Protocols only allowed from HTTP/1.1 */
|
||||||
@ -3423,7 +3414,7 @@ static CURLcode http_on_response(struct Curl_easy *data,
|
|||||||
* connection for closure after we have read the entire response.
|
* connection for closure after we have read the entire response.
|
||||||
*/
|
*/
|
||||||
if(!Curl_req_done_sending(data)) {
|
if(!Curl_req_done_sending(data)) {
|
||||||
if((k->httpcode == 417) && Curl_http_exp100_is_selected(data)) {
|
if((k->httpcode == 417) && http_exp100_is_selected(data)) {
|
||||||
/* 417 Expectation Failed - try again without the Expect
|
/* 417 Expectation Failed - try again without the Expect
|
||||||
header */
|
header */
|
||||||
if(!k->writebytecount && http_exp100_is_waiting(data)) {
|
if(!k->writebytecount && http_exp100_is_waiting(data)) {
|
||||||
@ -3486,13 +3477,13 @@ static CURLcode http_on_response(struct Curl_easy *data,
|
|||||||
k->download_done = TRUE;
|
k->download_done = TRUE;
|
||||||
|
|
||||||
/* final response without error, prepare to receive the body */
|
/* final response without error, prepare to receive the body */
|
||||||
result = Curl_http_firstwrite(data);
|
result = http_firstwrite(data);
|
||||||
|
|
||||||
if(!result)
|
if(!result)
|
||||||
/* This is the last response that we get for the current request.
|
/* This is the last response that we get for the current request.
|
||||||
* Check on the body size and determine if the response is complete.
|
* Check on the body size and determine if the response is complete.
|
||||||
*/
|
*/
|
||||||
result = Curl_http_size(data);
|
result = http_size(data);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if(last_hd) {
|
if(last_hd) {
|
||||||
@ -3645,7 +3636,7 @@ static CURLcode http_rw_hd(struct Curl_easy *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(fine_statusline) {
|
if(fine_statusline) {
|
||||||
result = Curl_http_statusline(data, data->conn);
|
result = http_statusline(data, data->conn);
|
||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
writetype |= CLIENTWRITE_STATUS;
|
writetype |= CLIENTWRITE_STATUS;
|
||||||
@ -3660,7 +3651,7 @@ static CURLcode http_rw_hd(struct Curl_easy *data,
|
|||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
result = Curl_http_header(data, hd, hdlen);
|
result = http_header(data, hd, hdlen);
|
||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
@ -4359,7 +4350,7 @@ static CURLcode http_exp100_add_reader(struct Curl_easy *data)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Curl_http_exp100_got100(struct Curl_easy *data)
|
static void http_exp100_got100(struct Curl_easy *data)
|
||||||
{
|
{
|
||||||
struct Curl_creader *r = Curl_creader_get_by_type(data, &cr_exp100);
|
struct Curl_creader *r = Curl_creader_get_by_type(data, &cr_exp100);
|
||||||
if(r)
|
if(r)
|
||||||
@ -4383,7 +4374,7 @@ static void http_exp100_send_anyway(struct Curl_easy *data)
|
|||||||
http_exp100_continue(data, r);
|
http_exp100_continue(data, r);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Curl_http_exp100_is_selected(struct Curl_easy *data)
|
static bool http_exp100_is_selected(struct Curl_easy *data)
|
||||||
{
|
{
|
||||||
struct Curl_creader *r = Curl_creader_get_by_type(data, &cr_exp100);
|
struct Curl_creader *r = Curl_creader_get_by_type(data, &cr_exp100);
|
||||||
return !!r;
|
return !!r;
|
||||||
|
|||||||
43
lib/http.h
43
lib/http.h
@ -74,40 +74,14 @@ char *Curl_checkProxyheaders(struct Curl_easy *data,
|
|||||||
const char *thisheader,
|
const char *thisheader,
|
||||||
const size_t thislen);
|
const size_t thislen);
|
||||||
|
|
||||||
CURLcode Curl_add_timecondition(struct Curl_easy *data,
|
CURLcode Curl_add_timecondition(struct Curl_easy *data, struct dynbuf *req);
|
||||||
#ifndef USE_HYPER
|
CURLcode Curl_add_custom_headers(struct Curl_easy *data, bool is_connect,
|
||||||
struct dynbuf *req
|
struct dynbuf *req);
|
||||||
#else
|
CURLcode Curl_dynhds_add_custom(struct Curl_easy *data, bool is_connect,
|
||||||
void *headers
|
struct dynhds *hds);
|
||||||
#endif
|
|
||||||
);
|
|
||||||
CURLcode Curl_add_custom_headers(struct Curl_easy *data,
|
|
||||||
bool is_connect,
|
|
||||||
#ifndef USE_HYPER
|
|
||||||
struct dynbuf *req
|
|
||||||
#else
|
|
||||||
void *headers
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
void Curl_http_method(struct Curl_easy *data, struct connectdata *conn,
|
void Curl_http_method(struct Curl_easy *data, struct connectdata *conn,
|
||||||
const char **method, Curl_HttpReq *);
|
const char **method, Curl_HttpReq *);
|
||||||
CURLcode Curl_http_useragent(struct Curl_easy *data);
|
|
||||||
CURLcode Curl_http_host(struct Curl_easy *data, struct connectdata *conn);
|
|
||||||
CURLcode Curl_http_target(struct Curl_easy *data, struct connectdata *conn,
|
|
||||||
struct dynbuf *req);
|
|
||||||
CURLcode Curl_http_statusline(struct Curl_easy *data,
|
|
||||||
struct connectdata *conn);
|
|
||||||
CURLcode Curl_http_header(struct Curl_easy *data,
|
|
||||||
const char *hd, size_t hdlen);
|
|
||||||
CURLcode Curl_transferencode(struct Curl_easy *data);
|
|
||||||
CURLcode Curl_http_req_set_reader(struct Curl_easy *data,
|
|
||||||
Curl_HttpReq httpreq,
|
|
||||||
const char **tep);
|
|
||||||
CURLcode Curl_http_req_complete(struct Curl_easy *data,
|
|
||||||
struct dynbuf *r, Curl_HttpReq httpreq);
|
|
||||||
bool Curl_use_http_1_1plus(const struct Curl_easy *data,
|
|
||||||
const struct connectdata *conn);
|
|
||||||
#ifndef CURL_DISABLE_COOKIES
|
#ifndef CURL_DISABLE_COOKIES
|
||||||
CURLcode Curl_http_cookies(struct Curl_easy *data,
|
CURLcode Curl_http_cookies(struct Curl_easy *data,
|
||||||
struct connectdata *conn,
|
struct connectdata *conn,
|
||||||
@ -115,9 +89,6 @@ CURLcode Curl_http_cookies(struct Curl_easy *data,
|
|||||||
#else
|
#else
|
||||||
#define Curl_http_cookies(a,b,c) CURLE_OK
|
#define Curl_http_cookies(a,b,c) CURLE_OK
|
||||||
#endif
|
#endif
|
||||||
CURLcode Curl_http_range(struct Curl_easy *data,
|
|
||||||
Curl_HttpReq httpreq);
|
|
||||||
CURLcode Curl_http_firstwrite(struct Curl_easy *data);
|
|
||||||
|
|
||||||
/* protocol-specific functions set up to be called by the main engine */
|
/* protocol-specific functions set up to be called by the main engine */
|
||||||
CURLcode Curl_http_setup_conn(struct Curl_easy *data,
|
CURLcode Curl_http_setup_conn(struct Curl_easy *data,
|
||||||
@ -175,8 +146,6 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data);
|
|||||||
version. This count includes CONNECT response headers. */
|
version. This count includes CONNECT response headers. */
|
||||||
#define MAX_HTTP_RESP_HEADER_SIZE (300*1024)
|
#define MAX_HTTP_RESP_HEADER_SIZE (300*1024)
|
||||||
|
|
||||||
bool Curl_http_exp100_is_selected(struct Curl_easy *data);
|
|
||||||
void Curl_http_exp100_got100(struct Curl_easy *data);
|
|
||||||
|
|
||||||
#endif /* CURL_DISABLE_HTTP */
|
#endif /* CURL_DISABLE_HTTP */
|
||||||
|
|
||||||
@ -184,8 +153,6 @@ void Curl_http_exp100_got100(struct Curl_easy *data);
|
|||||||
* HTTP unique setup
|
* HTTP unique setup
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
CURLcode Curl_http_size(struct Curl_easy *data);
|
|
||||||
|
|
||||||
CURLcode Curl_http_write_resp_hds(struct Curl_easy *data,
|
CURLcode Curl_http_write_resp_hds(struct Curl_easy *data,
|
||||||
const char *buf, size_t blen,
|
const char *buf, size_t blen,
|
||||||
size_t *pconsumed);
|
size_t *pconsumed);
|
||||||
|
|||||||
@ -29,9 +29,6 @@
|
|||||||
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_PROXY)
|
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_PROXY)
|
||||||
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#ifdef USE_HYPER
|
|
||||||
#include <hyper.h>
|
|
||||||
#endif
|
|
||||||
#include "sendf.h"
|
#include "sendf.h"
|
||||||
#include "http.h"
|
#include "http.h"
|
||||||
#include "url.h"
|
#include "url.h"
|
||||||
|
|||||||
@ -162,9 +162,6 @@ void Curl_req_hard_reset(struct SingleRequest *req, struct Curl_easy *data)
|
|||||||
req->no_body = data->set.opt_no_body;
|
req->no_body = data->set.opt_no_body;
|
||||||
req->authneg = FALSE;
|
req->authneg = FALSE;
|
||||||
req->shutdown = FALSE;
|
req->shutdown = FALSE;
|
||||||
#ifdef USE_HYPER
|
|
||||||
req->bodywritten = FALSE;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Curl_req_free(struct SingleRequest *req, struct Curl_easy *data)
|
void Curl_req_free(struct SingleRequest *req, struct Curl_easy *data)
|
||||||
@ -261,7 +258,7 @@ static CURLcode req_send_buffer_flush(struct Curl_easy *data)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
CURLcode Curl_req_set_upload_done(struct Curl_easy *data)
|
static CURLcode req_set_upload_done(struct Curl_easy *data)
|
||||||
{
|
{
|
||||||
DEBUGASSERT(!data->req.upload_done);
|
DEBUGASSERT(!data->req.upload_done);
|
||||||
data->req.upload_done = TRUE;
|
data->req.upload_done = TRUE;
|
||||||
@ -339,7 +336,7 @@ static CURLcode req_flush(struct Curl_easy *data)
|
|||||||
if(!done)
|
if(!done)
|
||||||
return CURLE_AGAIN;
|
return CURLE_AGAIN;
|
||||||
}
|
}
|
||||||
return Curl_req_set_upload_done(data);
|
return req_set_upload_done(data);
|
||||||
}
|
}
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
@ -360,8 +357,6 @@ static ssize_t add_from_client(void *reader_ctx,
|
|||||||
return (ssize_t)nread;
|
return (ssize_t)nread;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef USE_HYPER
|
|
||||||
|
|
||||||
static CURLcode req_send_buffer_add(struct Curl_easy *data,
|
static CURLcode req_send_buffer_add(struct Curl_easy *data,
|
||||||
const char *buf, size_t blen,
|
const char *buf, size_t blen,
|
||||||
size_t hds_len)
|
size_t hds_len)
|
||||||
@ -411,7 +406,6 @@ CURLcode Curl_req_send(struct Curl_easy *data, struct dynbuf *req)
|
|||||||
}
|
}
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
#endif /* !USE_HYPER */
|
|
||||||
|
|
||||||
bool Curl_req_sendbuf_empty(struct Curl_easy *data)
|
bool Curl_req_sendbuf_empty(struct Curl_easy *data)
|
||||||
{
|
{
|
||||||
@ -464,7 +458,7 @@ CURLcode Curl_req_abort_sending(struct Curl_easy *data)
|
|||||||
data->req.upload_aborted = TRUE;
|
data->req.upload_aborted = TRUE;
|
||||||
/* no longer KEEP_SEND and KEEP_SEND_PAUSE */
|
/* no longer KEEP_SEND and KEEP_SEND_PAUSE */
|
||||||
data->req.keepon &= ~KEEP_SENDBITS;
|
data->req.keepon &= ~KEEP_SENDBITS;
|
||||||
return Curl_req_set_upload_done(data);
|
return req_set_upload_done(data);
|
||||||
}
|
}
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -152,9 +152,6 @@ struct SingleRequest {
|
|||||||
BIT(sendbuf_init); /* sendbuf is initialized */
|
BIT(sendbuf_init); /* sendbuf is initialized */
|
||||||
BIT(shutdown); /* request end will shutdown connection */
|
BIT(shutdown); /* request end will shutdown connection */
|
||||||
BIT(shutdown_err_ignore); /* errors in shutdown will not fail request */
|
BIT(shutdown_err_ignore); /* errors in shutdown will not fail request */
|
||||||
#ifdef USE_HYPER
|
|
||||||
BIT(bodywritten);
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -196,7 +193,6 @@ void Curl_req_free(struct SingleRequest *req, struct Curl_easy *data);
|
|||||||
*/
|
*/
|
||||||
void Curl_req_hard_reset(struct SingleRequest *req, struct Curl_easy *data);
|
void Curl_req_hard_reset(struct SingleRequest *req, struct Curl_easy *data);
|
||||||
|
|
||||||
#ifndef USE_HYPER
|
|
||||||
/**
|
/**
|
||||||
* Send request headers. If not all could be sent
|
* Send request headers. If not all could be sent
|
||||||
* they will be buffered. Use `Curl_req_flush()` to make sure
|
* they will be buffered. Use `Curl_req_flush()` to make sure
|
||||||
@ -207,8 +203,6 @@ void Curl_req_hard_reset(struct SingleRequest *req, struct Curl_easy *data);
|
|||||||
*/
|
*/
|
||||||
CURLcode Curl_req_send(struct Curl_easy *data, struct dynbuf *buf);
|
CURLcode Curl_req_send(struct Curl_easy *data, struct dynbuf *buf);
|
||||||
|
|
||||||
#endif /* !USE_HYPER */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TRUE iff the request has sent all request headers and data.
|
* TRUE iff the request has sent all request headers and data.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include "curl_setup.h"
|
#include "curl_setup.h"
|
||||||
|
|
||||||
#if !defined(CURL_DISABLE_RTSP) && !defined(USE_HYPER)
|
#if !defined(CURL_DISABLE_RTSP)
|
||||||
|
|
||||||
#include "urldata.h"
|
#include "urldata.h"
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
@ -1043,4 +1043,4 @@ CURLcode rtsp_parse_transport(struct Curl_easy *data, const char *transport)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* CURL_DISABLE_RTSP or using Hyper */
|
#endif /* CURL_DISABLE_RTSP */
|
||||||
|
|||||||
@ -23,9 +23,6 @@
|
|||||||
* SPDX-License-Identifier: curl
|
* SPDX-License-Identifier: curl
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#ifdef USE_HYPER
|
|
||||||
#define CURL_DISABLE_RTSP 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef CURL_DISABLE_RTSP
|
#ifndef CURL_DISABLE_RTSP
|
||||||
|
|
||||||
|
|||||||
19
lib/sendf.c
19
lib/sendf.c
@ -316,9 +316,6 @@ static CURLcode cw_download_write(struct Curl_easy *data,
|
|||||||
}
|
}
|
||||||
/* Update stats, write and report progress */
|
/* Update stats, write and report progress */
|
||||||
data->req.bytecount += nwrite;
|
data->req.bytecount += nwrite;
|
||||||
#ifdef USE_HYPER
|
|
||||||
data->req.bodywritten = TRUE;
|
|
||||||
#endif
|
|
||||||
result = Curl_pgrsSetDownloadCounter(data, data->req.bytecount);
|
result = Curl_pgrsSetDownloadCounter(data, data->req.bytecount);
|
||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
@ -497,22 +494,6 @@ struct Curl_cwriter *Curl_cwriter_get_by_type(struct Curl_easy *data,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Curl_cwriter_remove_by_name(struct Curl_easy *data,
|
|
||||||
const char *name)
|
|
||||||
{
|
|
||||||
struct Curl_cwriter **anchor = &data->req.writer_stack;
|
|
||||||
|
|
||||||
while(*anchor) {
|
|
||||||
if(!strcmp(name, (*anchor)->cwt->name)) {
|
|
||||||
struct Curl_cwriter *w = (*anchor);
|
|
||||||
*anchor = w->next;
|
|
||||||
Curl_cwriter_free(data, w);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
anchor = &((*anchor)->next);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Curl_cwriter_is_paused(struct Curl_easy *data)
|
bool Curl_cwriter_is_paused(struct Curl_easy *data)
|
||||||
{
|
{
|
||||||
return Curl_cw_out_is_paused(data);
|
return Curl_cw_out_is_paused(data);
|
||||||
|
|||||||
@ -166,9 +166,6 @@ CURLcode Curl_cwriter_add(struct Curl_easy *data,
|
|||||||
struct Curl_cwriter *Curl_cwriter_get_by_type(struct Curl_easy *data,
|
struct Curl_cwriter *Curl_cwriter_get_by_type(struct Curl_easy *data,
|
||||||
const struct Curl_cwtype *cwt);
|
const struct Curl_cwtype *cwt);
|
||||||
|
|
||||||
void Curl_cwriter_remove_by_name(struct Curl_easy *data,
|
|
||||||
const char *name);
|
|
||||||
|
|
||||||
struct Curl_cwriter *Curl_cwriter_get_by_name(struct Curl_easy *data,
|
struct Curl_cwriter *Curl_cwriter_get_by_name(struct Curl_easy *data,
|
||||||
const char *name);
|
const char *name);
|
||||||
|
|
||||||
|
|||||||
@ -644,13 +644,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLOPT_HTTP09_ALLOWED:
|
case CURLOPT_HTTP09_ALLOWED:
|
||||||
#ifdef USE_HYPER
|
|
||||||
/* Hyper does not support HTTP/0.9 */
|
|
||||||
if(enabled)
|
|
||||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
|
||||||
#else
|
|
||||||
data->set.http09_allowed = enabled;
|
data->set.http09_allowed = enabled;
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
#endif /* ! CURL_DISABLE_HTTP */
|
#endif /* ! CURL_DISABLE_HTTP */
|
||||||
|
|
||||||
|
|||||||
@ -435,15 +435,6 @@ CURLcode Curl_sendrecv(struct Curl_easy *data, struct curltime *nowp)
|
|||||||
data->state.select_bits = 0;
|
data->state.select_bits = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_HYPER
|
|
||||||
if(data->conn->datastream) {
|
|
||||||
result = data->conn->datastream(data, data->conn, &didwhat,
|
|
||||||
CURL_CSELECT_OUT|CURL_CSELECT_IN);
|
|
||||||
if(result || data->req.done)
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
#endif
|
|
||||||
/* We go ahead and do a read if we have a readable socket or if the stream
|
/* We go ahead and do a read if we have a readable socket or if the stream
|
||||||
was rewound (in which case we have data in a buffer) */
|
was rewound (in which case we have data in a buffer) */
|
||||||
if(k->keepon & KEEP_RECV) {
|
if(k->keepon & KEEP_RECV) {
|
||||||
@ -458,9 +449,6 @@ CURLcode Curl_sendrecv(struct Curl_easy *data, struct curltime *nowp)
|
|||||||
if(result)
|
if(result)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
#ifdef USE_HYPER
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(!didwhat) {
|
if(!didwhat) {
|
||||||
/* Transfer wanted to send/recv, but nothing was possible. */
|
/* Transfer wanted to send/recv, but nothing was possible. */
|
||||||
|
|||||||
@ -180,13 +180,6 @@ typedef ssize_t (Curl_recv)(struct Curl_easy *data, /* transfer */
|
|||||||
size_t len, /* max amount to read */
|
size_t len, /* max amount to read */
|
||||||
CURLcode *err); /* error to return */
|
CURLcode *err); /* error to return */
|
||||||
|
|
||||||
#ifdef USE_HYPER
|
|
||||||
typedef CURLcode (*Curl_datastream)(struct Curl_easy *data,
|
|
||||||
struct connectdata *conn,
|
|
||||||
int *didwhat,
|
|
||||||
int select_res);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "mime.h"
|
#include "mime.h"
|
||||||
#include "imap.h"
|
#include "imap.h"
|
||||||
#include "pop3.h"
|
#include "pop3.h"
|
||||||
@ -200,7 +193,6 @@ typedef CURLcode (*Curl_datastream)(struct Curl_easy *data,
|
|||||||
#include "mqtt.h"
|
#include "mqtt.h"
|
||||||
#include "ftplistparser.h"
|
#include "ftplistparser.h"
|
||||||
#include "multihandle.h"
|
#include "multihandle.h"
|
||||||
#include "c-hyper.h"
|
|
||||||
#include "cf-socket.h"
|
#include "cf-socket.h"
|
||||||
|
|
||||||
#ifdef HAVE_GSSAPI
|
#ifdef HAVE_GSSAPI
|
||||||
@ -930,10 +922,7 @@ struct connectdata {
|
|||||||
#ifdef USE_UNIX_SOCKETS
|
#ifdef USE_UNIX_SOCKETS
|
||||||
char *unix_domain_socket;
|
char *unix_domain_socket;
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_HYPER
|
|
||||||
/* if set, an alternative data transfer function */
|
|
||||||
Curl_datastream datastream;
|
|
||||||
#endif
|
|
||||||
/* When this connection is created, store the conditions for the local end
|
/* When this connection is created, store the conditions for the local end
|
||||||
bind. This is stored before the actual bind and before any connection is
|
bind. This is stored before the actual bind and before any connection is
|
||||||
made and will serve the purpose of being used for comparison reasons so
|
made and will serve the purpose of being used for comparison reasons so
|
||||||
@ -1276,10 +1265,6 @@ struct UrlState {
|
|||||||
struct curl_slist *cookielist; /* list of cookie files set by
|
struct curl_slist *cookielist; /* list of cookie files set by
|
||||||
curl_easy_setopt(COOKIEFILE) calls */
|
curl_easy_setopt(COOKIEFILE) calls */
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_HYPER
|
|
||||||
bool hconnect; /* set if a CONNECT request */
|
|
||||||
CURLcode hresult; /* used to pass return codes back from hyper callbacks */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef CURL_DISABLE_VERBOSE_STRINGS
|
#ifndef CURL_DISABLE_VERBOSE_STRINGS
|
||||||
struct curl_trc_feat *feat; /* opt. trace feature transfer is part of */
|
struct curl_trc_feat *feat; /* opt. trace feature transfer is part of */
|
||||||
@ -1923,9 +1908,6 @@ struct Curl_easy {
|
|||||||
struct PureInfo info; /* stats, reports and info data */
|
struct PureInfo info; /* stats, reports and info data */
|
||||||
struct curl_tlssessioninfo tsi; /* Information about the TLS session, only
|
struct curl_tlssessioninfo tsi; /* Information about the TLS session, only
|
||||||
valid after a client has asked for it */
|
valid after a client has asked for it */
|
||||||
#ifdef USE_HYPER
|
|
||||||
struct hyptransfer hyp;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define LIBCURL_NAME "libcurl"
|
#define LIBCURL_NAME "libcurl"
|
||||||
|
|||||||
@ -210,9 +210,6 @@ char *curl_version(void)
|
|||||||
#ifdef USE_LIBRTMP
|
#ifdef USE_LIBRTMP
|
||||||
char rtmp_version[30];
|
char rtmp_version[30];
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_HYPER
|
|
||||||
char hyper_buf[30];
|
|
||||||
#endif
|
|
||||||
#ifdef USE_GSASL
|
#ifdef USE_GSASL
|
||||||
char gsasl_buf[30];
|
char gsasl_buf[30];
|
||||||
#endif
|
#endif
|
||||||
@ -277,10 +274,6 @@ char *curl_version(void)
|
|||||||
Curl_rtmp_version(rtmp_version, sizeof(rtmp_version));
|
Curl_rtmp_version(rtmp_version, sizeof(rtmp_version));
|
||||||
src[i++] = rtmp_version;
|
src[i++] = rtmp_version;
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_HYPER
|
|
||||||
msnprintf(hyper_buf, sizeof(hyper_buf), "Hyper/%s", hyper_version());
|
|
||||||
src[i++] = hyper_buf;
|
|
||||||
#endif
|
|
||||||
#ifdef USE_GSASL
|
#ifdef USE_GSASL
|
||||||
msnprintf(gsasl_buf, sizeof(gsasl_buf), "libgsasl/%s",
|
msnprintf(gsasl_buf, sizeof(gsasl_buf), "libgsasl/%s",
|
||||||
gsasl_check_version(NULL));
|
gsasl_check_version(NULL));
|
||||||
@ -676,14 +669,6 @@ curl_version_info_data *curl_version_info(CURLversion stamp)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_HYPER
|
|
||||||
{
|
|
||||||
static char hyper_buffer[30];
|
|
||||||
msnprintf(hyper_buffer, sizeof(hyper_buffer), "Hyper/%s", hyper_version());
|
|
||||||
version_info.hyper_version = hyper_buffer;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_GSASL
|
#ifdef USE_GSASL
|
||||||
{
|
{
|
||||||
version_info.gsasl_version = gsasl_check_version(NULL);
|
version_info.gsasl_version = gsasl_check_version(NULL);
|
||||||
|
|||||||
10
lib/ws.c
10
lib/ws.c
@ -676,7 +676,7 @@ struct wsfield {
|
|||||||
const char *val;
|
const char *val;
|
||||||
};
|
};
|
||||||
|
|
||||||
CURLcode Curl_ws_request(struct Curl_easy *data, REQTYPE *req)
|
CURLcode Curl_ws_request(struct Curl_easy *data, struct dynbuf *req)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
CURLcode result = CURLE_OK;
|
CURLcode result = CURLE_OK;
|
||||||
@ -729,16 +729,8 @@ CURLcode Curl_ws_request(struct Curl_easy *data, REQTYPE *req)
|
|||||||
free(randstr);
|
free(randstr);
|
||||||
for(i = 0; !result && (i < sizeof(heads)/sizeof(heads[0])); i++) {
|
for(i = 0; !result && (i < sizeof(heads)/sizeof(heads[0])); i++) {
|
||||||
if(!Curl_checkheaders(data, STRCONST(heads[i].name))) {
|
if(!Curl_checkheaders(data, STRCONST(heads[i].name))) {
|
||||||
#ifdef USE_HYPER
|
|
||||||
char field[128];
|
|
||||||
msnprintf(field, sizeof(field), "%s %s", heads[i].name,
|
|
||||||
heads[i].val);
|
|
||||||
result = Curl_hyper_header(data, req, field);
|
|
||||||
#else
|
|
||||||
(void)data;
|
|
||||||
result = Curl_dyn_addf(req, "%s %s\r\n", heads[i].name,
|
result = Curl_dyn_addf(req, "%s %s\r\n", heads[i].name,
|
||||||
heads[i].val);
|
heads[i].val);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
k->upgr101 = UPGR101_WS;
|
k->upgr101 = UPGR101_WS;
|
||||||
|
|||||||
8
lib/ws.h
8
lib/ws.h
@ -27,12 +27,6 @@
|
|||||||
|
|
||||||
#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)
|
#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)
|
||||||
|
|
||||||
#ifdef USE_HYPER
|
|
||||||
#define REQTYPE void
|
|
||||||
#else
|
|
||||||
#define REQTYPE struct dynbuf
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* a client-side WS frame decoder, parsing frame headers and
|
/* a client-side WS frame decoder, parsing frame headers and
|
||||||
* payload, keeping track of current position and stats */
|
* payload, keeping track of current position and stats */
|
||||||
enum ws_dec_state {
|
enum ws_dec_state {
|
||||||
@ -73,7 +67,7 @@ struct websocket {
|
|||||||
struct curl_ws_frame frame; /* the current WS FRAME received */
|
struct curl_ws_frame frame; /* the current WS FRAME received */
|
||||||
};
|
};
|
||||||
|
|
||||||
CURLcode Curl_ws_request(struct Curl_easy *data, REQTYPE *req);
|
CURLcode Curl_ws_request(struct Curl_easy *data, struct dynbuf *req);
|
||||||
CURLcode Curl_ws_accept(struct Curl_easy *data, const char *mem, size_t len);
|
CURLcode Curl_ws_accept(struct Curl_easy *data, const char *mem, size_t len);
|
||||||
|
|
||||||
extern const struct Curl_handler Curl_handler_ws;
|
extern const struct Curl_handler Curl_handler_ws;
|
||||||
|
|||||||
@ -208,9 +208,6 @@ together as a single identifier. Most keywords are only there to provide a way
|
|||||||
for users to skip certain classes of tests, if desired, but a few are treated
|
for users to skip certain classes of tests, if desired, but a few are treated
|
||||||
specially by the test harness or build system.
|
specially by the test harness or build system.
|
||||||
|
|
||||||
When using curl built with Hyper, the keywords must include `HTTP` or `HTTPS`
|
|
||||||
for 'hyper mode' to kick in and make line ending checks work for tests.
|
|
||||||
|
|
||||||
When running a unit test and the keywords include `unittest`, the `<tool>`
|
When running a unit test and the keywords include `unittest`, the `<tool>`
|
||||||
section can be left empty to use the standard unit test tool name `unitN` where
|
section can be left empty to use the standard unit test tool name `unitN` where
|
||||||
`N` is the test number.
|
`N` is the test number.
|
||||||
@ -447,7 +444,6 @@ Features testable here are:
|
|||||||
- `http/2`
|
- `http/2`
|
||||||
- `http/3`
|
- `http/3`
|
||||||
- `HTTPS-proxy`
|
- `HTTPS-proxy`
|
||||||
- `hyper`
|
|
||||||
- `IDN`
|
- `IDN`
|
||||||
- `IPv6`
|
- `IPv6`
|
||||||
- `Kerberos`
|
- `Kerberos`
|
||||||
|
|||||||
@ -54,38 +54,6 @@
|
|||||||
# https://github.com/curl/curl/issues/380
|
# https://github.com/curl/curl/issues/380
|
||||||
1801
|
1801
|
||||||
#
|
#
|
||||||
#
|
|
||||||
# Tests that are disabled here for Hyper are SUPPOSED to work but
|
|
||||||
# still need adjustments in tests or code. Tests that cannot be
|
|
||||||
# fixed for hyper should be adjusted for it in the test file.
|
|
||||||
#
|
|
||||||
# hyper support remains EXPERIMENTAL as long as there's a test number
|
|
||||||
# listed below
|
|
||||||
#
|
|
||||||
# Several tests fail due to hyper's lack of trailers support: 266, 1417, 1540,
|
|
||||||
# 1591, 1943. See https://github.com/hyperium/hyper/issues/2699 for details.
|
|
||||||
%if hyper
|
|
||||||
266
|
|
||||||
477
|
|
||||||
500
|
|
||||||
579
|
|
||||||
587
|
|
||||||
# 1021 re-added here due to flakiness
|
|
||||||
1021
|
|
||||||
1060
|
|
||||||
1417
|
|
||||||
1460
|
|
||||||
1533
|
|
||||||
1540
|
|
||||||
1591
|
|
||||||
1598
|
|
||||||
1943
|
|
||||||
2301
|
|
||||||
2302
|
|
||||||
2305
|
|
||||||
# response body seem not to be handled by hyper
|
|
||||||
2307
|
|
||||||
%endif
|
|
||||||
2043
|
2043
|
||||||
# The CRL test doesn't work with wolfSSL
|
# The CRL test doesn't work with wolfSSL
|
||||||
%if wolfssl
|
%if wolfssl
|
||||||
|
|||||||
@ -63,11 +63,7 @@ Accept: */*
|
|||||||
Transfer-Encoding: chunked
|
Transfer-Encoding: chunked
|
||||||
Expect: 100-continue
|
Expect: 100-continue
|
||||||
|
|
||||||
%if hyper
|
|
||||||
7A
|
|
||||||
%else
|
|
||||||
7a
|
7a
|
||||||
%endif
|
|
||||||
This is data we upload with PUT
|
This is data we upload with PUT
|
||||||
it comes from stdin so MUST be sent
|
it comes from stdin so MUST be sent
|
||||||
with chunked encoding
|
with chunked encoding
|
||||||
|
|||||||
@ -57,11 +57,7 @@ Accept: */*
|
|||||||
Transfer-Encoding: chunked
|
Transfer-Encoding: chunked
|
||||||
Expect: 100-continue
|
Expect: 100-continue
|
||||||
|
|
||||||
%if hyper
|
|
||||||
7A
|
|
||||||
%else
|
|
||||||
7a
|
7a
|
||||||
%endif
|
|
||||||
This is data we upload with PUT
|
This is data we upload with PUT
|
||||||
it comes from stdin so MUST be sent
|
it comes from stdin so MUST be sent
|
||||||
with chunked encoding
|
with chunked encoding
|
||||||
|
|||||||
@ -24,10 +24,8 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
|||||||
cccccccccccccccccccccccccccccccc
|
cccccccccccccccccccccccccccccccc
|
||||||
|
|
||||||
0
|
0
|
||||||
%if !hyper
|
|
||||||
chunky-trailer: header data
|
chunky-trailer: header data
|
||||||
another-header: yes
|
another-header: yes
|
||||||
%endif
|
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
<datacheck>
|
<datacheck>
|
||||||
@ -37,10 +35,8 @@ Transfer-Encoding: chunked
|
|||||||
Connection: mooo
|
Connection: mooo
|
||||||
|
|
||||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc
|
||||||
%if !hyper
|
|
||||||
chunky-trailer: header data
|
chunky-trailer: header data
|
||||||
another-header: yes
|
another-header: yes
|
||||||
%endif
|
|
||||||
</datacheck>
|
</datacheck>
|
||||||
<servercmd>
|
<servercmd>
|
||||||
writedelay: 10
|
writedelay: 10
|
||||||
@ -77,10 +73,8 @@ Server: fakeit/0.9 fakeitbad/1.0
|
|||||||
Transfer-Encoding: chunked
|
Transfer-Encoding: chunked
|
||||||
Connection: mooo
|
Connection: mooo
|
||||||
|
|
||||||
%if !hyper
|
|
||||||
chunky-trailer: header data
|
chunky-trailer: header data
|
||||||
another-header: yes
|
another-header: yes
|
||||||
%endif
|
|
||||||
</file>
|
</file>
|
||||||
</verify>
|
</verify>
|
||||||
|
|
||||||
|
|||||||
@ -40,10 +40,6 @@ verify
|
|||||||
#
|
#
|
||||||
# Client-side
|
# Client-side
|
||||||
<client>
|
<client>
|
||||||
# hyper doesn't support HTTP/0.9
|
|
||||||
<features>
|
|
||||||
!hyper
|
|
||||||
</features>
|
|
||||||
<server>
|
<server>
|
||||||
http
|
http
|
||||||
</server>
|
</server>
|
||||||
|
|||||||
@ -40,9 +40,7 @@ One: 1
|
|||||||
Two: 2
|
Two: 2
|
||||||
no-colon
|
no-colon
|
||||||
|
|
||||||
%if !hyper
|
|
||||||
And A Funny One : wohoo
|
And A Funny One : wohoo
|
||||||
%endif
|
|
||||||
User-Agent:
|
User-Agent:
|
||||||
</file>
|
</file>
|
||||||
<command>
|
<command>
|
||||||
@ -59,9 +57,7 @@ Host: %HOSTIP:%HTTPPORT
|
|||||||
Accept: */*
|
Accept: */*
|
||||||
One: 1
|
One: 1
|
||||||
Two: 2
|
Two: 2
|
||||||
%if !hyper
|
|
||||||
And A Funny One : wohoo
|
And A Funny One : wohoo
|
||||||
%endif
|
|
||||||
|
|
||||||
</protocol>
|
</protocol>
|
||||||
</verify>
|
</verify>
|
||||||
|
|||||||
@ -22,10 +22,6 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
|
|||||||
#
|
#
|
||||||
# Client-side
|
# Client-side
|
||||||
<client>
|
<client>
|
||||||
# hyper doesn't support HTTP/0.9
|
|
||||||
<features>
|
|
||||||
!hyper
|
|
||||||
</features>
|
|
||||||
<server>
|
<server>
|
||||||
http
|
http
|
||||||
</server>
|
</server>
|
||||||
|
|||||||
@ -19,10 +19,6 @@ swsclose
|
|||||||
#
|
#
|
||||||
# Client-side
|
# Client-side
|
||||||
<client>
|
<client>
|
||||||
# hyper doesn't grok HTTP/0.9
|
|
||||||
<features>
|
|
||||||
!hyper
|
|
||||||
</features>
|
|
||||||
<server>
|
<server>
|
||||||
http
|
http
|
||||||
</server>
|
</server>
|
||||||
|
|||||||
@ -19,10 +19,6 @@ swsclose
|
|||||||
#
|
#
|
||||||
# Client-side
|
# Client-side
|
||||||
<client>
|
<client>
|
||||||
# hyper doesn't grok HTTP/0.9
|
|
||||||
<features>
|
|
||||||
!hyper
|
|
||||||
</features>
|
|
||||||
<server>
|
<server>
|
||||||
http
|
http
|
||||||
</server>
|
</server>
|
||||||
|
|||||||
@ -53,22 +53,14 @@ Accept: */*
|
|||||||
<file name="%LOGDIR/out%TESTNUMBER">
|
<file name="%LOGDIR/out%TESTNUMBER">
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||||
%if hyper
|
|
||||||
Server: test-server/ fake folded
|
|
||||||
%else
|
|
||||||
Server: test-server/
|
Server: test-server/
|
||||||
fake
|
fake
|
||||||
folded
|
folded
|
||||||
%endif
|
|
||||||
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
|
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
|
||||||
ETag: "21025-dc7-39462498"
|
ETag: "21025-dc7-39462498"
|
||||||
Content-Length: 6
|
Content-Length: 6
|
||||||
%if hyper
|
|
||||||
Connection: close
|
|
||||||
%else
|
|
||||||
Connection:
|
Connection:
|
||||||
close
|
close
|
||||||
%endif
|
|
||||||
|
|
||||||
</file>
|
</file>
|
||||||
</verify>
|
</verify>
|
||||||
|
|||||||
@ -83,10 +83,8 @@ Accept: */*
|
|||||||
|
|
||||||
</protocol>
|
</protocol>
|
||||||
<file name="%LOGDIR/stderr%TESTNUMBER" mode="text">
|
<file name="%LOGDIR/stderr%TESTNUMBER" mode="text">
|
||||||
%if !hyper
|
|
||||||
* Ignoring Content-Length in CONNECT 200 response
|
* Ignoring Content-Length in CONNECT 200 response
|
||||||
* Ignoring Transfer-Encoding in CONNECT 200 response
|
* Ignoring Transfer-Encoding in CONNECT 200 response
|
||||||
%endif
|
|
||||||
</file>
|
</file>
|
||||||
<stripfile>
|
<stripfile>
|
||||||
s/^.*(?=\* Ignoring (?:Content-Length|Transfer-Encoding) )// or $_ = ''
|
s/^.*(?=\* Ignoring (?:Content-Length|Transfer-Encoding) )// or $_ = ''
|
||||||
|
|||||||
@ -28,10 +28,8 @@ Funny-head: yesyes
|
|||||||
#
|
#
|
||||||
# Client-side
|
# Client-side
|
||||||
<client>
|
<client>
|
||||||
# hyper doesn't support the added crazy header
|
|
||||||
<features>
|
<features>
|
||||||
Debug
|
Debug
|
||||||
!hyper
|
|
||||||
</features>
|
</features>
|
||||||
<server>
|
<server>
|
||||||
http
|
http
|
||||||
|
|||||||
@ -46,11 +46,5 @@ User-Agent: curl/%VERSION
|
|||||||
Accept: */*
|
Accept: */*
|
||||||
|
|
||||||
</protocol>
|
</protocol>
|
||||||
%if hyper
|
|
||||||
# curl: (1) Hyper: [6] invalid HTTP header parsed
|
|
||||||
<errorcode>
|
|
||||||
1
|
|
||||||
</errorcode>
|
|
||||||
%endif
|
|
||||||
</verify>
|
</verify>
|
||||||
</testcase>
|
</testcase>
|
||||||
|
|||||||
@ -53,15 +53,9 @@ User-Agent: curl/%VERSION
|
|||||||
Accept: */*
|
Accept: */*
|
||||||
|
|
||||||
</protocol>
|
</protocol>
|
||||||
|
# weird_server_reply
|
||||||
# Hyper curl returns unsupported protocol
|
|
||||||
# built-in curl returns weird_server_reply
|
|
||||||
<errorcode>
|
<errorcode>
|
||||||
%if hyper
|
|
||||||
1
|
|
||||||
%else
|
|
||||||
8
|
8
|
||||||
%endif
|
|
||||||
</errorcode>
|
</errorcode>
|
||||||
</verify>
|
</verify>
|
||||||
</testcase>
|
</testcase>
|
||||||
|
|||||||
@ -45,14 +45,9 @@ Accept: */*
|
|||||||
|
|
||||||
</protocol>
|
</protocol>
|
||||||
|
|
||||||
# Hyper curl returns unsupported protocol
|
# weird_server_reply
|
||||||
# built-in curl returns weird_server_reply
|
|
||||||
<errorcode>
|
<errorcode>
|
||||||
%if hyper
|
|
||||||
1
|
|
||||||
%else
|
|
||||||
8
|
8
|
||||||
%endif
|
|
||||||
</errorcode>
|
</errorcode>
|
||||||
</verify>
|
</verify>
|
||||||
</testcase>
|
</testcase>
|
||||||
|
|||||||
@ -24,10 +24,8 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
|||||||
cccccccccccccccccccccccccccccccc
|
cccccccccccccccccccccccccccccccc
|
||||||
|
|
||||||
0
|
0
|
||||||
%if !hyper
|
|
||||||
chunky-trailer: header data
|
chunky-trailer: header data
|
||||||
another-header: yes
|
another-header: yes
|
||||||
%endif
|
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
<datacheck>
|
<datacheck>
|
||||||
@ -37,10 +35,8 @@ Transfer-Encoding: chunked, chunked
|
|||||||
Connection: mooo
|
Connection: mooo
|
||||||
|
|
||||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc
|
||||||
%if !hyper
|
|
||||||
chunky-trailer: header data
|
chunky-trailer: header data
|
||||||
another-header: yes
|
another-header: yes
|
||||||
%endif
|
|
||||||
</datacheck>
|
</datacheck>
|
||||||
<servercmd>
|
<servercmd>
|
||||||
writedelay: 10
|
writedelay: 10
|
||||||
@ -77,10 +73,8 @@ Server: fakeit/0.9 fakeitbad/1.0
|
|||||||
Transfer-Encoding: chunked, chunked
|
Transfer-Encoding: chunked, chunked
|
||||||
Connection: mooo
|
Connection: mooo
|
||||||
|
|
||||||
%if !hyper
|
|
||||||
chunky-trailer: header data
|
chunky-trailer: header data
|
||||||
another-header: yes
|
another-header: yes
|
||||||
%endif
|
|
||||||
</file>
|
</file>
|
||||||
</verify>
|
</verify>
|
||||||
|
|
||||||
|
|||||||
@ -25,10 +25,8 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
|||||||
cccccccccccccccccccccccccccccccc
|
cccccccccccccccccccccccccccccccc
|
||||||
|
|
||||||
0
|
0
|
||||||
%if !hyper
|
|
||||||
chunky-trailer: header data
|
chunky-trailer: header data
|
||||||
another-header: yes
|
another-header: yes
|
||||||
%endif
|
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
<datacheck>
|
<datacheck>
|
||||||
@ -39,10 +37,8 @@ Transfer-Encoding: chunked
|
|||||||
Connection: mooo
|
Connection: mooo
|
||||||
|
|
||||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc
|
||||||
%if !hyper
|
|
||||||
chunky-trailer: header data
|
chunky-trailer: header data
|
||||||
another-header: yes
|
another-header: yes
|
||||||
%endif
|
|
||||||
</datacheck>
|
</datacheck>
|
||||||
<servercmd>
|
<servercmd>
|
||||||
writedelay: 10
|
writedelay: 10
|
||||||
@ -80,10 +76,8 @@ Transfer-Encoding: chunked
|
|||||||
Transfer-Encoding: chunked
|
Transfer-Encoding: chunked
|
||||||
Connection: mooo
|
Connection: mooo
|
||||||
|
|
||||||
%if !hyper
|
|
||||||
chunky-trailer: header data
|
chunky-trailer: header data
|
||||||
another-header: yes
|
another-header: yes
|
||||||
%endif
|
|
||||||
</file>
|
</file>
|
||||||
</verify>
|
</verify>
|
||||||
|
|
||||||
|
|||||||
@ -48,11 +48,7 @@ Transfer-Encoding: chunked
|
|||||||
Trailer: my-super-awesome-trailer, my-other-awesome-trailer
|
Trailer: my-super-awesome-trailer, my-other-awesome-trailer
|
||||||
Expect: 100-continue
|
Expect: 100-continue
|
||||||
|
|
||||||
%if hyper
|
|
||||||
E
|
|
||||||
%else
|
|
||||||
e
|
e
|
||||||
%endif
|
|
||||||
Hello Cloud!
|
Hello Cloud!
|
||||||
|
|
||||||
0
|
0
|
||||||
|
|||||||
@ -19,11 +19,8 @@ Funny-head: yesyes
|
|||||||
moooooooooooo
|
moooooooooooo
|
||||||
</data>
|
</data>
|
||||||
<datacheck>
|
<datacheck>
|
||||||
%if hyper
|
|
||||||
%else
|
|
||||||
HTTP/1.1 200 OK swsclose
|
HTTP/1.1 200 OK swsclose
|
||||||
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||||
%endif
|
|
||||||
</datacheck>
|
</datacheck>
|
||||||
</reply>
|
</reply>
|
||||||
|
|
||||||
@ -51,15 +48,9 @@ User-Agent: curl/%VERSION
|
|||||||
Accept: */*
|
Accept: */*
|
||||||
|
|
||||||
</protocol>
|
</protocol>
|
||||||
|
# weird_server_reply
|
||||||
# Hyper curl returns unsupported protocol
|
|
||||||
# built-in curl returns weird_server_reply
|
|
||||||
<errorcode>
|
<errorcode>
|
||||||
%if hyper
|
|
||||||
1
|
|
||||||
%else
|
|
||||||
8
|
8
|
||||||
%endif
|
|
||||||
</errorcode>
|
</errorcode>
|
||||||
</verify>
|
</verify>
|
||||||
</testcase>
|
</testcase>
|
||||||
|
|||||||
@ -58,13 +58,8 @@ Accept: */*
|
|||||||
|
|
||||||
# curl: (18) transfer closed with outstanding read data remaining
|
# curl: (18) transfer closed with outstanding read data remaining
|
||||||
# 18 == CURLE_PARTIAL_FILE
|
# 18 == CURLE_PARTIAL_FILE
|
||||||
# 56 == CURLE_RECV_ERROR
|
|
||||||
<errorcode>
|
<errorcode>
|
||||||
%if hyper
|
|
||||||
56
|
|
||||||
%else
|
|
||||||
18
|
18
|
||||||
%endif
|
|
||||||
</errorcode>
|
</errorcode>
|
||||||
</verify>
|
</verify>
|
||||||
</testcase>
|
</testcase>
|
||||||
|
|||||||
@ -46,11 +46,7 @@ User-Agent: curl/%VERSION
|
|||||||
Accept: */*
|
Accept: */*
|
||||||
Transfer-Encoding: chunked
|
Transfer-Encoding: chunked
|
||||||
|
|
||||||
%if hyper
|
|
||||||
1E
|
|
||||||
%else
|
|
||||||
1e
|
1e
|
||||||
%endif
|
|
||||||
just some tiny teeny contents
|
just some tiny teeny contents
|
||||||
|
|
||||||
0
|
0
|
||||||
|
|||||||
@ -54,14 +54,6 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER0002
|
|||||||
#
|
#
|
||||||
# Verify data after the test has been "shot"
|
# Verify data after the test has been "shot"
|
||||||
<verify>
|
<verify>
|
||||||
# hyper doesn't like the bad header in the second request
|
|
||||||
<errorcode>
|
|
||||||
%if hyper
|
|
||||||
1
|
|
||||||
%else
|
|
||||||
0
|
|
||||||
%endif
|
|
||||||
</errorcode>
|
|
||||||
<protocol>
|
<protocol>
|
||||||
GET /%TESTNUMBER HTTP/1.1
|
GET /%TESTNUMBER HTTP/1.1
|
||||||
Host: %HOSTIP:%HTTPPORT
|
Host: %HOSTIP:%HTTPPORT
|
||||||
|
|||||||
@ -31,7 +31,6 @@ upgrade
|
|||||||
<features>
|
<features>
|
||||||
Debug
|
Debug
|
||||||
ws
|
ws
|
||||||
!hyper
|
|
||||||
</features>
|
</features>
|
||||||
<server>
|
<server>
|
||||||
http
|
http
|
||||||
|
|||||||
Binary file not shown.
@ -26,9 +26,6 @@ muahahaha
|
|||||||
#
|
#
|
||||||
# Client-side
|
# Client-side
|
||||||
<client>
|
<client>
|
||||||
<features>
|
|
||||||
!hyper
|
|
||||||
</features>
|
|
||||||
<server>
|
<server>
|
||||||
http
|
http
|
||||||
</server>
|
</server>
|
||||||
|
|||||||
@ -30,11 +30,7 @@ If this is received, the location following worked
|
|||||||
HTTP/1.1 301 This is a weirdo text message swsclose
|
HTTP/1.1 301 This is a weirdo text message swsclose
|
||||||
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||||
Server: test-server/fake
|
Server: test-server/fake
|
||||||
%if hyper
|
|
||||||
Location: /online/1,1795,Welcome,00.html/%TESTNUMBER0002.txt?logout=TRUE
|
Location: /online/1,1795,Welcome,00.html/%TESTNUMBER0002.txt?logout=TRUE
|
||||||
%else
|
|
||||||
Location: /online/1,1795,Welcome,00.html/%TESTNUMBER0002.txt?logout=TRUE
|
|
||||||
%endif
|
|
||||||
Connection: close
|
Connection: close
|
||||||
|
|
||||||
HTTP/1.1 200 Followed here fine swsclose
|
HTTP/1.1 200 Followed here fine swsclose
|
||||||
|
|||||||
@ -23,9 +23,6 @@ MooMoo
|
|||||||
<server>
|
<server>
|
||||||
http
|
http
|
||||||
</server>
|
</server>
|
||||||
<features>
|
|
||||||
!hyper
|
|
||||||
</features>
|
|
||||||
<name>
|
<name>
|
||||||
CURLOPT_HTTP200ALIASES
|
CURLOPT_HTTP200ALIASES
|
||||||
</name>
|
</name>
|
||||||
|
|||||||
@ -37,7 +37,6 @@ verify
|
|||||||
<client>
|
<client>
|
||||||
<features>
|
<features>
|
||||||
SSL
|
SSL
|
||||||
!hyper
|
|
||||||
</features>
|
</features>
|
||||||
<server>
|
<server>
|
||||||
https
|
https
|
||||||
|
|||||||
@ -9,10 +9,6 @@ cookiejar
|
|||||||
</info>
|
</info>
|
||||||
# Server-side
|
# Server-side
|
||||||
#
|
#
|
||||||
# The cookies set come in two versions. This is because when curl is built
|
|
||||||
# with Hyper, the API provides the headers already "sanitized" so we cannot
|
|
||||||
# compare with the exact server contents unless it too sends the data
|
|
||||||
# "clean".
|
|
||||||
|
|
||||||
<reply>
|
<reply>
|
||||||
<data>
|
<data>
|
||||||
@ -23,7 +19,6 @@ Content-Length: 4
|
|||||||
Content-Type: text/html
|
Content-Type: text/html
|
||||||
Funny-head: yesyes
|
Funny-head: yesyes
|
||||||
Set-Cookie: blankdomain=sure; domain=; path=/
|
Set-Cookie: blankdomain=sure; domain=; path=/
|
||||||
%if !hyper
|
|
||||||
Set-Cookie: foobar=name; domain=anything.com; path=/ ; secure
|
Set-Cookie: foobar=name; domain=anything.com; path=/ ; secure
|
||||||
Set-Cookie:ismatch=this ; domain=test31.curl; path=/silly/
|
Set-Cookie:ismatch=this ; domain=test31.curl; path=/silly/
|
||||||
Set-Cookie:ISMATCH=this ; domain=test31.curl; path=/silly/
|
Set-Cookie:ISMATCH=this ; domain=test31.curl; path=/silly/
|
||||||
@ -73,57 +68,6 @@ Set-Cookie: withspaces= yes within and around ;
|
|||||||
Set-Cookie: withspaces2 =before equals;
|
Set-Cookie: withspaces2 =before equals;
|
||||||
Set-Cookie: prespace= yes before;
|
Set-Cookie: prespace= yes before;
|
||||||
Set-Cookie: securewithspace=after ; secure =
|
Set-Cookie: securewithspace=after ; secure =
|
||||||
%else
|
|
||||||
Set-Cookie: foobar=name; domain=anything.com; path=/ ; secure
|
|
||||||
Set-Cookie: ismatch=this ; domain=test31.curl; path=/silly/
|
|
||||||
Set-Cookie:ISMATCH=this ; domain=test31.curl; path=/silly/
|
|
||||||
Set-Cookie: overwrite=this ; domain=test31.curl; path=/overwrite/
|
|
||||||
Set-Cookie: overwrite=this2 ; domain=test31.curl; path=/overwrite
|
|
||||||
Set-Cookie: sec1value=secure1 ; domain=test31.curl; path=/secure1/ ; secure
|
|
||||||
Set-Cookie: sec2value=secure2 ; domain=test31.curl; path=/secure2/ ; secure=
|
|
||||||
Set-Cookie: sec3value=secure3 ; domain=test31.curl; path=/secure3/ ; secure=
|
|
||||||
Set-Cookie: sec4value=secure4 ; secure=; domain=test31.curl; path=/secure4/ ;
|
|
||||||
Set-Cookie: sec5value=secure5 ; secure; domain=test31.curl; path=/secure5/ ;
|
|
||||||
Set-Cookie: sec6value=secure6 ; secure ; domain=test31.curl; path=/secure6/ ;
|
|
||||||
Set-Cookie: sec7value=secure7 ; secure ; domain=test31.curl; path=/secure7/ ;
|
|
||||||
Set-Cookie: sec8value=secure8 ; secure= ; domain=test31.curl; path=/secure8/ ;
|
|
||||||
Set-Cookie: secure=very1 ; secure=; domain=test31.curl; path=/secure9/;
|
|
||||||
Set-Cookie: httpo1=value1 ; domain=test31.curl; path=/p1/; httponly
|
|
||||||
Set-Cookie: httpo2=value2 ; domain=test31.curl; path=/p2/; httponly=
|
|
||||||
Set-Cookie: httpo3=value3 ; httponly; domain=test31.curl; path=/p3/;
|
|
||||||
Set-Cookie: httpo4=value4 ; httponly=; domain=test31.curl; path=/p4/;
|
|
||||||
Set-Cookie: httponly=myvalue1 ; domain=test31.curl; path=/p4/; httponly
|
|
||||||
Set-Cookie: httpandsec=myvalue2 ; domain=test31.curl; path=/p4/; httponly; secure
|
|
||||||
Set-Cookie: httpandsec2=myvalue3; domain=test31.curl; path=/p4/; httponly=; secure
|
|
||||||
Set-Cookie: httpandsec3=myvalue4 ; domain=test31.curl; path=/p4/; httponly; secure=
|
|
||||||
Set-Cookie: httpandsec4=myvalue5 ; domain=test31.curl; path=/p4/; httponly=; secure=
|
|
||||||
Set-Cookie: httpandsec5=myvalue6 ; domain=test31.curl; path=/p4/; secure; httponly=
|
|
||||||
Set-Cookie: httpandsec6=myvalue7 ; domain=test31.curl; path=/p4/; secure=; httponly=
|
|
||||||
Set-Cookie: httpandsec7=myvalue8 ; domain=test31.curl; path=/p4/; secure; httponly
|
|
||||||
Set-Cookie: httpandsec8=myvalue9; domain=test31.curl; path=/p4/; secure=; httponly
|
|
||||||
Set-Cookie: partmatch=present; domain=test31.curl ; path=/;
|
|
||||||
Set-Cookie: eat=this; domain=moo.foo.moo;
|
|
||||||
Set-Cookie: eat=this-too; domain=.foo.moo;
|
|
||||||
Set-Cookie: nodomainnovalue
|
|
||||||
%if large-time
|
|
||||||
Set-Cookie: nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2525
|
|
||||||
Set-Cookie: novalue; domain=reallysilly
|
|
||||||
Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2525
|
|
||||||
Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2525
|
|
||||||
%else
|
|
||||||
Set-Cookie: nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2037
|
|
||||||
Set-Cookie: novalue; domain=reallysilly
|
|
||||||
Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
|
|
||||||
Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2030
|
|
||||||
%endif
|
|
||||||
Set-Cookie: magic=yessir; path=/silly/; HttpOnly
|
|
||||||
Set-Cookie: blexp=yesyes; domain=test31.curl; domain=test31.curl; expiry=totally bad;
|
|
||||||
Set-Cookie: partialip=nono; domain=.0.0.1;
|
|
||||||
Set-Cookie: withspaces= yes within and around ;
|
|
||||||
Set-Cookie: withspaces2 =before equals;
|
|
||||||
Set-Cookie: prespace= yes before;
|
|
||||||
Set-Cookie: securewithspace=after ; secure =
|
|
||||||
%endif
|
|
||||||
|
|
||||||
boo
|
boo
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@ -39,9 +39,6 @@ line 1
|
|||||||
#
|
#
|
||||||
# Client-side
|
# Client-side
|
||||||
<client>
|
<client>
|
||||||
<features>
|
|
||||||
!hyper
|
|
||||||
</features>
|
|
||||||
<server>
|
<server>
|
||||||
http
|
http
|
||||||
</server>
|
</server>
|
||||||
|
|||||||
@ -40,14 +40,10 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/save-%TESTNUMBER --remove-on-err
|
|||||||
</client>
|
</client>
|
||||||
|
|
||||||
#
|
#
|
||||||
# Verify data after the test has been "shot". hyper doesn't do error 18
|
# Verify data after the test has been "shot"
|
||||||
<verify>
|
<verify>
|
||||||
<errorcode>
|
<errorcode>
|
||||||
%if hyper
|
|
||||||
56
|
|
||||||
%else
|
|
||||||
18
|
18
|
||||||
%endif
|
|
||||||
</errorcode>
|
</errorcode>
|
||||||
<protocol>
|
<protocol>
|
||||||
GET /%TESTNUMBER HTTP/1.1
|
GET /%TESTNUMBER HTTP/1.1
|
||||||
|
|||||||
@ -43,14 +43,10 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/save --remove-on-error --no-clob
|
|||||||
</client>
|
</client>
|
||||||
|
|
||||||
#
|
#
|
||||||
# Verify data after the test has been "shot". hyper doesn't do error 18
|
# Verify data after the test has been "shot".
|
||||||
<verify>
|
<verify>
|
||||||
<errorcode>
|
<errorcode>
|
||||||
%if hyper
|
|
||||||
56
|
|
||||||
%else
|
|
||||||
18
|
18
|
||||||
%endif
|
|
||||||
</errorcode>
|
</errorcode>
|
||||||
<protocol>
|
<protocol>
|
||||||
GET /%TESTNUMBER HTTP/1.1
|
GET /%TESTNUMBER HTTP/1.1
|
||||||
|
|||||||
@ -18,11 +18,7 @@ Server: test-server/fake
|
|||||||
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
|
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
|
||||||
ETag: "21025-dc7-39462498"
|
ETag: "21025-dc7-39462498"
|
||||||
Accept-Ranges: bytes
|
Accept-Ranges: bytes
|
||||||
%if hyper
|
|
||||||
Content-Length: 3689348814741910323
|
|
||||||
%else
|
|
||||||
Content-Length: 36893488147419103232
|
Content-Length: 36893488147419103232
|
||||||
%endif
|
|
||||||
Connection: close
|
Connection: close
|
||||||
Content-Type: text/html
|
Content-Type: text/html
|
||||||
Funny-head: yesyes
|
Funny-head: yesyes
|
||||||
|
|||||||
@ -44,11 +44,7 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER
|
|||||||
# Verify data after the test has been "shot"
|
# Verify data after the test has been "shot"
|
||||||
<verify>
|
<verify>
|
||||||
<errorcode>
|
<errorcode>
|
||||||
%if hyper
|
|
||||||
1
|
|
||||||
%else
|
|
||||||
8
|
8
|
||||||
%endif
|
|
||||||
</errorcode>
|
</errorcode>
|
||||||
<protocol>
|
<protocol>
|
||||||
GET /%TESTNUMBER HTTP/1.1
|
GET /%TESTNUMBER HTTP/1.1
|
||||||
|
|||||||
@ -49,12 +49,5 @@ User-Agent: curl/%VERSION
|
|||||||
Accept: */*
|
Accept: */*
|
||||||
|
|
||||||
</protocol>
|
</protocol>
|
||||||
|
|
||||||
# hyper cannot work with too-large content-length
|
|
||||||
%if hyper
|
|
||||||
<errorcode>
|
|
||||||
1
|
|
||||||
</errorcode>
|
|
||||||
%endif
|
|
||||||
</verify>
|
</verify>
|
||||||
</testcase>
|
</testcase>
|
||||||
|
|||||||
@ -54,11 +54,7 @@ Accept: */*
|
|||||||
|
|
||||||
</protocol>
|
</protocol>
|
||||||
<errorcode>
|
<errorcode>
|
||||||
%if hyper
|
|
||||||
1
|
|
||||||
%else
|
|
||||||
8
|
8
|
||||||
%endif
|
|
||||||
</errorcode>
|
</errorcode>
|
||||||
</verify>
|
</verify>
|
||||||
</testcase>
|
</testcase>
|
||||||
|
|||||||
@ -26,11 +26,7 @@ body
|
|||||||
</data2>
|
</data2>
|
||||||
<datacheck>
|
<datacheck>
|
||||||
HTTP/1.1 302 OK swsclose
|
HTTP/1.1 302 OK swsclose
|
||||||
%if !hyper
|
|
||||||
Location: ../moo.html/?name=d a niel&testcase=/%TESTNUMBER0002
|
Location: ../moo.html/?name=d a niel&testcase=/%TESTNUMBER0002
|
||||||
%else
|
|
||||||
Location: ../moo.html/?name=d a niel&testcase=/%TESTNUMBER0002
|
|
||||||
%endif
|
|
||||||
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||||
Connection: close
|
Connection: close
|
||||||
|
|
||||||
|
|||||||
@ -19,11 +19,8 @@ Funny-head: yesyes
|
|||||||
moooooooooooo
|
moooooooooooo
|
||||||
</data>
|
</data>
|
||||||
<datacheck>
|
<datacheck>
|
||||||
%if hyper
|
|
||||||
%else
|
|
||||||
HTTP/1.1 200 OK swsclose
|
HTTP/1.1 200 OK swsclose
|
||||||
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||||
%endif
|
|
||||||
</datacheck>
|
</datacheck>
|
||||||
</reply>
|
</reply>
|
||||||
|
|
||||||
@ -52,14 +49,9 @@ Accept: */*
|
|||||||
|
|
||||||
</protocol>
|
</protocol>
|
||||||
|
|
||||||
# Hyper curl returns unsupported protocol
|
|
||||||
# built-in curl returns weird_server_reply
|
# built-in curl returns weird_server_reply
|
||||||
<errorcode>
|
<errorcode>
|
||||||
%if hyper
|
|
||||||
1
|
|
||||||
%else
|
|
||||||
8
|
8
|
||||||
%endif
|
|
||||||
</errorcode>
|
</errorcode>
|
||||||
</verify>
|
</verify>
|
||||||
</testcase>
|
</testcase>
|
||||||
|
|||||||
@ -26,11 +26,7 @@ body
|
|||||||
</data2>
|
</data2>
|
||||||
<datacheck>
|
<datacheck>
|
||||||
HTTP/1.1 302 OK swsclose
|
HTTP/1.1 302 OK swsclose
|
||||||
%if !hyper
|
|
||||||
Location: ../m o o.html/%TESTNUMBER0002
|
Location: ../m o o.html/%TESTNUMBER0002
|
||||||
%else
|
|
||||||
Location: ../m o o.html/%TESTNUMBER0002
|
|
||||||
%endif
|
|
||||||
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||||
Connection: close
|
Connection: close
|
||||||
|
|
||||||
|
|||||||
@ -28,9 +28,6 @@ Funny-head: yesyes
|
|||||||
#
|
#
|
||||||
# Client-side
|
# Client-side
|
||||||
<client>
|
<client>
|
||||||
<features>
|
|
||||||
!hyper
|
|
||||||
</features>
|
|
||||||
<server>
|
<server>
|
||||||
http
|
http
|
||||||
</server>
|
</server>
|
||||||
|
|||||||
@ -49,14 +49,8 @@ Accept: */*
|
|||||||
|
|
||||||
</protocol>
|
</protocol>
|
||||||
# curl: (56) Too large response headers: 307215 > 307200
|
# curl: (56) Too large response headers: 307215 > 307200
|
||||||
# hyper returns a generic error that libcurl converts to an even more
|
|
||||||
# generic error
|
|
||||||
<errorcode>
|
<errorcode>
|
||||||
%if hyper
|
|
||||||
1
|
|
||||||
%else
|
|
||||||
56
|
56
|
||||||
%endif
|
|
||||||
</errorcode>
|
</errorcode>
|
||||||
</verify>
|
</verify>
|
||||||
</testcase>
|
</testcase>
|
||||||
|
|||||||
@ -43,14 +43,8 @@ http://%HOSTIP:%HTTPPORT/%TESTNUMBER --max-redirs 400 --location
|
|||||||
# Verify data after the test has been "shot"
|
# Verify data after the test has been "shot"
|
||||||
<verify>
|
<verify>
|
||||||
# curl: (56) Too large response headers: 6144086 > 6144000
|
# curl: (56) Too large response headers: 6144086 > 6144000
|
||||||
# hyper returns a generic error that libcurl converts to an even more
|
|
||||||
# generic error
|
|
||||||
<errorcode>
|
<errorcode>
|
||||||
%if hyper
|
|
||||||
1
|
|
||||||
%else
|
|
||||||
56
|
56
|
||||||
%endif
|
|
||||||
</errorcode>
|
</errorcode>
|
||||||
</verify>
|
</verify>
|
||||||
</testcase>
|
</testcase>
|
||||||
|
|||||||
@ -56,11 +56,7 @@ one
|
|||||||
two
|
two
|
||||||
5
|
5
|
||||||
three
|
three
|
||||||
%if hyper
|
|
||||||
1D
|
|
||||||
%else
|
|
||||||
1d
|
1d
|
||||||
%endif
|
|
||||||
and a final longer crap: four
|
and a final longer crap: four
|
||||||
0
|
0
|
||||||
|
|
||||||
|
|||||||
@ -52,11 +52,7 @@ Accept: */*
|
|||||||
Transfer-Encoding: chunked
|
Transfer-Encoding: chunked
|
||||||
Content-Type: application/x-www-form-urlencoded
|
Content-Type: application/x-www-form-urlencoded
|
||||||
|
|
||||||
%if hyper
|
|
||||||
C
|
|
||||||
%else
|
|
||||||
c
|
c
|
||||||
%endif
|
|
||||||
we post this
|
we post this
|
||||||
0
|
0
|
||||||
|
|
||||||
|
|||||||
@ -100,11 +100,7 @@ one
|
|||||||
two
|
two
|
||||||
5
|
5
|
||||||
three
|
three
|
||||||
%if hyper
|
|
||||||
1D
|
|
||||||
%else
|
|
||||||
1d
|
1d
|
||||||
%endif
|
|
||||||
and a final longer crap: four
|
and a final longer crap: four
|
||||||
0
|
0
|
||||||
|
|
||||||
|
|||||||
@ -43,9 +43,7 @@ Host: %HOSTIP:%HTTPPORT
|
|||||||
User-Agent: curl/%VERSION
|
User-Agent: curl/%VERSION
|
||||||
Accept: */*
|
Accept: */*
|
||||||
Transfer-Encoding: chunked
|
Transfer-Encoding: chunked
|
||||||
%if !hyper
|
|
||||||
Content-Length: 1
|
Content-Length: 1
|
||||||
%endif
|
|
||||||
Expect: 100-continue
|
Expect: 100-continue
|
||||||
|
|
||||||
13
|
13
|
||||||
|
|||||||
@ -76,11 +76,7 @@ Transfer-Encoding: chunked
|
|||||||
Content-Type: multipart/form-data; boundary=----------------------------
|
Content-Type: multipart/form-data; boundary=----------------------------
|
||||||
Expect: 100-continue
|
Expect: 100-continue
|
||||||
|
|
||||||
%if hyper
|
|
||||||
7C
|
|
||||||
%else
|
|
||||||
7c
|
7c
|
||||||
%endif
|
|
||||||
------------------------------
|
------------------------------
|
||||||
Content-Disposition: form-data; name="sendfile"; filename="postit2.c"
|
Content-Disposition: form-data; name="sendfile"; filename="postit2.c"
|
||||||
|
|
||||||
@ -96,11 +92,7 @@ y
|
|||||||
1
|
1
|
||||||
|
|
||||||
|
|
||||||
%if hyper
|
|
||||||
6B
|
|
||||||
%else
|
|
||||||
6b
|
6b
|
||||||
%endif
|
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
Content-Disposition: form-data; name="callbackdata"
|
Content-Disposition: form-data; name="callbackdata"
|
||||||
@ -119,11 +111,7 @@ y
|
|||||||
1
|
1
|
||||||
|
|
||||||
|
|
||||||
%if hyper
|
|
||||||
1B2
|
|
||||||
%else
|
|
||||||
1b2
|
1b2
|
||||||
%endif
|
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
Content-Disposition: form-data; name="filename"
|
Content-Disposition: form-data; name="filename"
|
||||||
@ -149,11 +137,7 @@ Transfer-Encoding: chunked
|
|||||||
Content-Type: multipart/form-data; boundary=----------------------------
|
Content-Type: multipart/form-data; boundary=----------------------------
|
||||||
Expect: 100-continue
|
Expect: 100-continue
|
||||||
|
|
||||||
%if hyper
|
|
||||||
8A
|
|
||||||
%else
|
|
||||||
8a
|
8a
|
||||||
%endif
|
|
||||||
------------------------------
|
------------------------------
|
||||||
Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2"
|
Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2"
|
||||||
|
|
||||||
@ -169,11 +153,7 @@ y
|
|||||||
1
|
1
|
||||||
|
|
||||||
|
|
||||||
%if hyper
|
|
||||||
6B
|
|
||||||
%else
|
|
||||||
6b
|
6b
|
||||||
%endif
|
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
Content-Disposition: form-data; name="callbackdata"
|
Content-Disposition: form-data; name="callbackdata"
|
||||||
@ -192,11 +172,7 @@ y
|
|||||||
1
|
1
|
||||||
|
|
||||||
|
|
||||||
%if hyper
|
|
||||||
1B2
|
|
||||||
%else
|
|
||||||
1b2
|
1b2
|
||||||
%endif
|
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
Content-Disposition: form-data; name="filename"
|
Content-Disposition: form-data; name="filename"
|
||||||
|
|||||||
@ -104,11 +104,7 @@ Content-Disposition: attachment; filename="test%TESTNUMBER.filedata"
|
|||||||
Content-Type: text/whatever
|
Content-Type: text/whatever
|
||||||
|
|
||||||
|
|
||||||
%if hyper
|
|
||||||
AB
|
|
||||||
%else
|
|
||||||
ab
|
ab
|
||||||
%endif
|
|
||||||
This is data from a file.
|
This is data from a file.
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
@ -116,11 +112,7 @@ Content-Disposition: attachment; filename="test%TESTNUMBER.filedata"
|
|||||||
Content-Type: text/whatever
|
Content-Type: text/whatever
|
||||||
|
|
||||||
|
|
||||||
%if hyper
|
|
||||||
BB
|
|
||||||
%else
|
|
||||||
bb
|
bb
|
||||||
%endif
|
|
||||||
This is data from a file.
|
This is data from a file.
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
@ -129,11 +121,7 @@ This is data from a file.
|
|||||||
Content-Disposition: form-data; name="filecontents"
|
Content-Disposition: form-data; name="filecontents"
|
||||||
|
|
||||||
|
|
||||||
%if hyper
|
|
||||||
11B
|
|
||||||
%else
|
|
||||||
11b
|
11b
|
||||||
%endif
|
|
||||||
This is data from a file.
|
This is data from a file.
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
@ -188,11 +176,7 @@ Content-Disposition: attachment; filename="test%TESTNUMBER.filedata"
|
|||||||
Content-Type: text/whatever
|
Content-Type: text/whatever
|
||||||
|
|
||||||
|
|
||||||
%if hyper
|
|
||||||
AB
|
|
||||||
%else
|
|
||||||
ab
|
ab
|
||||||
%endif
|
|
||||||
This is data from a file.
|
This is data from a file.
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
@ -200,11 +184,7 @@ Content-Disposition: attachment; filename="test%TESTNUMBER.filedata"
|
|||||||
Content-Type: text/whatever
|
Content-Type: text/whatever
|
||||||
|
|
||||||
|
|
||||||
%if hyper
|
|
||||||
BB
|
|
||||||
%else
|
|
||||||
bb
|
bb
|
||||||
%endif
|
|
||||||
This is data from a file.
|
This is data from a file.
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
@ -213,11 +193,7 @@ This is data from a file.
|
|||||||
Content-Disposition: form-data; name="filecontents"
|
Content-Disposition: form-data; name="filecontents"
|
||||||
|
|
||||||
|
|
||||||
%if hyper
|
|
||||||
11B
|
|
||||||
%else
|
|
||||||
11b
|
11b
|
||||||
%endif
|
|
||||||
This is data from a file.
|
This is data from a file.
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|||||||
@ -84,11 +84,7 @@ Transfer-Encoding: chunked
|
|||||||
Content-Type: multipart/form-data; boundary=----------------------------
|
Content-Type: multipart/form-data; boundary=----------------------------
|
||||||
Expect: 100-continue
|
Expect: 100-continue
|
||||||
|
|
||||||
%if hyper
|
|
||||||
1C1
|
|
||||||
%else
|
|
||||||
1c1
|
1c1
|
||||||
%endif
|
|
||||||
------------------------------
|
------------------------------
|
||||||
Content-Disposition: form-data; name="greeting"
|
Content-Disposition: form-data; name="greeting"
|
||||||
Content-Type: application/X-Greeting
|
Content-Type: application/X-Greeting
|
||||||
|
|||||||
@ -15,9 +15,6 @@ no headers swsclose
|
|||||||
|
|
||||||
# Client-side
|
# Client-side
|
||||||
<client>
|
<client>
|
||||||
<features>
|
|
||||||
!hyper
|
|
||||||
</features>
|
|
||||||
<server>
|
<server>
|
||||||
http
|
http
|
||||||
</server>
|
</server>
|
||||||
|
|||||||
@ -77,11 +77,7 @@ Content-Transfer-Encoding: base64
|
|||||||
|
|
||||||
4
|
4
|
||||||
ZHVt
|
ZHVt
|
||||||
%if hyper
|
|
||||||
3A
|
|
||||||
%else
|
|
||||||
3a
|
3a
|
||||||
%endif
|
|
||||||
bXk=
|
bXk=
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
|
|||||||
@ -72,11 +72,7 @@ Transfer-Encoding: chunked
|
|||||||
Content-Type: multipart/form-data; boundary=----------------------------
|
Content-Type: multipart/form-data; boundary=----------------------------
|
||||||
Expect: 100-continue
|
Expect: 100-continue
|
||||||
|
|
||||||
%if hyper
|
|
||||||
CD
|
|
||||||
%else
|
|
||||||
cd
|
cd
|
||||||
%endif
|
|
||||||
------------------------------
|
------------------------------
|
||||||
Content-Disposition: form-data; name="field1"
|
Content-Disposition: form-data; name="field1"
|
||||||
|
|
||||||
@ -94,11 +90,7 @@ Content-Disposition: form-data; name="field3"; filename="file%TESTNUMBER.txt"
|
|||||||
Content-Type: text/plain
|
Content-Type: text/plain
|
||||||
|
|
||||||
|
|
||||||
%if hyper
|
|
||||||
4F
|
|
||||||
%else
|
|
||||||
4f
|
4f
|
||||||
%endif
|
|
||||||
This is data from a file
|
This is data from a file
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|||||||
@ -450,15 +450,14 @@ class ScoreCard:
|
|||||||
p['name'] = 'h2'
|
p['name'] = 'h2'
|
||||||
if not self.env.have_h2_curl():
|
if not self.env.have_h2_curl():
|
||||||
raise ScoreCardError('curl does not support HTTP/2')
|
raise ScoreCardError('curl does not support HTTP/2')
|
||||||
for lib in ['nghttp2', 'hyper']:
|
for lib in ['nghttp2']:
|
||||||
if self.env.curl_uses_lib(lib):
|
if self.env.curl_uses_lib(lib):
|
||||||
p['implementation'] = lib
|
p['implementation'] = lib
|
||||||
break
|
break
|
||||||
elif self.protocol == 'h1' or self.protocol == 'http/1.1':
|
elif self.protocol == 'h1' or self.protocol == 'http/1.1':
|
||||||
proto = 'http/1.1'
|
proto = 'http/1.1'
|
||||||
p['name'] = proto
|
p['name'] = proto
|
||||||
p['implementation'] = 'hyper' if self.env.curl_uses_lib('hyper')\
|
p['implementation'] = 'native'
|
||||||
else 'native'
|
|
||||||
else:
|
else:
|
||||||
raise ScoreCardError(f"unknown protocol: {self.protocol}")
|
raise ScoreCardError(f"unknown protocol: {self.protocol}")
|
||||||
|
|
||||||
|
|||||||
@ -356,8 +356,7 @@ sub prepro {
|
|||||||
# The processor does CRLF replacements in the <data*> sections if
|
# The processor does CRLF replacements in the <data*> sections if
|
||||||
# necessary since those parts might be read by separate servers.
|
# necessary since those parts might be read by separate servers.
|
||||||
if($s =~ /^ *<data(.*)\>/) {
|
if($s =~ /^ *<data(.*)\>/) {
|
||||||
if($1 =~ /crlf="yes"/ ||
|
if($1 =~ /crlf="yes"/) {
|
||||||
($feature{"hyper"} && ($keywords{"HTTP"} || $keywords{"HTTPS"}))) {
|
|
||||||
$data_crlf = 1;
|
$data_crlf = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -591,11 +591,8 @@ sub checksystemfeatures {
|
|||||||
$feature{"c-ares"} = 1;
|
$feature{"c-ares"} = 1;
|
||||||
$resolver="c-ares";
|
$resolver="c-ares";
|
||||||
}
|
}
|
||||||
if ($libcurl =~ /Hyper/i) {
|
|
||||||
$feature{"hyper"} = 1;
|
|
||||||
}
|
|
||||||
if ($libcurl =~ /nghttp2/i) {
|
if ($libcurl =~ /nghttp2/i) {
|
||||||
# nghttp2 supports h2c, hyper does not
|
# nghttp2 supports h2c
|
||||||
$feature{"h2c"} = 1;
|
$feature{"h2c"} = 1;
|
||||||
}
|
}
|
||||||
if ($libcurl =~ /AppleIDN/) {
|
if ($libcurl =~ /AppleIDN/) {
|
||||||
@ -1286,9 +1283,7 @@ sub singletest_check {
|
|||||||
chomp($validstdout[-1]);
|
chomp($validstdout[-1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($hash{'crlf'} ||
|
if($hash{'crlf'}) {
|
||||||
($feature{"hyper"} && ($keywords{"HTTP"}
|
|
||||||
|| $keywords{"HTTPS"}))) {
|
|
||||||
subnewlines(0, \$_) for @validstdout;
|
subnewlines(0, \$_) for @validstdout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1326,12 +1321,6 @@ sub singletest_check {
|
|||||||
|
|
||||||
# get the mode attribute
|
# get the mode attribute
|
||||||
my $filemode=$hash{'mode'};
|
my $filemode=$hash{'mode'};
|
||||||
if($filemode && ($filemode eq "text") && $feature{"hyper"}) {
|
|
||||||
# text mode check in hyper-mode. Sometimes necessary if the stderr
|
|
||||||
# data *looks* like HTTP and thus has gotten CRLF newlines
|
|
||||||
# mistakenly
|
|
||||||
normalize_text(\@validstderr);
|
|
||||||
}
|
|
||||||
if($filemode && ($filemode eq "text")) {
|
if($filemode && ($filemode eq "text")) {
|
||||||
normalize_text(\@validstderr);
|
normalize_text(\@validstderr);
|
||||||
normalize_text(\@actual);
|
normalize_text(\@actual);
|
||||||
@ -1434,9 +1423,7 @@ sub singletest_check {
|
|||||||
# of the datacheck
|
# of the datacheck
|
||||||
chomp($replycheckpart[-1]);
|
chomp($replycheckpart[-1]);
|
||||||
}
|
}
|
||||||
if($replycheckpartattr{'crlf'} ||
|
if($replycheckpartattr{'crlf'}) {
|
||||||
($feature{"hyper"} && ($keywords{"HTTP"}
|
|
||||||
|| $keywords{"HTTPS"}))) {
|
|
||||||
subnewlines(0, \$_) for @replycheckpart;
|
subnewlines(0, \$_) for @replycheckpart;
|
||||||
}
|
}
|
||||||
push(@reply, @replycheckpart);
|
push(@reply, @replycheckpart);
|
||||||
@ -1457,9 +1444,7 @@ sub singletest_check {
|
|||||||
if($filemode && ($filemode eq "text")) {
|
if($filemode && ($filemode eq "text")) {
|
||||||
normalize_text(\@reply);
|
normalize_text(\@reply);
|
||||||
}
|
}
|
||||||
if($replyattr{'crlf'} ||
|
if($replyattr{'crlf'}) {
|
||||||
($feature{"hyper"} && ($keywords{"HTTP"}
|
|
||||||
|| $keywords{"HTTPS"}))) {
|
|
||||||
subnewlines(0, \$_) for @reply;
|
subnewlines(0, \$_) for @reply;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1552,8 +1537,7 @@ sub singletest_check {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($hash{'crlf'} ||
|
if($hash{'crlf'}) {
|
||||||
($feature{"hyper"} && ($keywords{"HTTP"} || $keywords{"HTTPS"}))) {
|
|
||||||
subnewlines(0, \$_) for @proxyprot;
|
subnewlines(0, \$_) for @proxyprot;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1611,9 +1595,7 @@ sub singletest_check {
|
|||||||
normalize_text(\@outfile);
|
normalize_text(\@outfile);
|
||||||
normalize_text(\@generated);
|
normalize_text(\@generated);
|
||||||
}
|
}
|
||||||
if($hash{'crlf'} ||
|
if($hash{'crlf'}) {
|
||||||
($feature{"hyper"} && ($keywords{"HTTP"}
|
|
||||||
|| $keywords{"HTTPS"}))) {
|
|
||||||
subnewlines(0, \$_) for @outfile;
|
subnewlines(0, \$_) for @outfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -150,13 +150,6 @@ sub subnewlines {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# When curl is built with Hyper, it gets all response headers delivered as
|
|
||||||
# name/value pairs and curl "invents" the newlines when it saves the
|
|
||||||
# headers. Therefore, curl will always save headers with CRLF newlines
|
|
||||||
# when built to use Hyper. By making sure we deliver all tests using CRLF
|
|
||||||
# as well, all test comparisons will survive without knowing about this
|
|
||||||
# little quirk.
|
|
||||||
|
|
||||||
if(($$thing =~ /^HTTP\/(1.1|1.0|2|3) [1-5][^\x0d]*\z/) ||
|
if(($$thing =~ /^HTTP\/(1.1|1.0|2|3) [1-5][^\x0d]*\z/) ||
|
||||||
($$thing =~ /^(GET|POST|PUT|DELETE) \S+ HTTP\/\d+(\.\d+)?/) ||
|
($$thing =~ /^(GET|POST|PUT|DELETE) \S+ HTTP\/\d+(\.\d+)?/) ||
|
||||||
(($$thing =~ /^[a-z0-9_-]+: [^\x0d]*\z/i) &&
|
(($$thing =~ /^[a-z0-9_-]+: [^\x0d]*\z/i) &&
|
||||||
|
|||||||
@ -1,12 +1,3 @@
|
|||||||
{
|
|
||||||
zstd_decompression-1.3.3-on-Ubuntu-18.04_with_hyper
|
|
||||||
Memcheck:Cond
|
|
||||||
fun:ZSTD_decompressStream
|
|
||||||
fun:zstd_unencode_write
|
|
||||||
fun:Curl_unencode_write
|
|
||||||
fun:hyper_body_chunk
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
zstd_decompression-1.3.3-on-Ubuntu-18.04
|
zstd_decompression-1.3.3-on-Ubuntu-18.04
|
||||||
Memcheck:Cond
|
Memcheck:Cond
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user