mirror of
https://github.com/swisspol/GCDWebServer.git
synced 2026-04-24 00:00:04 +08:00
Fixed more build warnings
This commit is contained in:
@@ -506,7 +506,7 @@ static dispatch_queue_t _formatterQueue = NULL;
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (GCDWebServerResponse*)processRequest:(GCDWebServerRequest*)request withBlock:(GCDWebServerProcessBlock)block {
|
- (GCDWebServerResponse*)processRequest:(GCDWebServerRequest*)request withBlock:(GCDWebServerProcessBlock)block {
|
||||||
LOG_DEBUG(@"Connection on socket %i processing %@ request for \"%@\" (%lu bytes body)", _socket, _request.method, _request.path, _request.contentLength);
|
LOG_DEBUG(@"Connection on socket %i processing %@ request for \"%@\" (%lu bytes body)", _socket, _request.method, _request.path, (unsigned long)_request.contentLength);
|
||||||
GCDWebServerResponse* response = nil;
|
GCDWebServerResponse* response = nil;
|
||||||
@try {
|
@try {
|
||||||
response = block(request);
|
response = block(request);
|
||||||
|
|||||||
@@ -283,10 +283,10 @@
|
|||||||
if ((range.location != NSNotFound) || (range.length > 0)) {
|
if ((range.location != NSNotFound) || (range.length > 0)) {
|
||||||
if (range.location != NSNotFound) {
|
if (range.location != NSNotFound) {
|
||||||
range.location = MIN(range.location, (NSUInteger)info.st_size);
|
range.location = MIN(range.location, (NSUInteger)info.st_size);
|
||||||
range.length = MIN(range.length, info.st_size - range.location);
|
range.length = MIN(range.length, (NSUInteger)info.st_size - range.location);
|
||||||
} else {
|
} else {
|
||||||
range.length = MIN(range.length, (NSUInteger)info.st_size);
|
range.length = MIN(range.length, (NSUInteger)info.st_size);
|
||||||
range.location = info.st_size - range.length;
|
range.location = (NSUInteger)info.st_size - range.length;
|
||||||
}
|
}
|
||||||
if (range.length == 0) {
|
if (range.length == 0) {
|
||||||
ARC_RELEASE(self);
|
ARC_RELEASE(self);
|
||||||
@@ -298,7 +298,7 @@
|
|||||||
type = kGCDWebServerDefaultMimeType;
|
type = kGCDWebServerDefaultMimeType;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((self = [super initWithContentType:type contentLength:(range.location != NSNotFound ? range.length : info.st_size)])) {
|
if ((self = [super initWithContentType:type contentLength:(range.location != NSNotFound ? range.length : (NSUInteger)info.st_size)])) {
|
||||||
_path = [path copy];
|
_path = [path copy];
|
||||||
if (range.location != NSNotFound) {
|
if (range.location != NSNotFound) {
|
||||||
_offset = range.location;
|
_offset = range.location;
|
||||||
@@ -308,7 +308,7 @@
|
|||||||
LOG_DEBUG(@"Using content bytes range [%i-%i] for file \"%@\"", (int)range.location, (int)(range.location + range.length - 1), path);
|
LOG_DEBUG(@"Using content bytes range [%i-%i] for file \"%@\"", (int)range.location, (int)(range.location + range.length - 1), path);
|
||||||
} else {
|
} else {
|
||||||
_offset = 0;
|
_offset = 0;
|
||||||
_size = info.st_size;
|
_size = (NSUInteger)info.st_size;
|
||||||
}
|
}
|
||||||
if (attachment) { // TODO: Use http://tools.ietf.org/html/rfc5987 to encode file names with special characters instead of using lossy conversion to ISO 8859-1
|
if (attachment) { // TODO: Use http://tools.ietf.org/html/rfc5987 to encode file names with special characters instead of using lossy conversion to ISO 8859-1
|
||||||
NSData* data = [[path lastPathComponent] dataUsingEncoding:NSISOLatin1StringEncoding allowLossyConversion:YES];
|
NSData* data = [[path lastPathComponent] dataUsingEncoding:NSISOLatin1StringEncoding allowLossyConversion:YES];
|
||||||
|
|||||||
Reference in New Issue
Block a user