Comment 0 for bug 1220467

Revision history for this message
Wim Lewis (wiml-omni) wrote :

When using libdrizzle in nonblocking mode, there's no way for the caller to know whether to wait for readability or writability on the socket when libdrizzle returns DRIZZLE_RETURN_IO_WAIT.

(Often it'll be waiting for readability, but it needs to wait for writability if you're sending a long query or bound parameter, or using SSL, or doing nonblocking connect.)

I can think of three obvious ways to extend the libdrizzle api to fix this:

- add a function drizzle_fd_waiting_for() (but with a better name) that returns POLLIN, POLLOUT, etc
- change drizzle_fd() to return both the fd and the current flags
- split DRIZZLE_RETURN_IO_WAIT into two return codes, DRIZZLE_RETURN_IO_READ and DRIZZLE_RETURN_IO_WRITE