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

support poll #33

Closed
djwatson opened this issue May 12, 2016 · 5 comments
Closed

support poll #33

djwatson opened this issue May 12, 2016 · 5 comments

Comments

@djwatson
Copy link
Member

Poll isn't currently supported. Related, it looks like recvmsg / sendmsg don't block in blocking mode.

@lancerchao
Copy link
Contributor

lancerchao commented Jun 15, 2016

A simple implementation would be to piggy-back off tsk->socket's poll e.g.


static unsigned int tls_poll(struct file *file, struct socket *sock,
              struct poll_table_struct *wait) {
    struct tls_sock *tsk;
    tsk = tls_sk(sock->sk);
    return tsk->socket->ops->poll(tsk->socket->file, tsk->socket, wait);

@fridex
Copy link
Member

fridex commented Jun 15, 2016

I was thinking about the same approach. We have to keep in mind, that we are above TCP/UDP. E.g. for POLLERR we should consider even errors during decryption (etc).

For now it will be probably OK to return ENOTSUPP for unsupported cases IMHO.

Just a note regarding POLLPRI in TCP - there should be implemented OOB support in tcp_read_sock() once we switch to it (see #21).

@djwatson
Copy link
Member Author

For writes, this approach should work fine. For reads, tcp does the wakeup via the original sk_data_ready, so we would need to make sure we call it in the right places

@fridex
Copy link
Member

fridex commented Jun 15, 2016

A custom callback tls_data_ready just spawns a worker and calls the original sk_data_ready to wake up possibly waiting recipient. The issue here I see is the asynchronous decryption that can make poll(2) tricky to implement for some events.

@djwatson
Copy link
Member Author

fixed by #62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants