Skip to content
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

Update Objective-C on error/cancel to include final_stream_intel #1954

Merged
merged 10 commits into from
Dec 1, 2021

Conversation

jpsim
Copy link
Contributor

@jpsim jpsim commented Nov 30, 2021

Description: This is a followup to #1937.
Risk Level: I believe these extra parameters are safe to ignore if we don't need to propagate them to the Objective-C interface, but would like someone else to confirm that.
Testing: Example apps still work, and downstream (closed source) consumers now compile again.
Docs Changes:
Release Notes:
[Optional Fixes #Issue]
[Optional Deprecated:]

Signed-off-by: JP Simard <jp@jpsim.com>
Signed-off-by: JP Simard <jp@jpsim.com>
Signed-off-by: JP Simard <jp@jpsim.com>
Signed-off-by: JP Simard <jp@jpsim.com>
@jpsim jpsim marked this pull request as draft November 30, 2021 20:31
Signed-off-by: JP Simard <jp@jpsim.com>
@jpsim jpsim marked this pull request as ready for review November 30, 2021 20:53
@@ -74,14 +75,15 @@
return NULL;
}

static void *ios_on_cancel(envoy_stream_intel stream_intel, void *context) {
static void *ios_on_send_window_available(envoy_stream_intel stream_intel, void *context) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this got switched up with ios_on_cancel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed to ios_on_cancel_impl in 7af1f6e

Copy link
Contributor

@goaway goaway Nov 30, 2021

Choose a reason for hiding this comment

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

Instead, could you update on_cancel and just ignore the new arg? And then add a no-op on_send_window_available stub.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was under the impression that on_send_window_available was calling ios_on_cancel on purpose.

If that can be a no-op for now, then I'll do that. I didn't want to change behavior in this PR without that context.

Copy link
Contributor

Choose a reason for hiding this comment

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

nit - since you're not using the parameters, you can skip naming them and just include the type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is Objective-C though, not C++/Objective-C++, so I get this error if I omit the parameter name:

external/envoy_mobile/library/objective-c/EnvoyHTTPStreamImpl.m:66:54: warning: omitting the parameter name in a function definition is a C2x extension [-Wc2x-extensions]
                             envoy_final_stream_intel, void *context) {
                                                     ^

Signed-off-by: JP Simard <jp@jpsim.com>
@goaway
Copy link
Contributor

goaway commented Nov 30, 2021

Thanks for jumping on this @jpsim!

Signed-off-by: JP Simard <jp@jpsim.com>
Copy link
Contributor

@goaway goaway left a comment

Choose a reason for hiding this comment

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

Just a small request with respect to handling the on_cancel/send_window callbacks (see above).

@@ -143,9 +150,9 @@ - (instancetype)initWithHandle:(envoy_stream_t)handle

// Create native callbacks
// TODO(goaway) fix this up to call ios_on_send_window_available
envoy_http_callbacks native_callbacks = {ios_on_headers, ios_on_data, ios_on_metadata,
ios_on_trailers, ios_on_error, ios_on_complete,
ios_on_cancel, ios_on_cancel, context};
Copy link
Contributor

Choose a reason for hiding this comment

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

This was a (awful) hack, because we needed a function with a valid signature. It would be better to use an explicit no-op callback for on_send_window_available until we have time to wire it through.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in d5867ef

Signed-off-by: JP Simard <jp@jpsim.com>
Signed-off-by: JP Simard <jp@jpsim.com>
Copy link
Contributor

@goaway goaway left a comment

Choose a reason for hiding this comment

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

Thanks @jpsim!

Left one minor nit, not a big deal though.

@jpsim
Copy link
Contributor Author

jpsim commented Dec 1, 2021

If there's nothing further, @goaway could you please merge when you get a chance so we can update our downstream consumers?

@goaway goaway merged commit a432263 into envoyproxy:main Dec 1, 2021
@jpsim jpsim deleted the objc-final-stream-intel branch December 1, 2021 20:54
junr03 pushed a commit that referenced this pull request Dec 15, 2021
Description: This is a followup to #1937.
Risk Level: I believe these extra parameters are safe to ignore if we don't need to propagate them to the Objective-C interface, but would like someone else to confirm that. (Confirmed.)
Testing: Example apps still work, and downstream (closed source) consumers now compile again.

Signed-off-by: JP Simard <jp@jpsim.com>
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