Commit 58e0e7d
authored
fix(http2): fix internals of HTTP/2 CONNECT upgrades (#3967)
This refactors the way hyper handles HTTP/2 CONNECT / Extended CONNECT. Before,
an uninhabited enum was used to try to prevent sending of the `Buf` type once
the STREAM had been upgraded. However, the way it was originally written was
incorrect, and will eventually have compilation issues.
The change here is to spawn an extra task and use a channel to bridge the IO
operations of the `Upgraded` object to be `Cursor` buffers in the new task.
ref: rust-lang/rust#147588
Closes #3966
BREAKING CHANGE: The HTTP/2 client connection no longer allows an executor
that can not spawn itself.
This was an oversight originally. The client connection will now include spawning
a future that keeps a copy of the executor to spawn other futures. Thus, if it is
`!Send`, it needs to spawn `!Send` futures. The likelihood of executors that match
the previously allowed behavior should be very remote.
There is also technically a semver break in here, which is that the
`Http2ClientConnExec` trait no longer dyn-compatible, because it now expects to
be `Clone`. This should not break usage of the `conn` builder, because it already
separately had `E: Clone` bounds. If someone were using `dyn Http2ClientConnExec`,
that will break. However, there is no purpose for doing so, and it is not usable
otherwise, since the trait only exists to propagate bounds into hyper. Thus, the
breakage should not affect anyone.1 parent 0a37a8c commit 58e0e7d
File tree
7 files changed
+382
-288
lines changed- src
- client
- conn
- proto/h2
- rt
7 files changed
+382
-288
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
640 | 640 | | |
641 | 641 | | |
642 | 642 | | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | 643 | | |
682 | 644 | | |
683 | 645 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
| 328 | + | |
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
| 334 | + | |
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
342 | 342 | | |
343 | 343 | | |
| 344 | + | |
344 | 345 | | |
345 | 346 | | |
346 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | | - | |
| 30 | + | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
151 | 150 | | |
152 | 151 | | |
153 | 152 | | |
154 | | - | |
| 153 | + | |
155 | 154 | | |
156 | 155 | | |
157 | 156 | | |
| |||
357 | 356 | | |
358 | 357 | | |
359 | 358 | | |
360 | | - | |
| 359 | + | |
361 | 360 | | |
362 | 361 | | |
363 | 362 | | |
| |||
372 | 371 | | |
373 | 372 | | |
374 | 373 | | |
375 | | - | |
| 374 | + | |
376 | 375 | | |
377 | 376 | | |
378 | 377 | | |
| |||
381 | 380 | | |
382 | 381 | | |
383 | 382 | | |
384 | | - | |
| 383 | + | |
385 | 384 | | |
386 | 385 | | |
387 | 386 | | |
388 | 387 | | |
| 388 | + | |
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| |||
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
487 | | - | |
| 487 | + | |
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
| |||
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
| 532 | + | |
532 | 533 | | |
533 | 534 | | |
534 | 535 | | |
| |||
537 | 538 | | |
538 | 539 | | |
539 | 540 | | |
540 | | - | |
| 541 | + | |
541 | 542 | | |
542 | 543 | | |
543 | 544 | | |
544 | 545 | | |
545 | 546 | | |
546 | 547 | | |
547 | | - | |
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
| 551 | + | |
551 | 552 | | |
552 | 553 | | |
553 | 554 | | |
554 | | - | |
| 555 | + | |
555 | 556 | | |
556 | 557 | | |
| 558 | + | |
557 | 559 | | |
558 | 560 | | |
559 | 561 | | |
560 | | - | |
561 | | - | |
| 562 | + | |
| 563 | + | |
562 | 564 | | |
563 | 565 | | |
564 | 566 | | |
| |||
585 | 587 | | |
586 | 588 | | |
587 | 589 | | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
595 | 594 | | |
596 | 595 | | |
597 | 596 | | |
| |||
620 | 619 | | |
621 | 620 | | |
622 | 621 | | |
623 | | - | |
| 622 | + | |
624 | 623 | | |
625 | 624 | | |
626 | 625 | | |
| |||
0 commit comments