[gnutls-devel] GnuTLS | gnutls-cli: Fix --starttls-proto=xmpp (!911)
Development of GNU's TLS library
gnutls-devel at lists.gnutls.org
Sat Feb 16 14:33:45 CET 2019
Nikos Mavrogiannopoulos started a new discussion on src/socket.c:
> tv.tv_usec = 0;
> ret = select(socket->fd + 1, &read_fds, NULL, NULL, &tv);
> - if (ret <= 0)
> - ret = -1;
> - else
> + if (ret > 0)
> ret = recv(socket->fd, pbuf, left, 0);
> - if (ret == -1 || ret == 0) {
> - int e = errno;
> - fprintf(stderr, "error receiving %s: %s\n", txt, strerror(e));
> + if (ret == -1) {
> + fprintf(stderr, "error receiving '%s': %s\n", txt, strerror(errno));
> + exit(2);
> + } else if (ret == 0) {
> + fprintf(stderr, "error receiving '%s': Timeout\n", txt);
> exit(2);
It looks ok to me, but I think it would be more re-assuring if we add a test for it a la starttls-pop3.sh. What do you think?
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/911#note_141948631
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20190216/2e951d5c/attachment-0001.html>
More information about the Gnutls-devel
mailing list