Differences From Artifact [dd4630f033]:
- File
src/OFTCPSocket.m
— part of check-in
[064dbe5127]
at
2018-12-11 22:57:46
on branch trunk
— Include an exception in delegate methods
Otherwise, there would be two methods for every operation: One for
success and one for failure. It also makes it easy to forget about
handling failure, so it's better to always pass an optional exception. (user: js, size: 25706) [annotate] [blame] [check-ins using]
To Artifact [d516c427cd]:
- File
src/OFTCPSocket.m
— part of check-in
[f218986f51]
at
2018-12-18 14:14:25
on branch trunk
— Use OFData instead of a buffer for async writes
This avoids the entire problem of keeping the buffer alive until the
write finished. (user: js, size: 25724) [annotate] [blame] [check-ins using]
︙ | |||
359 360 361 362 363 364 365 366 | 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | + + + - + - - + | socketAddresses:context: exception:) context: nil]; } - (void)sendSOCKS5Request { OFData *data = [OFData dataWithItems: "\x05\x01\x00" count: 3]; _SOCKS5State = SOCKS5_STATE_SEND_AUTHENTICATION; |
︙ | |||
415 416 417 418 419 420 421 | 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 | - + - - + | port[0] = _port >> 8; port[1] = _port & 0xFF; [_request addItems: port count: 2]; _SOCKS5State = SOCKS5_STATE_SEND_REQUEST; |
︙ | |||
519 520 521 522 523 524 525 | 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 | - - - - + + + + - + - + - + - + | return false; default: assert(0); return false; } } |
︙ |