Re: Question: Do APT support streaming download for metadata/deb?
David Kalnischkies <[email protected]>
| Newsgroups | gmane.linux.debian.apt.devel |
|---|---|
| Message-ID | <il23dci5fxnkmxgzvghmq5tr644vfqpk7vojinoe6xgmfqubky@haskvblxyqra> |
Am Sat, Sep 20, 2025 at 03:17:45PM +0000, schrieb 陈 溢飞: > To investigate, I deployed a simple HTTP server that forwards requests to/from <https://deb.debian.org>, while removing the `Content-Length` header. "Streaming" as you call it is not specified in the HTTP spec. You can't just drop Content-Length and have it working. That wget works is easily explained: It does HTTP1.0 requests, which are "Connection: close" by default, so the end of the message body is indicated by the server closing the connection in the absence of Content-Length. apt does http1.1 requests that are "Connection: keep-alive" by default. I don't know off hand why curl might deal with your broken server. Perhaps it falls back to http1.0 automatically, but we have no intention of replication such behaviour. See RFC 7230 and especially § '3.3.3 Message Body Length' as well as the other RFCs nowadays specifying HTTP. > It seems that APT may not support streaming downloads. The HTTP spec defines a chunked transfer encoding in case you don't know the Content-Length a priori and don't want to constantly close the connection – and apt supports that. That your Release file devoid of hashes is not a good idea should be obvious from the warnings apt gives to you as you need a rather big hammer to even have apt consider this a valid source even if you fix your server. Best regards David Kalnischkies
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE5sn+Q4uCja/tn0GrMRvlz3HQeIMFAmjQWQoACgkQMRvlz3HQ eIOFNA//bxKvJluoOxdfgAiF5k08NWYfpgBazPk1t9Cx+cw1k5EPEFcaxgcJd3WO rSJdqw4FhsQx6gNmV4WVHxULW1jgAYFWFqq1wnp3IDpY8LzyAUt6N5U1nOnNaLYC feJOV3EtV+fF+/QEnXnascDNwl0FFcaszOp7P3lIcCcv6gO1tLvtHJSSFX8qtX5w SHxgp/p8XGqK6qhCnw2hiWzuDSXVPyA+g8BLqFg+uSyuNSNBXVeu8xZeoMBfjmyV iYKGqr7c+uNL3UsD/NMAYUbAQr+5aE1/akKo7duShMY4sntiw5Cf+Sv6MAzc29N0 cDGCVgLCEdMmetcHbe8XveWbJG+MEEl6iMhgSBRNyHfrUu8fl0otsT94B65Yy3s3 ryhTuJTOd5cq7iArRLqtBSGKvl6oIpNk8D5p9KGKa/B/vGzOrEO8KLG/zNBF18Ti dkEtx64RABoyINTsRmZaxUZudp66wSG3cEzXSzSDr2PBy3K05V8YzhgXnrwJVLD/ +RSu0v2Drt99MjK2ajqtbFUzh23Io2jcRLSvMSVczwjUJ5/2LUdPsNj0/UvwAdyD r2F1umhjxxr6MYjbeTs6d/dU2dqxdhf1U8LJTAgVGhXb9WrTjSpTuRmk1WYsAJOI rCc6DYMU/2t4Ga973lNcVZxYTaEJUOW/9d3IGfOnQZedEBFZt9c= =NxHl -----END PGP SIGNATURE-----