[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 02/09: test_upgrade: don't fail with particular sockets
From: |
gnunet |
Subject: |
[libmicrohttpd] 02/09: test_upgrade: don't fail with particular sockets errors |
Date: |
Sat, 15 Jan 2022 15:47:42 +0100 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 34a6a0254f3a343f4fdb5efa9633dd2b589bf929
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sat Jan 15 15:29:56 2022 +0300
test_upgrade: don't fail with particular sockets errors
---
src/microhttpd/test_upgrade.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c
index ba242c33..1e5430bc 100644
--- a/src/microhttpd/test_upgrade.c
+++ b/src/microhttpd/test_upgrade.c
@@ -772,7 +772,8 @@ send_all (struct wr_socket *sock,
len - off);
if (0 > ret)
{
- if (MHD_SCKT_ERR_IS_EAGAIN_ (MHD_socket_get_error_ ()))
+ if (MHD_SCKT_ERR_IS_EAGAIN_ (MHD_socket_get_error_ ()) ||
+ MHD_SCKT_ERR_IS_EINTR_ (MHD_socket_get_error_ ()))
{
ret = 0;
continue;
@@ -807,6 +808,8 @@ recv_hdr (struct wr_socket *sock)
{
if (MHD_SCKT_ERR_IS_EAGAIN_ (MHD_socket_get_error_ ()))
continue;
+ if (MHD_SCKT_ERR_IS_EINTR_ (MHD_socket_get_error_ ()))
+ continue;
externalErrorExitDesc ("recv() failed");
}
if (0 == ret)
@@ -849,7 +852,8 @@ recv_all (struct wr_socket *sock,
len - off);
if (0 > ret)
{
- if (MHD_SCKT_ERR_IS_EAGAIN_ (MHD_socket_get_error_ ()))
+ if (MHD_SCKT_ERR_IS_EAGAIN_ (MHD_socket_get_error_ ()) ||
+ MHD_SCKT_ERR_IS_EINTR_ (MHD_socket_get_error_ ()))
{
ret = 0;
continue;
@@ -1107,7 +1111,17 @@ run_mhd_select_loop (struct MHD_Daemon *daemon)
&ws,
&es,
&tv))
- mhdErrorExitDesc ("MHD_get_fdset() failed"); /* TODO: handle errors */
+ {
+#ifdef MHD_POSIX_SOCKETS
+ if (EINTR != errno)
+ externalErrorExitDesc ("Unexpected select() error");
+#else
+ if ((WSAEINVAL != WSAGetLastError ()) ||
+ (0 != rs.fd_count) || (0 != ws.fd_count) || (0 != es.fd_count) )
+ externalErrorExitDesc ("Unexpected select() error");
+ Sleep (tv.tv_sec * 1000 + tv.tv_usec / 1000);
+#endif
+ }
MHD_run_from_select (daemon,
&rs,
&ws,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (376afc84 -> 0ea5d514), gnunet, 2022/01/15
- [libmicrohttpd] 02/09: test_upgrade: don't fail with particular sockets errors,
gnunet <=
- [libmicrohttpd] 03/09: test_upgrade: fail if connection is closed when it shouldn't, gnunet, 2022/01/15
- [libmicrohttpd] 01/09: test_upgrade: replaced a few left abort() with meaningful descriptions, gnunet, 2022/01/15
- [libmicrohttpd] 05/09: test_upgrade: minor code refactoring, gnunet, 2022/01/15
- [libmicrohttpd] 09/09: test_upgrade{, _large}: used the same port for all checks., gnunet, 2022/01/15
- [libmicrohttpd] 06/09: test_upgrade: added missing fflush(), gnunet, 2022/01/15
- [libmicrohttpd] 04/09: test_upgrade: use 'volatile' for variable with multithread access, gnunet, 2022/01/15
- [libmicrohttpd] 07/09: test_upgrade_large: applied fixes and improvements from test_upgrade, gnunet, 2022/01/15
- [libmicrohttpd] 08/09: test_upgrade{,_large}: simplified stdout,stderr flushing, gnunet, 2022/01/15