Skip to content

Fixed the last 6 warnings, enabled "Treat warnings as errors"#29

Open
cristiankocza-sv wants to merge 1 commit intoVoxer:Voxerfrom
cristiankocza-sv:warnings
Open

Fixed the last 6 warnings, enabled "Treat warnings as errors"#29
cristiankocza-sv wants to merge 1 commit intoVoxer:Voxerfrom
cristiankocza-sv:warnings

Conversation

@cristiankocza-sv
Copy link

  • Fixed incompatible code property of ISpdyError with the base class NSError: replaced the getter declaration by a property one, using NS_ENUM to make ISpdyErrorCode compatible with NSInteger (the type of NSError's code property), and updated a format string due to this change (common.m:185)
  • Fixed _closeSocket declaration and implementation differing in return type
  • Fixed an integer precision warning (ispdy.m:1047)
  • Fixed the null argument passed to non-null parameter warning in loop.m, added for this a dummy timer method and passing that to the timer
  • Fixed retain cycle warning by using weak reference to self in request.m
  • Updated the project file and the podspec to enable the "Treat warnings as errors" build setting

- Fixed incompatible code property of ISpdyError with the base class NSError: replaced the getter declaration by a property one, using NS_ENUM to make ISpdyErrorCode compatible with NSInteger (the type of NSError's code property), and updated a format string due to this change (common.m:185)
- Fixed _closeSocket declaration and implementation differing in return type
- Fixed an integer precision warning (ispdy.m:1047)
- Fixed the null argument passed to non-null parameter warning in loop.m, added for this a dummy timer method and passing that to the timer
- Fixed retain cycle warning by using weak reference to self in request.m
- Updated the project file and the podspec to enable the "Treat warnings as errors" build setting
@cristiankocza-sv
Copy link
Author

@indutny, @georgekola please take a look at this PR, I recommend we fix all warnings and enable the "treat warnings as error" build setting

Copy link
Contributor

Choose a reason for hiding this comment

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

This could be a bit dangerous. If the request will loose references - the data will be lost.

Copy link
Author

Choose a reason for hiding this comment

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

If the request gets deallocated then there's no point in updating it's window anyway, right? Unless we want to keep the request alive until this block gets executed...

Copy link
Contributor

Choose a reason for hiding this comment

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

@cristiankocza _windowUpdate is a way to unqueue accumulated data from request. Using weak here will probably cause some data to be not delivered...

Copy link
Author

Choose a reason for hiding this comment

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

Does this mean that a final _updateWindow message will be passed to the ISpdyRequest object? The one that nils the window_out_queue_ variable, thus breaking the circular reference? If yes, this means the request has at least one reference held by the caller of _updateWindow. If not, it means that the last _updateWindow that enqueues the block in discussion will create a leak.

Copy link
Author

Choose a reason for hiding this comment

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

The above assumptions are based only by looking at the code from _updateWindow, as I'm not familiar with the ISpdy design pardon any naive assumptions :)

Copy link
Contributor

Choose a reason for hiding this comment

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

That's the thing. This message will happen sometime in a future, when the server will acknowledge previously sent data. It will unlikely coincide with the refcount == 0.

Copy link
Author

Choose a reason for hiding this comment

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

But until then, won't a reference to the request be held somewhere, to know on which object to call _updateWindow on?

Copy link
Author

Choose a reason for hiding this comment

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

If we need a self-retaining logic for ISpdyRequest we might keep a reference to itself, and nullify it when appropriate.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm... this actually should work. Thanks!

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.

2 participants