> So I thought the wait_read_hook would have a default
> implementation if I didn't overwrite it's function pointer,
> so far I have added this:
>
> static int cutelyst_wait_fd_read(int fd, int timeout) {
> qDebug() << Q_FUNC_INFO;
> QAbstractSocket *sock = new
> QAbstractSocket(QAbstractSocket::TcpSocket, qApp);
> sock->setSocketDescriptor(fd);
> sock->waitForReadyRead(timeout)
> qDebug() << Q_FUNC_INFO << sock->bytesAvailable();
> return sock->bytesAvailable();
> }
>
> and it works, however this is far from optimal.
>
> Is the fd always an TcpSocket?
> Since the fd is always the same (at least here),
> wouldn't be better to use the socket notifier
> on the req->fd?
>
> Thanks
>
Your implementation should be added for sure in the qtloop plugin (feel
free to make a pull request even for the write and sleep hooks), but as
you said, it should fallback to the default implementation (the poll-based
one)
The default hooks are initialized in init.c:
uwsgi.wait_read_hook = uwsgi_simple_wait_read_hook;
uwsgi.wait_write_hook = uwsgi_simple_wait_write_hook;
uwsgi.wait_milliseconds_hook = uwsgi_simple_wait_milliseconds_hook;
uwsgi.wait_read2_hook = uwsgi_simple_wait_read2_hook;
--
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi