ObjFW  Diff

Differences From Artifact [eec652ecb7]:

To Artifact [272212f745]:


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
- (void)lowlevelWriteBuffer: (const void *)buffer
		     length: (size_t)length
{
	if (_socket == INVALID_SOCKET)
		@throw [OFNotOpenException exceptionWithObject: self];

#ifndef OF_WINDOWS


	if (length > SSIZE_MAX)
		@throw [OFOutOfRangeException exception];

	if (send(_socket, buffer, length, 0) != (ssize_t)length)
		@throw [OFWriteFailedException
		    exceptionWithObject: self
			requestedLength: length

				  errNo: of_socket_errno()];
#else


	if (length > INT_MAX)
		@throw [OFOutOfRangeException exception];

	if (send(_socket, buffer, (int)length, 0) != (int)length)
		@throw [OFWriteFailedException
		    exceptionWithObject: self
			requestedLength: length

				  errNo: of_socket_errno()];
#endif






}

#ifdef OF_WINDOWS
- (void)setBlocking: (bool)enable
{
	u_long v = enable;
	_blocking = enable;







>
>



|



>


>
>



|



>


>
>
>
>
>
>







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
- (void)lowlevelWriteBuffer: (const void *)buffer
		     length: (size_t)length
{
	if (_socket == INVALID_SOCKET)
		@throw [OFNotOpenException exceptionWithObject: self];

#ifndef OF_WINDOWS
	ssize_t bytesWritten;

	if (length > SSIZE_MAX)
		@throw [OFOutOfRangeException exception];

	if ((bytesWritten = send(_socket, buffer, length, 0)) < 0)
		@throw [OFWriteFailedException
		    exceptionWithObject: self
			requestedLength: length
			   bytesWritten: 0
				  errNo: of_socket_errno()];
#else
	int bytesWritten;

	if (length > INT_MAX)
		@throw [OFOutOfRangeException exception];

	if ((bytesWritten = send(_socket, buffer, (int)length, 0)) < 0)
		@throw [OFWriteFailedException
		    exceptionWithObject: self
			requestedLength: length
			   bytesWritten: 0
				  errNo: of_socket_errno()];
#endif

	if ((size_t)bytesWritten != length)
		@throw [OFWriteFailedException exceptionWithObject: self
						   requestedLength: length
						      bytesWritten: bytesWritten
							     errNo: 0];
}

#ifdef OF_WINDOWS
- (void)setBlocking: (bool)enable
{
	u_long v = enable;
	_blocking = enable;