Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lots of warning in Xcode 6.2 #144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Core/HTTPConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// Log levels: off, error, warn, info, verbose
// Other flags: trace
static const int httpLogLevel = HTTP_LOG_LEVEL_WARN; // | HTTP_LOG_FLAG_TRACE;
static const int httpLogLevel = HTTP_LOG_LEVEL_WARN | HTTP_LOG_LEVEL_VERBOSE; // | HTTP_LOG_FLAG_TRACE;

// Define chunk size used to read in data for responses
// This is how much data will be read from disk into RAM at a time
Expand Down
2 changes: 2 additions & 0 deletions Core/HTTPMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
CFHTTPMessageRef message;
}

@property(nonatomic, assign, readonly) CFHTTPMessageRef message;

- (id)initEmptyRequest;

- (id)initRequestWithMethod:(NSString *)method URL:(NSURL *)url version:(NSString *)version;
Expand Down
4 changes: 4 additions & 0 deletions Core/HTTPMessage.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

@implementation HTTPMessage

- (CFHTTPMessageRef) message {
return message;
}

- (id)initEmptyRequest
{
if ((self = [super init]))
Expand Down
8 changes: 4 additions & 4 deletions Core/Mime/MultipartFormDataParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#ifdef __x86_64__
#define FMTNSINT "li"
#else
#define FMTNSINT "i"
#define FMTNSINT "lu"
#endif


Expand All @@ -29,7 +29,7 @@ + (NSData*) decodedDataFromData:(NSData*) data encoding:(int) encoding;
- (int) findHeaderEnd:(NSData*) workingData fromOffset:(int) offset;
- (int) findContentEnd:(NSData*) data fromOffset:(int) offset;

- (int) numberOfBytesToLeavePendingWithData:(NSData*) data length:(NSUInteger) length encoding:(int) encoding;
- (int) numberOfBytesToLeavePendingWithData:(NSData*) data length:(int) length encoding:(int) encoding;
- (int) offsetTillNewlineSinceOffset:(int) offset inData:(NSData*) data;

- (int) processPreamble:(NSData*) workingData;
Expand Down Expand Up @@ -247,7 +247,7 @@ - (BOOL) appendData:(NSData *)data {
NSUInteger sizeToPass = workingData.length - offset - sizeToLeavePending;

// if we parse BASE64 encoded data, or Quoted-Printable data, we will make sure we don't break the format
int leaveTrailing = [self numberOfBytesToLeavePendingWithData:data length:sizeToPass encoding:currentEncoding];
int leaveTrailing = [self numberOfBytesToLeavePendingWithData:data length:(int)sizeToPass encoding:currentEncoding];
sizeToPass -= leaveTrailing;

if( sizeToPass <= 0 ) {
Expand All @@ -261,7 +261,7 @@ - (BOOL) appendData:(NSData *)data {
NSData* decodedData = [MultipartFormDataParser decodedDataFromData:[NSData dataWithBytesNoCopy:(char*)workingData.bytes + offset length:workingData.length - offset - sizeToLeavePending freeWhenDone:NO] encoding:currentEncoding];

if( [delegate respondsToSelector:@selector(processContent:WithHeader:)] ) {
HTTPLogVerbose(@"MultipartFormDataParser: Processed %"FMTNSINT" bytes of body",sizeToPass);
HTTPLogVerbose(@"MultipartFormDataParser: Processed %"FMTNSINT" bytes of body",(unsigned long)sizeToPass);

[delegate processContent: decodedData WithHeader:currentHeader];
}
Expand Down
10 changes: 5 additions & 5 deletions Core/WebSocket.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// Log levels: off, error, warn, info, verbose
// Other flags : trace
static const int httpLogLevel = HTTP_LOG_LEVEL_WARN; // | HTTP_LOG_FLAG_TRACE;
static const int httpLogLevel = HTTP_LOG_LEVEL_WARN | HTTP_LOG_LEVEL_VERBOSE; // | HTTP_LOG_FLAG_TRACE;

#define TIMEOUT_NONE -1
#define TIMEOUT_REQUEST_BODY 10
Expand All @@ -36,10 +36,10 @@
#define WS_OP_PING 9
#define WS_OP_PONG 10

static inline BOOL WS_OP_IS_FINAL_FRAGMENT(UInt8 frame)
{
return (frame & 0x80) ? YES : NO;
}
//static inline BOOL WS_OP_IS_FINAL_FRAGMENT(UInt8 frame)
//{
// return (frame & 0x80) ? YES : NO;
//}

static inline BOOL WS_PAYLOAD_IS_MASKED(UInt8 frame)
{
Expand Down
27 changes: 20 additions & 7 deletions Vendor/CocoaAsyncSocket/GCDAsyncSocket.m
Original file line number Diff line number Diff line change
Expand Up @@ -5865,22 +5865,26 @@ - (void)maybeStartTLS
NSDictionary *tlsSettings = tlsPacket->tlsSettings;

NSNumber *value;


#ifndef __IPHONE_4_0
value = [tlsSettings objectForKey:(NSString *)kCFStreamSSLAllowsAnyRoot];
if (value && [value boolValue] == YES)
canUseSecureTransport = NO;

value = [tlsSettings objectForKey:(NSString *)kCFStreamSSLAllowsExpiredRoots];
if (value && [value boolValue] == YES)
canUseSecureTransport = NO;

#endif

value = [tlsSettings objectForKey:(NSString *)kCFStreamSSLValidatesCertificateChain];
if (value && [value boolValue] == NO)
canUseSecureTransport = NO;


#ifndef __IPHONE_4_0
value = [tlsSettings objectForKey:(NSString *)kCFStreamSSLAllowsExpiredCertificates];
if (value && [value boolValue] == YES)
canUseSecureTransport = NO;
#endif
}
#endif

Expand Down Expand Up @@ -6230,6 +6234,7 @@ - (void)ssl_startTLS

// 2. kCFStreamSSLAllowsAnyRoot

#ifndef __IPHONE_4_0
value = [tlsSettings objectForKey:(NSString *)kCFStreamSSLAllowsAnyRoot];
if (value)
{
Expand All @@ -6248,9 +6253,11 @@ - (void)ssl_startTLS

#endif
}

#endif

// 3. kCFStreamSSLAllowsExpiredRoots

#ifndef __IPHONE_4_0
value = [tlsSettings objectForKey:(NSString *)kCFStreamSSLAllowsExpiredRoots];
if (value)
{
Expand All @@ -6269,7 +6276,8 @@ - (void)ssl_startTLS

#endif
}

#endif

// 4. kCFStreamSSLValidatesCertificateChain

value = [tlsSettings objectForKey:(NSString *)kCFStreamSSLValidatesCertificateChain];
Expand All @@ -6292,7 +6300,7 @@ - (void)ssl_startTLS
}

// 5. kCFStreamSSLAllowsExpiredCertificates
#ifndef __IPHONE_4_0
value = [tlsSettings objectForKey:(NSString *)kCFStreamSSLAllowsExpiredCertificates];
if (value)
{
Expand All @@ -6311,7 +6319,8 @@ - (void)ssl_startTLS

#endif
}

#endif

// 6. kCFStreamSSLCertificates

value = [tlsSettings objectForKey:(NSString *)kCFStreamSSLCertificates];
Expand Down Expand Up @@ -6743,6 +6752,10 @@ + (void)cfstreamThread { @autoreleasepool
LogInfo(@"CFStreamThread: Stopped");
}}

+ (void) doNothingAtAll:(id)sender {
NSAssert(NO, @"Never go here.");
}

+ (void)scheduleCFStreams:(GCDAsyncSocket *)asyncSocket
{
LogTrace();
Expand Down
2 changes: 1 addition & 1 deletion Vendor/CocoaLumberjack/DDTTYLogger.m
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ + (void)getRed:(CGFloat *)rPtr green:(CGFloat *)gPtr blue:(CGFloat *)bPtr fromCo
CGColorSpaceRef rgbColorSpace = CGColorSpaceCreateDeviceRGB();

unsigned char pixel[4];
CGContextRef context = CGBitmapContextCreate(&pixel, 1, 1, 8, 4, rgbColorSpace, kCGImageAlphaNoneSkipLast);
CGContextRef context = CGBitmapContextCreate(&pixel, 1, 1, 8, 4, rgbColorSpace, kCGBitmapAlphaInfoMask);

CGContextSetFillColorWithColor(context, [color CGColor]);
CGContextFillRect(context, CGRectMake(0, 0, 1, 1));
Expand Down