Created
January 8, 2020 01:30
-
-
Save junr03/dc4f48b72b5a54f1025c21cb3f94c26a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void ios_on_headers(envoy_headers headers, bool end_stream, void *context) { | |
// reconstituted callback. | |
ios_context *c = (ios_context *)context; | |
EnvoyHTTPCallbacks *callbacks = c->callbacks; | |
// dispatching to user-provided dispatch queue. | |
dispatch_async(callbacks.dispatchQueue, ^{ | |
if (!dispatchable(c->closed, end_stream) || !callbacks.onHeaders) { | |
return; | |
} | |
// calling user-provided block. | |
callbacks.onHeaders(to_ios_headers(headers), end_stream); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment