Mercurial > hg
comparison tests/test-http-api-httpv2.t @ 40138:b5bf3dd6ec5b
wireprotov2: send content encoded frames from server
Now that we have support for negotiating encodings and configuring
an encoder, we can start sending content encoded frames from the
server.
This commit teaches the wireprotov2 server code to send content
encoded frames.
On the mozilla-unified repository with zstd enabled peers, this change
reduces the total amount of data transferred from server to client
drastically:
befor: 7,190,995,812 bytes
after: 1,605,508,691 bytes
Differential Revision: https://phab.mercurial-scm.org/D4927
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 08 Oct 2018 17:24:28 -0700 |
parents | 762ef19a07e3 |
children | 41263df08109 |
comparison
equal
deleted
inserted
replaced
40137:ed4ebbb98ca0 | 40138:b5bf3dd6ec5b |
---|---|
174 s> Server: testing stub value\r\n | 174 s> Server: testing stub value\r\n |
175 s> Date: $HTTP_DATE$\r\n | 175 s> Date: $HTTP_DATE$\r\n |
176 s> Content-Type: application/mercurial-exp-framing-0006\r\n | 176 s> Content-Type: application/mercurial-exp-framing-0006\r\n |
177 s> Transfer-Encoding: chunked\r\n | 177 s> Transfer-Encoding: chunked\r\n |
178 s> \r\n | 178 s> \r\n |
179 s> 13\r\n | 179 s> 11\r\n |
180 s> \x0b\x00\x00\x01\x00\x02\x011\xa1FstatusBok | 180 s> \t\x00\x00\x01\x00\x02\x01\x92Hidentity |
181 s> \r\n | |
182 s> 13\r\n | |
183 s> \x0b\x00\x00\x01\x00\x02\x041\xa1FstatusBok | |
181 s> \r\n | 184 s> \r\n |
182 s> 27\r\n | 185 s> 27\r\n |
183 s> \x1f\x00\x00\x01\x00\x02\x001X\x1dcustomreadonly bytes response | 186 s> \x1f\x00\x00\x01\x00\x02\x041X\x1dcustomreadonly bytes response |
184 s> \r\n | 187 s> \r\n |
185 s> 8\r\n | 188 s> 8\r\n |
186 s> \x00\x00\x00\x01\x00\x02\x002 | 189 s> \x00\x00\x00\x01\x00\x02\x002 |
187 s> \r\n | 190 s> \r\n |
188 s> 0\r\n | 191 s> 0\r\n |
207 s> Server: testing stub value\r\n | 210 s> Server: testing stub value\r\n |
208 s> Date: $HTTP_DATE$\r\n | 211 s> Date: $HTTP_DATE$\r\n |
209 s> Content-Type: application/mercurial-exp-framing-0006\r\n | 212 s> Content-Type: application/mercurial-exp-framing-0006\r\n |
210 s> Transfer-Encoding: chunked\r\n | 213 s> Transfer-Encoding: chunked\r\n |
211 s> \r\n | 214 s> \r\n |
212 s> 13\r\n | 215 s> 11\r\n |
213 s> \x0b\x00\x00\x01\x00\x02\x011 | 216 s> \t\x00\x00\x01\x00\x02\x01\x92 |
217 s> Hidentity | |
218 s> \r\n | |
219 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos) | |
220 s> 13\r\n | |
221 s> \x0b\x00\x00\x01\x00\x02\x041 | |
214 s> \xa1FstatusBok | 222 s> \xa1FstatusBok |
215 s> \r\n | 223 s> \r\n |
216 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | 224 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation) |
217 s> 27\r\n | 225 s> 27\r\n |
218 s> \x1f\x00\x00\x01\x00\x02\x001 | 226 s> \x1f\x00\x00\x01\x00\x02\x041 |
219 s> X\x1dcustomreadonly bytes response | 227 s> X\x1dcustomreadonly bytes response |
220 s> \r\n | 228 s> \r\n |
221 received frame(size=31; request=1; stream=2; streamflags=; type=command-response; flags=continuation) | 229 received frame(size=31; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation) |
222 s> 8\r\n | 230 s> 8\r\n |
223 s> \x00\x00\x00\x01\x00\x02\x002 | 231 s> \x00\x00\x00\x01\x00\x02\x002 |
224 s> \r\n | 232 s> \r\n |
225 s> 0\r\n | 233 s> 0\r\n |
226 s> \r\n | 234 s> \r\n |
333 s> Server: testing stub value\r\n | 341 s> Server: testing stub value\r\n |
334 s> Date: $HTTP_DATE$\r\n | 342 s> Date: $HTTP_DATE$\r\n |
335 s> Content-Type: application/mercurial-exp-framing-0006\r\n | 343 s> Content-Type: application/mercurial-exp-framing-0006\r\n |
336 s> Transfer-Encoding: chunked\r\n | 344 s> Transfer-Encoding: chunked\r\n |
337 s> \r\n | 345 s> \r\n |
338 s> 13\r\n | 346 s> 11\r\n |
339 s> \x0b\x00\x00\x01\x00\x02\x011\xa1FstatusBok | 347 s> \t\x00\x00\x01\x00\x02\x01\x92Hidentity |
348 s> \r\n | |
349 s> 13\r\n | |
350 s> \x0b\x00\x00\x01\x00\x02\x041\xa1FstatusBok | |
340 s> \r\n | 351 s> \r\n |
341 s> 27\r\n | 352 s> 27\r\n |
342 s> \x1f\x00\x00\x01\x00\x02\x001X\x1dcustomreadonly bytes response | 353 s> \x1f\x00\x00\x01\x00\x02\x041X\x1dcustomreadonly bytes response |
343 s> \r\n | 354 s> \r\n |
344 s> 8\r\n | 355 s> 8\r\n |
345 s> \x00\x00\x00\x01\x00\x02\x002 | 356 s> \x00\x00\x00\x01\x00\x02\x002 |
346 s> \r\n | 357 s> \r\n |
347 s> 0\r\n | 358 s> 0\r\n |
462 s> Server: testing stub value\r\n | 473 s> Server: testing stub value\r\n |
463 s> Date: $HTTP_DATE$\r\n | 474 s> Date: $HTTP_DATE$\r\n |
464 s> Content-Type: application/mercurial-exp-framing-0006\r\n | 475 s> Content-Type: application/mercurial-exp-framing-0006\r\n |
465 s> Transfer-Encoding: chunked\r\n | 476 s> Transfer-Encoding: chunked\r\n |
466 s> \r\n | 477 s> \r\n |
467 s> 13\r\n | 478 s> 11\r\n |
468 s> \x0b\x00\x00\x01\x00\x02\x011\xa1FstatusBok | 479 s> \t\x00\x00\x01\x00\x02\x01\x92Hidentity |
480 s> \r\n | |
481 s> 13\r\n | |
482 s> \x0b\x00\x00\x01\x00\x02\x041\xa1FstatusBok | |
469 s> \r\n | 483 s> \r\n |
470 s> 27\r\n | 484 s> 27\r\n |
471 s> \x1f\x00\x00\x01\x00\x02\x001X\x1dcustomreadonly bytes response | 485 s> \x1f\x00\x00\x01\x00\x02\x041X\x1dcustomreadonly bytes response |
472 s> \r\n | 486 s> \r\n |
473 s> 8\r\n | 487 s> 8\r\n |
474 s> \x00\x00\x00\x01\x00\x02\x002 | 488 s> \x00\x00\x00\x01\x00\x02\x002 |
475 s> \r\n | 489 s> \r\n |
476 s> 0\r\n | 490 s> 0\r\n |
501 s> Server: testing stub value\r\n | 515 s> Server: testing stub value\r\n |
502 s> Date: $HTTP_DATE$\r\n | 516 s> Date: $HTTP_DATE$\r\n |
503 s> Content-Type: application/mercurial-exp-framing-0006\r\n | 517 s> Content-Type: application/mercurial-exp-framing-0006\r\n |
504 s> Transfer-Encoding: chunked\r\n | 518 s> Transfer-Encoding: chunked\r\n |
505 s> \r\n | 519 s> \r\n |
506 s> 13\r\n | 520 s> 11\r\n |
507 s> \x0b\x00\x00\x01\x00\x02\x011\xa1FstatusBok | 521 s> \t\x00\x00\x01\x00\x02\x01\x92Hidentity |
522 s> \r\n | |
523 s> 13\r\n | |
524 s> \x0b\x00\x00\x01\x00\x02\x041\xa1FstatusBok | |
508 s> \r\n | 525 s> \r\n |
509 s> 27\r\n | 526 s> 27\r\n |
510 s> \x1f\x00\x00\x01\x00\x02\x001X\x1dcustomreadonly bytes response | 527 s> \x1f\x00\x00\x01\x00\x02\x041X\x1dcustomreadonly bytes response |
511 s> \r\n | 528 s> \r\n |
512 s> 8\r\n | 529 s> 8\r\n |
513 s> \x00\x00\x00\x01\x00\x02\x002 | 530 s> \x00\x00\x00\x01\x00\x02\x002 |
514 s> \r\n | 531 s> \r\n |
515 s> 13\r\n | 532 s> 13\r\n |
516 s> \x0b\x00\x00\x03\x00\x02\x001\xa1FstatusBok | 533 s> \x0b\x00\x00\x03\x00\x02\x041\xa1FstatusBok |
517 s> \r\n | 534 s> \r\n |
518 s> 27\r\n | 535 s> 27\r\n |
519 s> \x1f\x00\x00\x03\x00\x02\x001X\x1dcustomreadonly bytes response | 536 s> \x1f\x00\x00\x03\x00\x02\x041X\x1dcustomreadonly bytes response |
520 s> \r\n | 537 s> \r\n |
521 s> 8\r\n | 538 s> 8\r\n |
522 s> \x00\x00\x00\x03\x00\x02\x002 | 539 s> \x00\x00\x00\x03\x00\x02\x002 |
523 s> \r\n | 540 s> \r\n |
524 s> 0\r\n | 541 s> 0\r\n |
551 s> Server: testing stub value\r\n | 568 s> Server: testing stub value\r\n |
552 s> Date: $HTTP_DATE$\r\n | 569 s> Date: $HTTP_DATE$\r\n |
553 s> Content-Type: application/mercurial-exp-framing-0006\r\n | 570 s> Content-Type: application/mercurial-exp-framing-0006\r\n |
554 s> Transfer-Encoding: chunked\r\n | 571 s> Transfer-Encoding: chunked\r\n |
555 s> \r\n | 572 s> \r\n |
556 s> 13\r\n | 573 s> 11\r\n |
557 s> \x0b\x00\x00\x03\x00\x02\x011\xa1FstatusBok | 574 s> \t\x00\x00\x03\x00\x02\x01\x92Hidentity |
575 s> \r\n | |
576 s> 13\r\n | |
577 s> \x0b\x00\x00\x03\x00\x02\x041\xa1FstatusBok | |
558 s> \r\n | 578 s> \r\n |
559 s> 28\r\n | 579 s> 28\r\n |
560 s> \x00\x00\x03\x00\x02\x001\xa3Ibookmarks@Jnamespaces@Fphases@ | 580 s> \x00\x00\x03\x00\x02\x041\xa3Ibookmarks@Jnamespaces@Fphases@ |
561 s> \r\n | 581 s> \r\n |
562 s> 8\r\n | 582 s> 8\r\n |
563 s> \x00\x00\x00\x03\x00\x02\x002 | 583 s> \x00\x00\x00\x03\x00\x02\x002 |
564 s> \r\n | 584 s> \r\n |
565 s> 13\r\n | 585 s> 13\r\n |
566 s> \x0b\x00\x00\x01\x00\x02\x001\xa1FstatusBok | 586 s> \x0b\x00\x00\x01\x00\x02\x041\xa1FstatusBok |
567 s> \r\n | 587 s> \r\n |
568 s> 9\r\n | 588 s> 9\r\n |
569 s> \x01\x00\x00\x01\x00\x02\x001\xa0 | 589 s> \x01\x00\x00\x01\x00\x02\x041\xa0 |
570 s> \r\n | 590 s> \r\n |
571 s> 8\r\n | 591 s> 8\r\n |
572 s> \x00\x00\x00\x01\x00\x02\x002 | 592 s> \x00\x00\x00\x01\x00\x02\x002 |
573 s> \r\n | 593 s> \r\n |
574 s> 0\r\n | 594 s> 0\r\n |
639 s> Server: testing stub value\r\n | 659 s> Server: testing stub value\r\n |
640 s> Date: $HTTP_DATE$\r\n | 660 s> Date: $HTTP_DATE$\r\n |
641 s> Content-Type: application/mercurial-exp-framing-0006\r\n | 661 s> Content-Type: application/mercurial-exp-framing-0006\r\n |
642 s> Transfer-Encoding: chunked\r\n | 662 s> Transfer-Encoding: chunked\r\n |
643 s> \r\n | 663 s> \r\n |
644 s> 13\r\n | 664 s> 11\r\n |
645 s> \x0b\x00\x00\x01\x00\x02\x011 | 665 s> \t\x00\x00\x01\x00\x02\x01\x92 |
666 s> Hidentity | |
667 s> \r\n | |
668 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos) | |
669 s> 13\r\n | |
670 s> \x0b\x00\x00\x01\x00\x02\x041 | |
646 s> \xa1FstatusBok | 671 s> \xa1FstatusBok |
647 s> \r\n | 672 s> \r\n |
648 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | 673 received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation) |
649 s> 1e\r\n | 674 s> 1e\r\n |
650 s> \x16\x00\x00\x01\x00\x02\x001 | 675 s> \x16\x00\x00\x01\x00\x02\x041 |
651 s> \x81T\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 | 676 s> \x81T\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 |
652 s> \r\n | 677 s> \r\n |
653 received frame(size=22; request=1; stream=2; streamflags=; type=command-response; flags=continuation) | 678 received frame(size=22; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation) |
654 s> 8\r\n | 679 s> 8\r\n |
655 s> \x00\x00\x00\x01\x00\x02\x002 | 680 s> \x00\x00\x00\x01\x00\x02\x002 |
656 s> \r\n | 681 s> \r\n |
657 s> 0\r\n | 682 s> 0\r\n |
658 s> \r\n | 683 s> \r\n |
683 s> Server: testing stub value\r\n | 708 s> Server: testing stub value\r\n |
684 s> Date: $HTTP_DATE$\r\n | 709 s> Date: $HTTP_DATE$\r\n |
685 s> Content-Type: application/mercurial-exp-framing-0006\r\n | 710 s> Content-Type: application/mercurial-exp-framing-0006\r\n |
686 s> Transfer-Encoding: chunked\r\n | 711 s> Transfer-Encoding: chunked\r\n |
687 s> \r\n | 712 s> \r\n |
688 s> 13\r\n | 713 s> 11\r\n |
689 s> \x0b\x00\x00\x01\x00\x02\x011 | 714 s> \t\x00\x00\x01\x00\x02\x01\x92 |
690 s> \xa1FstatusBok | 715 s> Hzstd-8mb |
691 s> \r\n | 716 s> \r\n |
692 received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | 717 received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos) |
693 s> 1e\r\n | 718 s> 25\r\n |
694 s> \x16\x00\x00\x01\x00\x02\x001 | 719 s> \x1d\x00\x00\x01\x00\x02\x042 |
695 s> \x81T\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 | 720 s> (\xb5/\xfd\x00P\xa4\x00\x00p\xa1FstatusBok\x81T\x00\x01\x00\tP\x02 |
696 s> \r\n | 721 s> \r\n |
697 received frame(size=22; request=1; stream=2; streamflags=; type=command-response; flags=continuation) | 722 received frame(size=29; request=1; stream=2; streamflags=encoded; type=command-response; flags=eos) |
698 s> 8\r\n | |
699 s> \x00\x00\x00\x01\x00\x02\x002 | |
700 s> \r\n | |
701 s> 0\r\n | 723 s> 0\r\n |
702 s> \r\n | 724 s> \r\n |
703 received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos) | |
704 response: [ | 725 response: [ |
705 b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' | 726 b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' |
706 ] | 727 ] |
707 (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob) | 728 (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob) |
708 | 729 |