I did this
Run (this particular script on macOS):
#!/bin/sh
alias curl='/usr/local/opt/curl-openssl/bin/curl -sS -X PUT https://jsonplaceholder.typicode.com/put/ --data-binary @-'
# OK
dd if=/dev/zero bs=64k count=1 2> /dev/null | curl --http1.1
dd if=/dev/zero bs=64k count=2 2> /dev/null | curl --http1.1
dd if=/dev/zero bs=64k count=3 2> /dev/null | curl --http1.1
dd if=/dev/zero bs=64k count=4 2> /dev/null | curl --http1.1
# OK
dd if=/dev/zero bs=64k count=1 2> /dev/null | curl
dd if=/dev/zero bs=64k count=2 2> /dev/null | curl
# FAIL
dd if=/dev/zero bs=64k count=3 2> /dev/null | curl
dd if=/dev/zero bs=64k count=4 2> /dev/null | curl
Outputs for the FAIL cases above:
curl: (92) HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)
[...]
> User-Agent: curl/7.53.1
> Accept: */*
> Content-Length: 196608
> Content-Type: application/x-www-form-urlencoded
>.
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
* We are completely uploaded and fine
[60-second wait]
* HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)
* Closing connection 0
* TLSv1.2 (OUT), TLS alert, Client hello (1):
- Server log (nginx 1.10.2):
[...] "PUT /api/path/ HTTP/2.0" 408 0 "-" "curl/7.53.1" "-"
408 is: Request Timeout
I expected the following
Upload to finish successfully, the same way as in HTTP/1.1 mode and 64-128 KiB payloads with H2.
curl/libcurl version
macOS + Homebrew (brew install curl-openssl):
curl 7.53.1 (x86_64-apple-darwin16.4.0) libcurl/7.53.1 OpenSSL/1.0.2k zlib/1.2.8 libssh2/1.8.0 nghttp2/1.21.1
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy
Windows Server 2012 R2:
curl 7.53.1 (x86_64-pc-win32) libcurl/7.53.1 OpenSSL/1.1.0e zlib/1.2.11 WinIDN libssh2/1.8.0 nghttp2/1.21.1
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz TLS-SRP HTTP2 HTTPS-proxy
UPDATED 2019-02-06: Applied updates necessary for recent Homebrew versions (aka use curl-openssl package instead of a curl with custom options).
I did this
Run (this particular script on macOS):
Outputs for the FAIL cases above:
-voutput:408is: Request TimeoutI expected the following
Upload to finish successfully, the same way as in HTTP/1.1 mode and 64-128 KiB payloads with H2.
curl/libcurl version
macOS + Homebrew (
brew install curl-openssl):Windows Server 2012 R2:
UPDATED 2019-02-06: Applied updates necessary for recent Homebrew versions (aka use
curl-opensslpackage instead of acurlwith custom options).