Comment: | More consistent -[close] behavior
This means refusing to close twice, calling -[close] from -[dealloc] and Calling -[cancelAsyncRequests] in -[close] is too dangerous, as -[close] |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
3b43d510061a2f5ef2261ff35e76d948 |
User & Date: | js on 2020-01-14 00:16:04 |
Other Links: | manifest | tags |
2020-01-14
| ||
22:53 | OF{Poll,Select}KernelEventObserver: Throw EBADF check-in: 94479b861b user: js tags: trunk | |
00:16 | More consistent -[close] behavior check-in: 3b43d51006 user: js tags: trunk | |
2020-01-13
| ||
00:18 | OFPollKernelEventObserver: Copy FDs check-in: 7e9f70c477 user: js tags: trunk | |
Modified src/OFFile.m from [8a16e3648e] to [1f08d5d8ea].
︙ | |||
526 527 528 529 530 531 532 | 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 | - - + + + + - + | { return _handle; } #endif - (void)close { |
Modified src/OFGZIPStream.m from [3efdd5018a] to [f8e93c416d].
︙ | |||
61 62 63 64 65 66 67 | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | + - + | } return self; } - (void)dealloc { if (_stream != nil) |
︙ | |||
319 320 321 322 323 324 325 326 327 328 329 330 331 | 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 | + + + | _inflateStream.hasDataInReadBuffer); return (super.hasDataInReadBuffer || _stream.hasDataInReadBuffer); } - (void)close { if (_stream == nil) @throw [OFNotOpenException exceptionWithObject: self]; [_stream release]; _stream = nil; [super close]; } @end |
Modified src/OFHTTPClient.m from [90f1585c87] to [cc1af7fa6d].
︙ | |||
729 730 731 732 733 734 735 | 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 | + - + - | } return self; } - (void)dealloc { if (_socket != nil) |
︙ | |||
785 786 787 788 789 790 791 | 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 | - + + + | { return _atEndOfStream; } - (void)close { if (_socket == nil) |
︙ | |||
817 818 819 820 821 822 823 | 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 | - + + | _socket = [sock retain]; return self; } - (void)dealloc { |
︙ | |||
981 982 983 984 985 986 987 988 989 990 991 992 993 994 | 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 | + + + | - (bool)hasDataInReadBuffer { return (super.hasDataInReadBuffer || _socket.hasDataInReadBuffer); } - (void)close { if (_socket == nil) @throw [OFNotOpenException exceptionWithObject: self]; _atEndOfStream = false; [_socket release]; _socket = nil; [super close]; } |
︙ |
Modified src/OFHTTPServer.m from [8b4765d161] to [e03c4b06ca].
︙ | |||
246 247 248 249 250 251 252 | 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | - + | return self; } - (void)dealloc { if (_socket != nil) |
︙ | |||
673 674 675 676 677 678 679 | 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 | + - + | } return self; } - (void)dealloc { if (_socket != nil) |
︙ | |||
716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 | 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 | + + + + + | - (int)fileDescriptorForReading { return _socket.fileDescriptorForReading; } - (void)close { if (_socket == nil) @throw [OFNotOpenException exceptionWithObject: self]; [_socket release]; _socket = nil; [super close]; } @end #ifdef OF_HAVE_THREADS @implementation OFHTTPServerThread - (void)stop { |
︙ |
Modified src/OFInflateStream.m from [89d633e369] to [3cf4fd3893].
︙ | |||
204 205 206 207 208 209 210 | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | + - + | } return self; } - (void)dealloc { if (_stream != nil) |
︙ | |||
675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 | 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 | + + + | { return (super.hasDataInReadBuffer || _stream.hasDataInReadBuffer || _bufferLength - _bufferIndex > 0); } - (void)close { if (_stream == nil) @throw [OFNotOpenException exceptionWithObject: self]; /* Give back our buffer to the stream, in case it's shared */ [_stream unreadFromBuffer: _buffer + _bufferIndex length: _bufferLength - _bufferIndex]; _bufferIndex = _bufferLength = 0; [_stream release]; _stream = nil; [super close]; } @end |
Modified src/OFLHAArchive.m from [dd17a9200e] to [a09f2c8a17].
︙ | |||
148 149 150 151 152 153 154 | 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | + - + | return self; } #endif - (void)dealloc { if (_stream != nil) |
︙ | |||
238 239 240 241 242 243 244 | 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | - + | return [[(OFLHAArchiveFileWriteStream *)_lastReturnedStream retain] autorelease]; } - (void)close { if (_stream == nil) |
︙ | |||
293 294 295 296 297 298 299 | 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | + - + - - | } return self; } - (void)dealloc { if (_stream != nil || _decompressedStream != nil) |
︙ | |||
413 414 415 416 417 418 419 420 421 422 423 424 425 426 | 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | + + + | _toRead = 0; _skipped = true; } - (void)close { if (_stream == nil || _decompressedStream == nil) @throw [OFNotOpenException exceptionWithObject: self]; [self of_skip]; [_stream release]; _stream = nil; [_decompressedStream release]; _decompressedStream = nil; |
︙ | |||
456 457 458 459 460 461 462 | 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 | + - + | } return self; } - (void)dealloc { if (_stream != nil) |
︙ | |||
509 510 511 512 513 514 515 | 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | - + | } - (void)close { of_offset_t offset; if (_stream == nil) |
︙ |
Modified src/OFLHADecompressingStream.m from [14251acfde] to [aae6155a72].
︙ | |||
119 120 121 122 123 124 125 | 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | + - + | } return self; } - (void)dealloc { if (_stream != nil) |
︙ | |||
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 | 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 | + + + | { return (super.hasDataInReadBuffer || _stream.hasDataInReadBuffer || _bufferLength - _bufferIndex > 0); } - (void)close { if (_stream == nil) @throw [OFNotOpenException exceptionWithObject: self]; /* Give back our buffer to the stream, in case it's shared */ [_stream unreadFromBuffer: _buffer + _bufferIndex length: _bufferLength - _bufferIndex]; _bytesConsumed -= _bufferLength - _bufferIndex; _bufferIndex = _bufferLength = 0; [_stream release]; _stream = nil; [super close]; } @end |
Modified src/OFProcess.m from [7babcc132e] to [dc3506687f].
︙ | |||
324 325 326 327 328 329 330 | 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | + + + + + - + | } return self; } - (void)dealloc { #ifndef OF_WINDOWS if (_readPipe[0] != -1) #else if (_readPipe[0] != NULL) #endif |
︙ | |||
554 555 556 557 558 559 560 | 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 | - - + + + + + - - - - - + + + + + - - - | _writePipe[1] = NULL; #endif } - (void)close { #ifndef OF_WINDOWS |
Modified src/OFStdIOStream.m from [4ead6e5d4b] to [730550a384].
︙ | |||
174 175 176 177 178 179 180 | 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | + + + + + - + | return self; } #endif - (void)dealloc { #ifndef OF_AMIGAOS if (_fd != -1) #else if (_handle != 0) #endif |
︙ | |||
297 298 299 300 301 302 303 | 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | - - + + + + + + - + | return _fd; } #endif - (void)close { #ifndef OF_AMIGAOS |
︙ |
Modified src/OFStreamSocket.m from [6026b8fcfc] to [bc21bce60d].
︙ | |||
173 174 175 176 177 178 179 | 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | - - - - | } - (void)close { if (_socket == INVALID_SOCKET) @throw [OFNotOpenException exceptionWithObject: self]; |
︙ |
Modified src/OFTarArchive.m from [e1828579de] to [9fd5fb5c63].
︙ | |||
292 293 294 295 296 297 298 | 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | + - + | } return self; } - (void)dealloc { if (_stream != nil) |
︙ | |||
350 351 352 353 354 355 356 357 358 359 360 361 362 363 | 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | + + + | { return ((id <OFReadyForReadingObserving>)_stream) .fileDescriptorForReading; } - (void)close { if (_stream == nil) @throw [OFNotOpenException exceptionWithObject: self]; [self of_skip]; [_stream release]; _stream = nil; [super close]; } |
︙ | |||
425 426 427 428 429 430 431 | 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 | + - + | } return self; } - (void)dealloc { if (_stream != nil) |
︙ | |||
472 473 474 475 476 477 478 479 | 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | + + - - + - + + | { return ((id <OFReadyForWritingObserving>)_stream) .fileDescriptorForWriting; } - (void)close { uint64_t remainder; if (_stream == nil) |
︙ |
Modified src/OFZIPArchive.m from [0b0c4f5246] to [f2e2222c23].
︙ | |||
244 245 246 247 248 249 250 | 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | + - + | return self; } #endif - (void)dealloc { if (_stream != nil) |
︙ | |||
613 614 615 616 617 618 619 | 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 | - + | objc_autoreleasePoolPop(pool); } - (void)close { if (_stream == nil) |
︙ | |||
766 767 768 769 770 771 772 | 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 | + - + - - | } return self; } - (void)dealloc { if (_stream != nil || _decompressedStream != nil) |
︙ | |||
843 844 845 846 847 848 849 850 851 852 853 854 855 856 | 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 | + + + | { return ((id <OFReadyForReadingObserving>)_decompressedStream) .fileDescriptorForReading; } - (void)close { if (_stream == nil || _decompressedStream == nil) @throw [OFNotOpenException exceptionWithObject: self]; [_stream release]; _stream = nil; [_decompressedStream release]; _decompressedStream = nil; [super close]; |
︙ | |||
868 869 870 871 872 873 874 | 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 | + - + - | _CRC32 = ~0; return self; } - (void)dealloc { if (_stream != nil) |
︙ | |||
901 902 903 904 905 906 907 | 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 | - + - + + + | return bytesWritten; } - (void)close { if (_stream == nil) |