Comment: | Make it possible to disable sockets. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
590c377d8a61164272a1c2c6270c7041 |
User & Date: | js on 2013-04-26 19:42:52 |
Other Links: | manifest | tags |
2013-04-26
| ||
20:18 | Only build OFProcess if available. check-in: 9965b1550e user: js tags: trunk | |
19:42 | Make it possible to disable sockets. check-in: 590c377d8a user: js tags: trunk | |
2013-04-25
| ||
01:09 | OFSystemInfo: Fix fallback pageSize. check-in: 9c1da35543 user: js tags: trunk | |
Modified configure.ac from [1dac072c32] to [851bfdbc5a].
︙ | |||
569 570 571 572 573 574 575 | 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 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 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 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 | - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - + + + + - - - - + + + + + + + + + | AC_MSG_CHECKING(for atomic operations) AS_IF([test x"$atomic_ops" != x"none"], [ AC_DEFINE(OF_HAVE_ATOMIC_OPS, 1, [Whether we have atomic operations]) AC_SUBST(ATOMIC_H, "atomic.h") ]) AC_MSG_RESULT($atomic_ops) |
︙ |
Modified extra.mk.in from [ee1481108e] to [48485659ad].
︙ | |||
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | + + | EXCEPTIONS_EXCEPTIONS_LIB_A = @EXCEPTIONS_EXCEPTIONS_LIB_A@ EXCEPTIONS_LIB_A = @EXCEPTIONS_LIB_A@ FORWARDING_S = @FORWARDING_S@ FOUNDATION_COMPAT_M = @FOUNDATION_COMPAT_M@ INSTANCE_M = @INSTANCE_M@ LOOKUP_S = @LOOKUP_S@ OFBLOCKTESTS_M = @OFBLOCKTESTS_M@ OFHTTPCLIENTTESTS_M = @OFHTTPCLIENTTESTS_M@ OFSTREAMOBSERVER_KQUEUE_M = @OFSTREAMOBSERVER_KQUEUE_M@ OFSTREAMOBSERVER_POLL_M = @OFSTREAMOBSERVER_POLL_M@ OFSTREAMOBSERVER_SELECT_M = @OFSTREAMOBSERVER_SELECT_M@ PROPERTIESTESTS_M = @PROPERTIESTESTS_M@ REEXPORT_LIBOBJC = @REEXPORT_LIBOBJC@ RUNTIME = @RUNTIME@ RUNTIME_A = @RUNTIME_A@ RUNTIME_RUNTIME_A = @RUNTIME_RUNTIME_A@ RUNTIME_RUNTIME_LIB_A = @RUNTIME_RUNTIME_LIB_A@ RUNTIME_LIB_A = @RUNTIME_LIB_A@ TESTPLUGIN = @TESTPLUGIN@ TESTS = @TESTS@ TEST_LAUNCHER = @TEST_LAUNCHER@ USE_INCLUDES_THREADS = @USE_INCLUDES_THREADS@ USE_SRCS_PLUGINS = @USE_SRCS_PLUGINS@ USE_SRCS_SOCKETS = @USE_SRCS_SOCKETS@ USE_SRCS_THREADS = @USE_SRCS_THREADS@ |
Modified src/Makefile from [ba9ed93830] to [8e894e6dc5].
︙ | |||
17 18 19 20 21 22 23 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | - - - - - - - + + + + + + + + | OFDataArray.m \ OFDataArray+BinaryPackValue.m \ OFDataArray+Hashing.m \ OFDate.m \ OFDictionary.m \ OFEnumerator.m \ OFFile.m \ |
︙ | |||
107 108 109 110 111 112 113 | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | - - - - + + + + | OFCountedSet_hashtable.m \ OFDictionary_hashtable.m \ OFMutableArray_adjacent.m \ OFMutableDictionary_hashtable.m \ OFMutableSet_hashtable.m \ OFMutableString_UTF8.m \ OFSet_hashtable.m \ |
Modified src/OFDataArray.m from [cc46586b15] to [fc3aaeaea9].
︙ | |||
20 21 22 23 24 25 26 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | + - - - + + + + + - + + + | #include <string.h> #include <limits.h> #import "OFDataArray.h" #import "OFString.h" #import "OFFile.h" #import "OFURL.h" #ifdef OF_HAVE_SOCKETS |
︙ | |||
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | + + + | return self; } - initWithContentsOfURL: (OFURL*)URL { void *pool; #ifdef OF_HAVE_SOCKETS OFHTTPClient *client; OFHTTPRequest *request; OFHTTPRequestReply *reply; OFDictionary *headers; OFString *contentLength; #endif Class c; c = [self class]; [self release]; pool = objc_autoreleasePoolPush(); #ifdef OF_HAVE_SOCKETS if ([[URL scheme] isEqual: @"file"]) { self = [[c alloc] initWithContentsOfFile: [URL path]]; objc_autoreleasePoolPop(pool); return self; } client = [OFHTTPClient client]; |
︙ | |||
198 199 200 201 202 203 204 205 206 207 208 209 210 211 | 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | + + + | self = [[reply readDataArrayTillEndOfStream] retain]; headers = [reply headers]; if ((contentLength = [headers objectForKey: @"Content-Length"]) != nil) if ([self count] != (size_t)[contentLength decimalValue]) @throw [OFTruncatedDataException exceptionWithClass: [self class]]; #else @throw [OFUnsupportedProtocolException exceptionWithClass: c]; #endif objc_autoreleasePoolPop(pool); return self; } - initWithStringRepresentation: (OFString*)string |
︙ |
Modified src/OFHTTPClient.h from [838f77c97e] to [630572f8e2].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + + + + | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFHTTPClient; @class OFHTTPRequest; @class OFHTTPRequestReply; @class OFURL; @class OFTCPSocket; @class OFDictionary; |
︙ |
Modified src/OFHTTPRequest.h from [f26f1fecd0] to [daf0e520ee].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + + + + | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFURL; @class OFDictionary; @class OFDataArray; @class OFString; /*! @file */ |
︙ |
Modified src/OFHTTPRequestReply.h from [bdd473d229] to [274b2bd401].
︙ | |||
12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | + + + + | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFStream.h" #import "OFHTTPRequest.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFDictionary; /*! * @brief A class for representing an HTTP request reply as a stream. */ @interface OFHTTPRequestReply: OFStream |
︙ |
Modified src/OFHTTPServer.h from [ffe70c28fb] to [6142f7e628].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + + + + | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFHTTPServer; @class OFHTTPRequest; @class OFHTTPRequestReply; @class OFTCPSocket; @class OFException; |
︙ |
Modified src/OFRunLoop.h from [af319d727b] to [879bd22002].
︙ | |||
12 13 14 15 16 17 18 | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | + - + + + + + - + - + + | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #import "OFStream.h" #ifdef OF_HAVE_SOCKETS |
︙ |
Modified src/OFRunLoop.m from [9ced28ca2c] to [e463b5f0e9].
︙ | |||
16 17 18 19 20 21 22 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | + - + + + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + - + - - + + - + - - + + - + - - - - - - - - - - | #include "config.h" #include <assert.h> #import "OFRunLoop.h" #import "OFDictionary.h" #ifdef OF_HAVE_SOCKETS |
︙ | |||
152 153 154 155 156 157 158 | 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | + - + | } + (void)OF_setMainRunLoop: (OFRunLoop*)runLoop { mainRunLoop = [runLoop retain]; } #ifdef OF_HAVE_SOCKETS |
︙ | |||
223 224 225 226 227 228 229 | 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | - + | { ADD(OFRunLoop_AcceptQueueItem, { queueItem->_target = [target retain]; queueItem->_selector = selector; }) } |
︙ | |||
265 266 267 268 269 270 271 | 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 | - + - - + + + + + + + + + + + + | + (void)OF_addAsyncAcceptForTCPSocket: (OFTCPSocket*)stream block: (of_tcpsocket_async_accept_block_t)block { ADD(OFRunLoop_AcceptQueueItem, { queueItem->_block = [block copy]; }) } |
︙ | |||
359 360 361 362 363 364 365 366 367 368 369 370 371 372 | 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | + | #ifdef OF_HAVE_THREADS } @finally { [_timersQueueLock unlock]; } #endif } #ifdef OF_HAVE_SOCKETS - (void)streamIsReadyForReading: (OFStream*)stream { OFList *queue = [_readQueues objectForKey: stream]; of_list_object_t *listObject; OF_ENSURE(queue != nil); |
︙ | |||
382 383 384 385 386 387 388 | 398 399 400 401 402 403 404 405 406 407 408 409 410 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 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 | - + - + - + - + - + - + | length = [stream readIntoBuffer: queueItem->_buffer length: queueItem->_length]; } @catch (OFException *e) { length = 0; exception = e; } |
︙ | |||
478 479 480 481 482 483 484 | 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 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 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 | - + - + - + - + - + - + - + - + - + - + + | [_streamObserver removeStreamForReading: stream]; [_readQueues removeObjectForKey: stream]; } } |
︙ | |||
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 | 669 670 671 672 673 674 675 676 677 678 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 710 711 712 | + + + + + + + + + + - + + + + + | #endif /* Watch for stream events until the next timer is due */ if (nextTimer != nil) { double timeout = [nextTimer timeIntervalSinceNow]; if (timeout > 0) #ifdef OF_HAVE_SOCKETS [_streamObserver observeWithTimeout: timeout]; #else [OFThread sleepForTimeInterval: timeout]; #endif } else { /* * No more timers: Just watch for streams until we get * an event. If a timer is added by another thread, it * cancels the observe. */ #ifdef OF_HAVE_SOCKETS [_streamObserver observe]; #else [OFThread sleepForTimeInterval: 86400]; #endif } objc_autoreleasePoolPop(pool); } } - (void)stop { _running = false; #ifdef OF_HAVE_THREADS of_memory_write_barrier(); #endif #ifdef OF_HAVE_SOCKETS [_streamObserver cancel]; #endif |
Modified src/OFStream.h from [05795f4687] to [b114d5af52].
︙ | |||
28 29 30 31 32 33 34 | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | - + | /*! @file */ @class OFStream; @class OFDataArray; @class OFException; |
︙ | |||
126 127 128 129 130 131 132 133 134 135 136 137 138 139 | 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | + | * @param buffer The buffer into which the data is read * @param length The length of the data that should be read. * The buffer *must* be *at least* this big! */ - (void)readIntoBuffer: (void*)buffer exactLength: (size_t)length; #ifdef OF_HAVE_SOCKETS /*! * @brief Asyncronously reads *at most* size bytes from the stream into a * buffer. * * On network streams, this might read less than the specified number of bytes. * If you want to read exactly the specified number of bytes, use * @ref asyncReadIntoBuffer:exactLength:block:. Note that a read can even |
︙ | |||
182 183 184 185 186 187 188 | 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | - + | * OFException *exception). */ - (void)asyncReadIntoBuffer: (void*)buffer exactLength: (size_t)length target: (id)target selector: (SEL)selector; |
︙ | |||
228 229 230 231 232 233 234 235 236 237 238 239 240 241 | 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | + | * buffer and exact length when more data has been received. If * you want the next block in the queue to handle the data * received next, you need to return false from the block. */ - (void)asyncReadIntoBuffer: (void*)buffer exactLength: (size_t)length block: (of_stream_async_read_block_t)block; # endif #endif /*! * @brief Reads a uint8_t from the stream. * * @warning Only call this when you know that enough data is available! * Otherwise you will get an exception! |
︙ | |||
576 577 578 579 580 581 582 583 584 585 586 587 588 589 | 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 | + | * * @param encoding The encoding used by the stream * @return The line that was read, autoreleased, or nil if the end of the * stream has been reached. */ - (OFString*)readLineWithEncoding: (of_string_encoding_t)encoding; #ifdef OF_HAVE_SOCKETS /*! * @brief Asyncronously reads until a newline, \\0, end of stream or an * exception occurs. * * @param target The target on which to call the selector when the data has * been received. If the method returns true, it will be called * again when the next line has been received. If you want the |
︙ | |||
610 611 612 613 614 615 616 | 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 | - + | * bool (OFStream *stream, OFString *line, * OFException *exception). */ - (void)asyncReadLineWithEncoding: (of_string_encoding_t)encoding target: (id)target selector: (SEL)selector; |
︙ | |||
636 637 638 639 640 641 642 643 644 645 646 647 648 649 | 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 | + | * If the block returns true, it will be called again when the next * line has been received. If you want the next block in the queue * to handle the next line, you need to return false from the * block. */ - (void)asyncReadLineWithEncoding: (of_string_encoding_t)encoding block: (of_stream_async_read_line_block_t)block; # endif #endif /*! * @brief Tries to read a line from the stream (see readLine) and returns nil if * no complete line has been received yet. * * @return The line that was read, autoreleased, or nil if the line is not |
︙ | |||
1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 | 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 | + + | /*! * @brief Returns the file descriptor for the write end of the stream. * * @return The file descriptor for the write end of the stream */ - (int)fileDescriptorForWriting; #ifdef OF_HAVE_SOCKETS /*! * @brief Cancels all pending asyncronous requests on the stream. */ - (void)cancelAsyncRequests; #endif /*! * @brief Closes the stream. */ - (void)close; /*! |
︙ |
Modified src/OFStream.m from [401460f5bb] to [f3e5357ad2].
︙ | |||
144 145 146 147 148 149 150 151 152 153 154 155 156 157 | 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | + | size_t readLength = 0; while (readLength < length) readLength += [self readIntoBuffer: (char*)buffer + readLength length: length - readLength]; } #ifdef OF_HAVE_SOCKETS - (void)asyncReadIntoBuffer: (void*)buffer length: (size_t)length target: (id)target selector: (SEL)selector { [OFRunLoop OF_addAsyncReadForStream: self buffer: buffer |
︙ | |||
168 169 170 171 172 173 174 | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | - + + | [OFRunLoop OF_addAsyncReadForStream: self buffer: buffer exactLength: length target: target selector: selector]; } |
︙ | |||
729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 | 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 | + - + + | while ((line = [self tryReadLineWithEncoding: encoding]) == nil) if ([self isAtEndOfStream]) return nil; return line; } #ifdef OF_HAVE_SOCKETS - (void)asyncReadLineWithTarget: (id)target selector: (SEL)selector { [self asyncReadLineWithEncoding: OF_STRING_ENCODING_UTF_8 target: target selector: selector]; } - (void)asyncReadLineWithEncoding: (of_string_encoding_t)encoding target: (id)target selector: (SEL)selector { [OFRunLoop OF_addAsyncReadLineForStream: self encoding: encoding target: target selector: selector]; } |
︙ | |||
1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 | 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 | + + | - (int)fileDescriptorForWriting { [self doesNotRecognizeSelector: _cmd]; abort(); } #ifdef OF_HAVE_SOCKETS - (void)cancelAsyncRequests { [OFRunLoop OF_cancelAsyncRequestsForStream: self]; } #endif - (void)close { [self doesNotRecognizeSelector: _cmd]; abort(); } - (bool)OF_isWaitingForDelimiter { return _waitingForDelimiter; } @end |
Modified src/OFStreamObserver.h from [4cd46fa418] to [7fc7495bc7].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + + + + | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif #ifdef _WIN32 # include <winsock2.h> #endif @class OFStream; @class OFMutableArray; |
︙ |
Modified src/OFStreamSocket.h from [9529543da1] to [0eb6c65989].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + + + + | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFStream.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif #ifdef _WIN32 # include <winsock2.h> #endif /*! * @brief A class which provides functions to create and use stream sockets. |
︙ |
Modified src/OFString.m from [76e87b40ed] to [250db502f2].
︙ | |||
24 25 26 27 28 29 30 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | + - - - + + + + + - + + + | #import "OFString.h" #import "OFString_UTF8.h" #import "OFArray.h" #import "OFDictionary.h" #import "OFFile.h" #import "OFURL.h" #ifdef OF_HAVE_SOCKETS |
︙ | |||
903 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 931 932 933 934 935 936 937 938 939 | 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 | + + + | encoding: OF_STRING_ENCODING_AUTODETECT]; } - initWithContentsOfURL: (OFURL*)URL encoding: (of_string_encoding_t)encoding { void *pool; #ifdef OF_HAVE_SOCKETS OFHTTPClient *client; OFHTTPRequest *request; OFHTTPRequestReply *reply; OFDictionary *headers; OFString *contentType, *contentLength; OFDataArray *data; #endif Class c; c = [self class]; [self release]; pool = objc_autoreleasePoolPush(); if ([[URL scheme] isEqual: @"file"]) { if (encoding == OF_STRING_ENCODING_AUTODETECT) encoding = OF_STRING_ENCODING_UTF_8; self = [[c alloc] initWithContentsOfFile: [URL path] encoding: encoding]; objc_autoreleasePoolPop(pool); return self; } #ifdef OF_HAVE_SOCKETS client = [OFHTTPClient client]; request = [OFHTTPRequest requestWithURL: URL]; reply = [client performRequest: request]; if ([reply statusCode] != 200) @throw [OFHTTPRequestFailedException exceptionWithClass: [request class] |
︙ | |||
965 966 967 968 969 970 971 972 973 974 975 976 977 978 | 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 | + + + | if ([data count] != (size_t)[contentLength decimalValue]) @throw [OFTruncatedDataException exceptionWithClass: [self class]]; self = [[c alloc] initWithCString: (char*)[data items] encoding: encoding length: [data count]]; #else @throw [OFUnsupportedProtocolException exceptionWithClass: c]; #endif objc_autoreleasePoolPop(pool); return self; } - initWithSerialization: (OFXMLElement*)element |
︙ |
Modified src/ObjFW.h from [409806974f] to [fbd2428681].
︙ | |||
42 43 44 45 46 47 48 | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | + - - - + + + - - + - - - - + + + + + + + | #import "OFNumber.h" #import "OFDate.h" #import "OFURL.h" #import "OFStream.h" #import "OFFile.h" #ifdef OF_HAVE_SOCKETS |
︙ | |||
76 77 78 79 80 81 82 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | + - - - - + + + + + + - + + + - + + + - + + + - + + | #import "OFApplication.h" #import "OFSystemInfo.h" #import "OFTimer.h" #import "OFRunLoop.h" #import "OFAllocFailedException.h" #import "OFException.h" #ifdef OF_HAVE_SOCKETS |
︙ |
Modified src/exceptions/Makefile from [08074185ef] to [556668b48e].
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | - - - + - - - - - - + + + + + + + + + | include ../../extra.mk STATIC_PIC_LIB_NOINST = ${EXCEPTIONS_LIB_A} STATIC_LIB_NOINST = ${EXCEPTIONS_A} |
︙ |
Modified src/exceptions/OFAcceptFailedException.h from [f828728a28] to [ede346dfd9].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + + + + | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFTCPSocket; /*! * @brief An exception indicating that accepting a connection failed. */ @interface OFAcceptFailedException: OFException |
︙ |
Modified src/exceptions/OFAddressTranslationFailedException.h from [9eb5a36411] to [1027254cc2].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + + + + | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFTCPSocket; /*! * @brief An exception indicating the translation of an address failed. */ @interface OFAddressTranslationFailedException: OFException |
︙ |
Modified src/exceptions/OFAlreadyConnectedException.h from [5e96c85485] to [a1bbdc5954].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + + + + | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFTCPSocket; /*! * @brief An exception indicating an attempt to connect or bind an already * connected or bound socket. */ |
︙ |
Modified src/exceptions/OFBindFailedException.h from [3324f93c42] to [08e07c93e0].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + + + + | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFTCPSocket; /*! * @brief An exception indicating that binding a socket failed. */ @interface OFBindFailedException: OFException |
︙ |
Modified src/exceptions/OFConnectionFailedException.h from [6e0a8c3716] to [7bbe937501].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + + + + | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFTCPSocket; /*! * @brief An exception indicating that a connection could not be established. */ @interface OFConnectionFailedException: OFException |
︙ |
Modified src/exceptions/OFHTTPRequestFailedException.h from [e63622a3c6] to [ca95dac731].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + + + + | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFHTTPRequest; @class OFHTTPRequestReply; /*! * @brief An exception indicating that a HTTP request failed. */ |
︙ |
Modified src/exceptions/OFListenFailedException.h from [9a332b8a67] to [1610493659].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + + + + | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFTCPSocket; /*! * @brief An exception indicating that listening on the socket failed. */ @interface OFListenFailedException: OFException |
︙ |
Modified src/exceptions/OFNotConnectedException.h from [281c34dc5e] to [78d1f92282].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + + + + | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFException.h" #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif @class OFStreamSocket; /*! * @brief An exception indicating a socket is not connected or bound. */ @interface OFNotConnectedException: OFException |
︙ |
Modified src/exceptions/OFReadOrWriteFailedException.m from [74aee00696] to [a5ac8c3823].
︙ | |||
16 17 18 19 20 21 22 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | + - + + | #include "config.h" #include <stdlib.h> #import "OFReadOrWriteFailedException.h" #import "OFString.h" #ifdef OF_HAVE_SOCKETS |
︙ | |||
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | + + | requestedLength: (size_t)requestedLength { self = [super initWithClass: class]; _stream = [stream retain]; _requestedLength = requestedLength; #ifdef OF_HAVE_SOCKETS if ([class isSubclassOfClass: [OFStreamSocket class]]) _errNo = GET_SOCK_ERRNO; else #endif _errNo = GET_ERRNO; return self; } - (void)dealloc { |
︙ |
Modified src/exceptions/common.h from [258ae8e83b] to [19aae6e6f7].
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | - + + - - - - - + + + + + + - - - - - - + + + + + + + + - - - - - - + + + + + + + + + + | */ #include <string.h> #import "macros.h" #ifndef _WIN32 |
Modified src/objfw-defs.h.in from [f518fd1de0] to [63a737d4f3].
︙ | |||
9 10 11 12 13 14 15 16 17 18 | 9 10 11 12 13 14 15 16 17 18 19 | + | #undef OF_HAVE_OSATOMIC #undef OF_HAVE_OSATOMIC_64 #undef OF_HAVE_PTHREADS #undef OF_HAVE_PLUGINS #undef OF_HAVE_PTHREAD_SPINLOCKS #undef OF_HAVE_RECURSIVE_PTHREAD_MUTEXES #undef OF_HAVE_SCHED_YIELD #undef OF_HAVE_SOCKETS #undef OF_HAVE_THREADS #undef OF_OBJFW_RUNTIME #undef SIZE_MAX |
Modified tests/Makefile from [9b8d4ab488] to [6d4f7847a4].
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | - + - + + + - + - | OFNumberTests.m \ OFObjectTests.m \ OFSerializationTests.m \ OFSet.m \ OFSHA1HashTests.m \ OFStreamTests.m \ OFStringTests.m \ |
︙ |
Modified tests/TestsAppDelegate.m from [d190941fab] to [f5a2a05389].
︙ | |||
137 138 139 140 141 142 143 144 145 146 147 148 | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | + + - + | [self arrayTests]; [self dictionaryTests]; [self listTests]; [self setTests]; [self dateTests]; [self numberTests]; [self streamTests]; #ifdef OF_HAVE_SOCKETS [self TCPSocketTests]; #endif #ifdef OF_HAVE_THREADS [self threadTests]; #endif [self URLTests]; |
︙ |