-
Notifications
You must be signed in to change notification settings - Fork 84
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
Conversation
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>
@@ -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) { |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
52b0eb5
to
7af1f6e
Compare
Thanks for jumping on this @jpsim! |
Signed-off-by: JP Simard <jp@jpsim.com>
There was a problem hiding this 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}; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
There was a problem hiding this comment.
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>
78bf584
to
d5867ef
Compare
There was a problem hiding this 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.
If there's nothing further, @goaway could you please merge when you get a chance so we can update our downstream consumers? |
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>
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:]