Skip to content

Commit

Permalink
Fix Xcode warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliopavia committed Mar 29, 2017
1 parent 0cf0c42 commit 5ed8d82
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions PocketSocket/PSWebSocket.m
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ - (instancetype)initClientSocketWithRequest:(NSURLRequest *)request {

switch (request.networkServiceType) {
case NSURLNetworkServiceTypeDefault:
case NSURLNetworkServiceTypeCallSignaling:
break;
case NSURLNetworkServiceTypeVoIP:
networkServiceType = NSStreamNetworkServiceTypeVoIP;
Expand Down
11 changes: 8 additions & 3 deletions PocketSocket/PSWebSocketDriver.m
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,10 @@ - (void)writeHandshakeRequest {

// set handshake sec key
NSMutableData *secKeyData = [NSMutableData dataWithLength:16];
SecRandomCopyBytes(kSecRandomDefault, secKeyData.length, secKeyData.mutableBytes);

int result = SecRandomCopyBytes(kSecRandomDefault, secKeyData.length, secKeyData.mutableBytes);
if (result != 0) {
PSWebSocketLog(@"SecRandomCopyBytes failed with: %d", result);
}
_handshakeSecKey = [self base64EncodedData:secKeyData];

NSURL *URL = _request.URL;
Expand Down Expand Up @@ -377,7 +379,10 @@ - (void)writeMessageWithOpCode:(PSWebSocketOpCode)opcode data:(NSData *)data {
headerBytes[1] |= PSWebSocketMaskMask;

uint8_t maskKey[4];
SecRandomCopyBytes(kSecRandomDefault, sizeof(maskKey), maskKey);
int result = SecRandomCopyBytes(kSecRandomDefault, sizeof(maskKey), maskKey);
if (result != 0) {
PSWebSocketLog(@"SecRandomCopyBytes failed with: %d", result);
}
[header appendBytes:maskKey length:sizeof(maskKey)];

// make copy if not already mutable
Expand Down
2 changes: 1 addition & 1 deletion PocketSocket/PSWebSocketServer.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

#import "PSWebSocketServer.h"
#import "PSwebSocket.h"
#import "PSWebSocket.h"
#import "PSWebSocketDriver.h"
#import "PSWebSocketInternal.h"
#import "PSWebSocketBuffer.h"
Expand Down

0 comments on commit 5ed8d82

Please sign in to comment.