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

Introduce CS_INTERRUPT_CB and corresponding return values: CS_INT_*. #625

Closed
wants to merge 1 commit into from

Conversation

ucko
Copy link
Contributor

@ucko ucko commented Dec 19, 2024

Define CS_INTERRUPT_CB's numeric value alongside other CS_*_CBs'; start a new 94xx range to preclude accidental duplication. (Sybase/SAP ctlib has no such property.) For CS_INT_*, copy TDS_INT_* and confirm their equality at compile time as with CS_NULLTERM et al.

@freddy77
Copy link
Contributor

The pointer to pointer to function looks odd to me. In ct_callback func, passed as CS_VOID * is simply converted to function pointer. About ct_callback: won't be sensible to extend ct_callback instead of ct_config ?

@ucko ucko force-pushed the ncbi-2024-12-cs_interrupt_cb branch from 88b8128 to 4aef5d0 Compare December 20, 2024 15:56
@ucko
Copy link
Contributor Author

ucko commented Dec 20, 2024

Good points; I've reworked it as an extension to ct_callback, which I'd somehow overlooked.

@ucko
Copy link
Contributor Author

ucko commented Dec 20, 2024

FTR, Sybase/SAP ctlib instead implements CS_ASYNC_IO and CS_DEFER_IO, which are more involved and require bigger changes to callers.

Define CS_INTERRUPT_CB's numeric value alongside other CS_*_CBs';
start a new 94xx range to avoid confusion with properties.
(Sybase/SAP ctlib has no such callback.)  Allow specification on
either the connection or the context level as usual, with the help of
a shim installed on demand to minimize interference with tds_select's
optimization for the no-handler case.  For CS_INT_*, copy TDS_INT_*
and confirm their equality at compile time as with CS_NULLTERM et al.

Add a test roughly modeled on dblib's timeout.c unit test, which
(alone) exercises the corresponding db_setinterrupt API.

Signed-off-by: Aaron M. Ucko <[email protected]>
@ucko ucko force-pushed the ncbi-2024-12-cs_interrupt_cb branch from 4aef5d0 to 31d7044 Compare January 6, 2025 17:03
@ucko
Copy link
Contributor Author

ucko commented Jan 6, 2025

I've force-pushed a new version of this patch addressing your feedback (apart from the very longstanding use of underscore prefixes in _*_cb field names).

@freddy77
Copy link
Contributor

freddy77 commented Jan 8, 2025

Merged. Indented test source again.

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