Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
Add parallelism response header
Browse files Browse the repository at this point in the history
  • Loading branch information
goaway committed Jun 27, 2014
1 parent 019d78f commit b13596e
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions SPDY/SPDYSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -575,19 +575,14 @@ - (void)didReadSynReplyFrame:(SPDYSynReplyFrame *)synReplyFrame frameDecoder:(SP

#if INCLUDE_SPDY_RESPONSE_HEADERS
NSMutableDictionary *headers = [synReplyFrame.headers mutableCopy];
NSString *version = @"3.1";
if (_configuration.sessionPoolSize > 1) {
headers[@"x-spdy-version"] = [[NSString alloc] initWithFormat:@"%@-TCPx%lu", version, (unsigned long)_configuration.sessionPoolSize];
} else {
headers[@"x-spdy-version"] = version;
}
headers[@"x-spdy-version"] = @"3.1";
headers[@"x-spdy-parallelism"] = [[NSString alloc] initWithFormat:@"%lu", (unsigned long)_configuration.sessionPoolSize];
headers[@"x-spdy-stream-id"] = [[NSString alloc] initWithFormat:@"%u", streamId];

if (_sessionLatency > -1) {
NSString *sessionLatencyMs = [@((int)(_sessionLatency * 1000)) stringValue];
headers[@"x-spdy-session-latency"] = sessionLatencyMs;
}

headers[@"x-spdy-stream-id"] = [@(streamId) stringValue];
#else
NSDictionary *headers = synReplyFrame.headers;
#endif
Expand Down

0 comments on commit b13596e

Please sign in to comment.