-
Notifications
You must be signed in to change notification settings - Fork 143
Feature/multi nic curl callback #6830
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
base: main
Are you sure you want to change the base?
Feature/multi nic curl callback #6830
Conversation
…guration This change adds a new optional callback function to CurlTransportOptions that allows users to customize the CURL handle with additional options before request execution. Key changes: - Added CurlOptionsCallback field to CurlTransportOptions struct in curl_transport.hpp - Callback receives the CURL* handle (as void*) for setting custom options - Invoked just before curl_easy_perform() in CurlConnection constructor - Enables use cases like network interface binding via CURLOPT_INTERFACE This provides flexibility for advanced scenarios requiring per-request CURL customization while maintaining backward compatibility.
This change adds a CurlOptionsCallback member to CurlTransportOptions that allows applications to customize CURL handles before requests are sent. This enables scenarios like: - Network interface binding (CURLOPT_INTERFACE) for multi-NIC environments - Custom DNS server configuration - Request-specific CURL option overrides Key changes: - Added CurlOptionsCallback field to CurlTransportOptions struct - Callback is invoked BEFORE URL setup to prevent CURL from reprocessing the URL - Added comprehensive error handling and logging around callback invocation - Added unit test to verify callback functionality The callback timing is critical - it must be invoked before CURLOPT_URL is set to ensure options like CURLOPT_INTERFACE work correctly without URL corruption. Fixes Azure/azure-sdk-for-cpp#XXXX
- Move callback invocation to BEFORE CURLOPT_URL setup (critical fix) - Add CURLINFO_LOCAL_IP query to verify interface binding - Add comprehensive error handling around callback - Add detailed logging for debugging multi-NIC scenarios This ensures CURLOPT_INTERFACE is set before CURL processes the URL, preventing URL corruption and InvalidUri errors.
Keep implementation clean and minimal - remove debug logging and exception handling wrapper to keep the code simple and maintainable.
|
Thank you for your contribution @kraman-msft-eng! We will review the pull request and get back to you soon. |
|
@kraman-msft-eng please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
2 similar comments
|
@kraman-msft-eng please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
|
@kraman-msft-eng please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Pull Request Checklist
Added Callback to support implementing multi-nic delegation from client.