-
Notifications
You must be signed in to change notification settings - Fork 2
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
Some parts of the code look strange ==> refactoring might be needed #3
Comments
I really appreciate your feedback, and I'm glad someone else found this useful, but I don't believe anyone at Jive is maintaining this anymore, so your best bet is to fork this project and update it yourself.
As I explain in the README, most of this came directly from Apple's CustomHTTPProtocol, and I made no effort to clean it up. I just namespaced the classes so it wouldn't conflict with other libraries that used the example code. Obviously Apple had some sub-optimal code that I didn't improve.
I'm not sure what you mean.
This isn't a retain cycle. |
My bad. I've posted a wrong link. The |
* assert() ==> NSParameterAssert() * using _cmd instead of selector literals where appropriate * JAHPQNSURLSessionDemuxTaskInfo extracted to a separate file * a few typedefs introduced for convenience * a few local variables extracted
* Extracted some invariants as local variables * Removed some duplicated calls
Some refactoring done in #7 |
I remember now why I didn't do any reformatting or refactoring of the sample code. I wanted to be sure it would be easy to diff the example code if it ever changed, and I wanted to update it. You could add a line in the README explaining that strategy. Refactoring the example code is fine, but please keep the existing formatting. |
1). Obsolete
AND
withtrue
with no reason or valuehttps://github.com/jivesoftware/JiveAuthenticatingHTTPProtocol/blob/master/Source/JiveAuthenticatingHTTPProtocol/JAHPAuthenticatingHTTPProtocol.m#L256
This is equivalent to
shouldAccept = [scheme isEqual:@"http"];
according to the boolean algebra theory.2).
_cmd
can be used for most delegate method forwarding.https://github.com/jivesoftware/JiveAuthenticatingHTTPProtocol/blob/master/Source/JiveAuthenticatingHTTPProtocol/JAHPAuthenticatingHTTPProtocol.m#L527
3). "Pure C"
assert()
function used in objective-c methods instead ofNSAssert()
orNSParameterAssert()
that provide better error messages and crash dumps.4). Retain cycles and possibly memory leaks. No single "weakify" statement across the entire project.
For example :
If such lifetime behaviour is desired, some memory management related comments are needed.
The text was updated successfully, but these errors were encountered: