-
Notifications
You must be signed in to change notification settings - Fork 283
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
Use the poll() instead of select() for check state of the socket . #243
Conversation
It need for use fd more then 1024
default is on.
default is on.
Conflicts: src/data-types/mailstream_socket.c
poll used by default, but optionaly can use select (set use_poll=no in confugure)
poll used by default, but optionaly can use select (set use_poll=no in confugure)
Conflicts: src/data-types/mailstream_socket.c src/data-types/mailstream_ssl.c
@@ -156,6 +156,14 @@ AC_CHECK_HEADERS(netdb.h netinet/in.h sys/socket.h) | |||
AC_CHECK_HEADERS(sys/param.h sys/select.h inttypes.h) | |||
AC_CHECK_HEADERS(arpa/inet.h winsock2.h) | |||
|
|||
use_poll=yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you set poll() not to be used by default for now since it's a risky change?
I'd like to test it for a little bit before making it the default.
Use: AC_ARG_WITH() so that we can use:
$ ./configure --with-poll
I did it. |
Could you investigate the build breakage, at least for Linux? |
Last commit fix it. No? |
r = select(max_fd + 1, &fds_read, &fds_write, NULL, &timeout); | ||
if (r <= 0) | ||
if (r < 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you change it from <= 0 to < 0?
Thanks! I think when I commented on it, it was still red. It probably happened simultaneously :) |
+ more one select() changed to poll()
I found more one select() and review fix. |
r = select(max_fd + 1, &fds_read, NULL, NULL, &timeout); | ||
if (r <= 0) | ||
return -1; | ||
|
||
cancelled = (FD_ISSET(fd, &fds_read)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line disappeared.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
have you more comments? |
It looks all good now! Thanks for helping with that feature! |
poll used by default. Optionally can use select() (set use_poll=no in configure)
It need for correct working with file descriptors more then 1023.