Differences From Artifact [868929166e]:
- File src/OFHTTPServer.m — part of check-in [b6cb3addd0] at 2020-06-28 15:03:23 on branch trunk — Use OF_DIRECT(_MEMBERS) where appropriate (user: js, size: 21480) [annotate] [blame] [check-ins using] [more...]
To Artifact [0eb4bcc334]:
- File
src/OFHTTPServer.m
— part of check-in
[b6ee372b98]
at
2020-08-11 19:45:36
on branch trunk
— OFString: Rework number parsing API
This solves the old signed vs. unsigned problem and allows for more
bases than just 8, 10 and 16, as well as auto-detection of the base (if
base is 0). (user: js, size: 21679) [annotate] [blame] [check-ins using]
︙ | |||
101 102 103 104 105 106 107 | 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | - + - + | @end OF_DIRECT_MEMBERS @interface OFHTTPServerRequestBodyStream: OFStream <OFReadyForReadingObserving> { OFStreamSocket *_socket; bool _chunked; |
︙ | |||
411 412 413 414 415 416 417 | 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 | - + - + - - - | size_t pos; if (line.length == 0) { bool chunked = [[_headers objectForKey: @"Transfer-Encoding"] isEqual: @"chunked"]; OFString *contentLengthString = [_headers objectForKey: @"Content-Length"]; |
︙ | |||
478 479 480 481 482 483 484 | 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 | - - + + + | [_host release]; _host = [[value substringWithRange: of_range(0, pos)] retain]; @try { of_range_t range = of_range(pos + 1, value.length - pos - 1); |
︙ | |||
581 582 583 584 585 586 587 | 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 | - + + + + - + | objc_autoreleasePoolPop(pool); } @end @implementation OFHTTPServerRequestBodyStream - (instancetype)initWithSocket: (OFStreamSocket *)sock chunked: (bool)chunked |
︙ | |||
629 630 631 632 633 634 635 | 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 | - + | if (_socket.atEndOfStream) @throw [OFTruncatedDataException exception]; /* Content-Length */ if (!_chunked) { size_t ret; |
︙ | |||
678 679 680 681 682 683 684 | 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 | - + + | } if (_setAtEndOfStream && _toRead == 0) _atEndOfStream = true; return 0; } else if (_toRead > 0) { |
︙ | |||
721 722 723 724 725 726 727 | 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 | + - + + | if (_socket.atEndOfStream && range.location == OF_NOT_FOUND) @throw [OFTruncatedDataException exception]; else @throw [OFInvalidFormatException exception]; } toRead = [line unsignedLongLongValueWithBase: 16]; |
︙ |