Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
  • 3 commits
  • 2 files changed
  • 1 commit comment
  • 2 contributors
Showing with 17 additions and 9 deletions.
  1. +1 −0  src/common.h
  2. +16 −9 src/ispdy.m
View
1  src/common.h
@@ -144,6 +144,7 @@ typedef enum {
// Private version of setTimeout and friends
- (void) _setTimeout: (NSTimeInterval) timeout;
+- (void) _scheduleInRunLoop: (NSRunLoop*) loop forMode: (NSString*) mode;
- (void) _removeFromRunLoop: (NSRunLoop*) loop forMode: (NSString*) mode;
- (void) _setNoDelay: (BOOL) enable;
- (void) _setKeepAlive: (NSInteger) keepalive;
View
25 src/ispdy.m
@@ -235,13 +235,8 @@ - (void) dealloc {
- (void) scheduleInRunLoop: (NSRunLoop*) loop forMode: (NSString*) mode {
- ISpdyLoopWrap* wrap = [ISpdyLoopWrap stateForLoop: loop andMode: mode];
-
[self _connectionDispatch: ^{
- [scheduled_loops_ addObject: wrap];
-
- [in_stream_ scheduleInRunLoop: wrap.loop forMode: wrap.mode];
- [out_stream_ scheduleInRunLoop: wrap.loop forMode: wrap.mode];
+ [self _scheduleInRunLoop: loop forMode: mode];
}];
}
@@ -333,7 +328,9 @@ - (BOOL) connect {
secure: secure_];
}
- [self _lazySchedule];
+ [self _connectionDispatchSync: ^{
+ [self _lazySchedule];
+ }];
_state = kISpdyStateConnecting;
[in_stream_ open];
@@ -525,8 +522,8 @@ - (void) _fdWithBlock: (void(^)(CFSocketNativeHandle)) block {
- (void) _lazySchedule {
if ([scheduled_loops_ count] == 0) {
on_ispdy_loop_ = YES;
- [self scheduleInRunLoop: [ISpdyLoop defaultLoop]
- forMode: NSDefaultRunLoopMode];
+ [self _scheduleInRunLoop: [ISpdyLoop defaultLoop]
+ forMode: NSDefaultRunLoopMode];
}
}
@@ -565,6 +562,16 @@ - (void) _setTimeout: (NSTimeInterval) timeout {
}
+- (void) _scheduleInRunLoop: (NSRunLoop*) loop forMode: (NSString*) mode {
+ ISpdyLoopWrap* wrap = [ISpdyLoopWrap stateForLoop: loop andMode: mode];
+
+ [scheduled_loops_ addObject: wrap];
+
+ [in_stream_ scheduleInRunLoop: wrap.loop forMode: wrap.mode];
+ [out_stream_ scheduleInRunLoop: wrap.loop forMode: wrap.mode];
+}
+
+
- (void) _removeFromRunLoop: (NSRunLoop*) loop forMode: (NSString*) mode {
ISpdyLoopWrap* wrap = [ISpdyLoopWrap stateForLoop: loop andMode: mode];
[scheduled_loops_ removeObject: wrap];

Showing you all comments on commits in this comparison.

@georgekola
Owner

Looks Good!

Something went wrong with that request. Please try again.