Differences From Artifact [f778008a7d]:
- File
src/OFTCPSocket+SOCKS5.m
— part of check-in
[4f36894ce7]
at
2017-06-05 17:36:28
on branch trunk
— Clean up exceptions a little
This removes several initializers that omitted the errNo. Removing those
forces to think about whether there is a meaningful errNo to set instead
of just omitting it. (user: js, size: 4130) [annotate] [blame] [check-ins using]
To Artifact [c322fa746c]:
- File
src/OFTCPSocket+SOCKS5.m
— part of check-in
[2ae01218ef]
at
2017-06-12 22:29:41
on branch trunk
— OFWriteFailedException: Add -[bytesWritten]
This allows retrieving the number of bytes already written before the
write failed, allowing to retry without writing data that has already
been written. (user: js, size: 4427) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
31 32 33 34 35 36 37 |
/* Reference for static linking */
int _OFTCPSocket_SOCKS5_reference;
static void
send_or_exception(OFTCPSocket *self, of_socket_t socket, char *buffer,
int length)
{
| > > > > > > | > > > > > > > | 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 |
/* Reference for static linking */
int _OFTCPSocket_SOCKS5_reference;
static void
send_or_exception(OFTCPSocket *self, of_socket_t socket, char *buffer,
int length)
{
#ifndef OF_WINDOWS
ssize_t bytesWritten;
#else
int bytesWritten;
#endif
if ((bytesWritten = send(socket, (const void *)buffer, length, 0)) < 0)
@throw [OFWriteFailedException
exceptionWithObject: self
requestedLength: length
bytesWritten: 0
errNo: of_socket_errno()];
if ((int)bytesWritten != length)
@throw [OFWriteFailedException exceptionWithObject: self
requestedLength: length
bytesWritten: bytesWritten
errNo: 0];
}
static void
recv_exact(OFTCPSocket *self, of_socket_t socket, char *buffer, int length)
{
while (length > 0) {
ssize_t ret = recv(socket, (void *)buffer, length, 0);
|
| ︙ | ︙ |