[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r38116 - libmicrohttpd/src/microhttpd
From: |
gnunet |
Subject: |
[GNUnet-SVN] r38116 - libmicrohttpd/src/microhttpd |
Date: |
Tue, 11 Oct 2016 17:21:17 +0200 |
Author: Karlson2k
Date: 2016-10-11 17:21:17 +0200 (Tue, 11 Oct 2016)
New Revision: 38116
Modified:
libmicrohttpd/src/microhttpd/daemon.c
libmicrohttpd/src/microhttpd/mhd_itc.h
Log:
Renamed 'MHD_pipe_drain_' -> 'MHD_itc_clear_'
Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c 2016-10-11 15:21:14 UTC (rev
38115)
+++ libmicrohttpd/src/microhttpd/daemon.c 2016-10-11 15:21:17 UTC (rev
38116)
@@ -1416,7 +1416,7 @@
if ( (! MHD_INVALID_PIPE_(daemon->itc)) &&
(FD_ISSET (MHD_itc_r_fd_ (daemon->itc),
&rs)) )
- MHD_pipe_drain_ (daemon->itc);
+ MHD_itc_clear_ (daemon->itc);
#endif
if (MHD_NO ==
call_handlers (con,
@@ -1487,7 +1487,7 @@
/* drain signaling pipe before other processing */
if ( (! MHD_INVALID_PIPE_(daemon->itc)) &&
(0 != (p[1].revents & (POLLERR | POLLHUP | POLLIN))) )
- MHD_pipe_drain_ (daemon->itc);
+ MHD_itc_clear_ (daemon->itc);
#endif
if (MHD_NO ==
call_handlers (con,
@@ -2707,7 +2707,7 @@
if ( (! MHD_INVALID_PIPE_(daemon->itc)) &&
(FD_ISSET (MHD_itc_r_fd_ (daemon->itc),
read_fd_set)) )
- MHD_pipe_drain_ (daemon->itc);
+ MHD_itc_clear_ (daemon->itc);
/* Resuming external connections when using an extern mainloop */
if (MHD_USE_SUSPEND_RESUME == (daemon->options & mask))
@@ -3088,7 +3088,7 @@
new signals will be processed in next loop */
if ( (-1 != poll_pipe) &&
(0 != (p[poll_pipe].revents & POLLIN)) )
- MHD_pipe_drain_ (daemon->itc);
+ MHD_itc_clear_ (daemon->itc);
/* handle shutdown */
if (MHD_YES == daemon->shutdown)
@@ -3214,7 +3214,7 @@
}
if ( (-1 != poll_pipe) &&
(0 != (p[poll_pipe].revents & POLLIN)) )
- MHD_pipe_drain_ (daemon->itc);
+ MHD_itc_clear_ (daemon->itc);
/* handle shutdown */
if (MHD_YES == daemon->shutdown)
@@ -3497,7 +3497,7 @@
{
/* It's OK to drain pipe here as all external
conditions will be processed later. */
- MHD_pipe_drain_ (daemon->itc);
+ MHD_itc_clear_ (daemon->itc);
continue;
}
if (daemon == events[i].data.ptr)
Modified: libmicrohttpd/src/microhttpd/mhd_itc.h
===================================================================
--- libmicrohttpd/src/microhttpd/mhd_itc.h 2016-10-11 15:21:14 UTC (rev
38115)
+++ libmicrohttpd/src/microhttpd/mhd_itc.h 2016-10-11 15:21:17 UTC (rev
38116)
@@ -90,12 +90,13 @@
#define MHD_itc_w_fd_(itc) ((int)(itc))
/**
- * drain data from real pipe
+ * Clear signaled state on @a itc
+ * @param itc the itc to clear
*/
-#define MHD_pipe_drain_(pip) do { \
- uint64_t tmp; \
- read (pip, &tmp, sizeof (tmp)); \
- } while (0)
+#define MHD_itc_clear_(itc) \
+ do { uint64_t __b; int __r; \
+ __r = read((itc), &__b, sizeof(__b)); \
+ (void)__r; } while(0)
/**
* Close any FDs of the pipe (non-W32)
@@ -178,12 +179,13 @@
#define MHD_itc_w_fd_(itc) ((itc).fd[1])
/**
- * drain data from real pipe
+ * Clear signaled state on @a itc
+ * @param itc the itc to clear
*/
-#define MHD_pipe_drain_(pip) do { \
- long tmp; \
- while (0 < read((pip).fd[0], (void*)&tmp, sizeof (tmp))) ; \
- } while (0)
+#define MHD_itc_clear_(itc) do \
+ { long __b; \
+ while(0 < read((itc).fd[0], &__b, sizeof(__b))) \
+ {} } while(0)
/**
* Close any FDs of the pipe (non-W32)
@@ -263,11 +265,16 @@
#define MHD_itc_w_fd_(itc) ((itc).sk[1])
/**
- * Drain data from emulated pipe
+ * Clear signaled state on @a itc
+ * @param itc the itc to clear
*/
-#define MHD_pipe_drain_(pip) do { long tmp; while (0 < recv((pip).sk[0],
(void*)&tmp, sizeof (tmp), 0)) ; } while (0)
+#define MHD_itc_clear_(itc) do \
+ { long __b; \
+ while(0 < recv((itc).sk[0], \
+ (char*)&__b, \
+ sizeof(__b), 0)) \
+ {} } while(0)
-
/**
* Close emulated pipe FDs
*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r38116 - libmicrohttpd/src/microhttpd,
gnunet <=