181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
if (request.remoteAddress != self.remoteAddress &&
!of_socket_address_equal(request.remoteAddress, self.remoteAddress))
return false;
return true;
}
- (uint32_t)hash
{
uint32_t hash;
OF_HASH_INIT(hash);
OF_HASH_ADD(hash, _method);
OF_HASH_ADD(hash, _protocolVersion.major);
|
|
|
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
if (request.remoteAddress != self.remoteAddress &&
!of_socket_address_equal(request.remoteAddress, self.remoteAddress))
return false;
return true;
}
- (unsigned long)hash
{
uint32_t hash;
OF_HASH_INIT(hash);
OF_HASH_ADD(hash, _method);
OF_HASH_ADD(hash, _protocolVersion.major);
|
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
return hash;
}
- (void)setProtocolVersion: (of_http_request_protocol_version_t)protocolVersion
{
if (protocolVersion.major != 1 || protocolVersion.minor > 1)
@throw [OFUnsupportedVersionException exceptionWithVersion:
[OFString stringWithFormat: @"%u.%u",
protocolVersion.major,
protocolVersion.minor]];
_protocolVersion = protocolVersion;
}
- (of_http_request_protocol_version_t)protocolVersion
|
|
|
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
return hash;
}
- (void)setProtocolVersion: (of_http_request_protocol_version_t)protocolVersion
{
if (protocolVersion.major != 1 || protocolVersion.minor > 1)
@throw [OFUnsupportedVersionException exceptionWithVersion:
[OFString stringWithFormat: @"%hhu.%hhu",
protocolVersion.major,
protocolVersion.minor]];
_protocolVersion = protocolVersion;
}
- (of_http_request_protocol_version_t)protocolVersion
|
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
|
if (components.count != 2)
@throw [OFInvalidFormatException exception];
major = [components.firstObject unsignedLongLongValue];
minor = [components.lastObject unsignedLongLongValue];
if (major > UINT8_MAX || minor > UINT8_MAX)
@throw [OFOutOfRangeException exception];
protocolVersion.major = (uint8_t)major;
protocolVersion.minor = (uint8_t)minor;
self.protocolVersion = protocolVersion;
objc_autoreleasePoolPop(pool);
}
- (OFString *)protocolVersionString
{
return [OFString stringWithFormat: @"%u.%u",
_protocolVersion.major,
_protocolVersion.minor];
}
- (OFString *)description
{
void *pool = objc_autoreleasePoolPush();
|
|
|
|
|
|
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
|
if (components.count != 2)
@throw [OFInvalidFormatException exception];
major = [components.firstObject unsignedLongLongValue];
minor = [components.lastObject unsignedLongLongValue];
if (major > UCHAR_MAX || minor > UCHAR_MAX)
@throw [OFOutOfRangeException exception];
protocolVersion.major = (unsigned char)major;
protocolVersion.minor = (unsigned char)minor;
self.protocolVersion = protocolVersion;
objc_autoreleasePoolPop(pool);
}
- (OFString *)protocolVersionString
{
return [OFString stringWithFormat: @"%hhu.%hhu",
_protocolVersion.major,
_protocolVersion.minor];
}
- (OFString *)description
{
void *pool = objc_autoreleasePoolPush();
|