Skip to content

Support websocket compression#339

Merged
daltoniam merged 7 commits into
daltoniam:masterfrom
junelife:compression
Jun 24, 2017
Merged

Support websocket compression#339
daltoniam merged 7 commits into
daltoniam:masterfrom
junelife:compression

Conversation

@joejune

@joejune joejune commented May 25, 2017

Copy link
Copy Markdown
Contributor

Fixes #169.

Using the Autobahn test suite, I confirmed that these changes perform comparably with the Autobahn library itself. See attached report:

autobahn_test.html.zip

Comment thread Source/WebSocket.swift Outdated
if let cfHeaders = CFHTTPMessageCopyAllHeaderFields(response) {
let headers = cfHeaders.takeRetainedValue() as NSDictionary
if let extensionHeader = headers[headerWSExtensionName as NSString] as? NSString {
let parts = extensionHeader.components(separatedBy: ";")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for readability what about moving this out to another method. There are already some uber methods on this class personally my preference on this is to keep method size down where it makes logical sense.

Comment thread Source/Compression.swift
// Created by Joseph Ross on 5/23/17.
// Copyright © 2017 Vluxe. All rights reserved.
//

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to the spec here so that later if there is a bug one can quickly find the reference to follow: https://tools.ietf.org/html/rfc7692

@hishnash

Copy link
Copy Markdown
Contributor

Consider adding a short section to the readme for users.

@joejune

joejune commented May 25, 2017

Copy link
Copy Markdown
Contributor Author

@hishnash: Thanks for the great feedback. I've made all the changes you suggested.

Joseph Ross added 2 commits May 25, 2017 10:24
@rakeshpethani

Copy link
Copy Markdown

When is this support going to be available ?

@kiyoshi-shikuma

Copy link
Copy Markdown

+1 Also interested in this

@joejune

joejune commented Jun 15, 2017

Copy link
Copy Markdown
Contributor Author

@daltoniam: Is there anything I can do to help this PR land? Would it be better if I made compression disabled by default, and those who want to use it have to opt-in?

@daltoniam

Copy link
Copy Markdown
Owner

@joejune thank you much for this, it looks great. Also sorry for the delay, got distracted with life and WWDC. Love the tests, README updates, autobahn tests, very through much appreciated.

@daltoniam daltoniam merged commit 7bf478c into daltoniam:master Jun 24, 2017
@nuclearace

Copy link
Copy Markdown
Contributor

Did you test this with the Swift Package Manager? I have a feeling it might not like that you've included zlib outside of Sources.

@daltoniam

Copy link
Copy Markdown
Owner

ah right, package managers 😄. I have not done that yet, might have to fix that.

@daltoniam

Copy link
Copy Markdown
Owner

@nuclearace is there a way to test the package manager without have to create a new tag?

@nuclearace

Copy link
Copy Markdown
Contributor

Uh, if you create an app that has Starscream as a dependency and then put Starscream into edit mode.

@nuclearace

Copy link
Copy Markdown
Contributor

Actually I take that back, that wouldn't really help test if the dependency itself is right. I can't remember if they've added the ability to point to a branch

@daltoniam

Copy link
Copy Markdown
Owner

@daltoniam

Copy link
Copy Markdown
Owner

I guess I'll just create a test tag and work off of that (2.1.0).

@daltoniam

Copy link
Copy Markdown
Owner

@daltoniam

Copy link
Copy Markdown
Owner

@nuclearace I figured it out. I updated the 2.1.0 to build properly again.

@joejune

joejune commented Jun 26, 2017

Copy link
Copy Markdown
Contributor Author

Thanks for getting this merged in. I haven't worked with Swift Package Manager yet, so thanks for taking care of that aspect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants