ObjFW  Diff

Differences From Artifact [2d1b69a80f]:

To Artifact [a65b94e9ae]:


210
211
212
213
214
215
216
217

218
219
220
221
222
223
224


225
226

227
228
229
230
231
232
233
210
211
212
213
214
215
216

217
218
219
220
221
222


223
224
225

226
227
228
229
230
231
232
233







-
+





-
-
+
+

-
+







	return _protocolVersion;
}

- (void)setProtocolVersionString: (OFString *)string
{
	void *pool = objc_autoreleasePoolPush();
	OFArray *components = [string componentsSeparatedByString: @"."];
	intmax_t major, minor;
	unsigned long long major, minor;
	of_http_request_protocol_version_t protocolVersion;

	if (components.count != 2)
		@throw [OFInvalidFormatException exception];

	major = [components.firstObject decimalValue];
	minor = [components.lastObject decimalValue];
	major = [components.firstObject unsignedLongLongValue];
	minor = [components.lastObject unsignedLongLongValue];

	if (major < 0 || major > UINT8_MAX || minor < 0 || minor > UINT8_MAX)
	if (major > UINT8_MAX || minor > UINT8_MAX)
		@throw [OFOutOfRangeException exception];

	protocolVersion.major = (uint8_t)major;
	protocolVersion.minor = (uint8_t)minor;

	self.protocolVersion = protocolVersion;