[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 41/153: examples/ephiperfifo: checksrc compliance
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 41/153: examples/ephiperfifo: checksrc compliance |
Date: |
Tue, 11 Sep 2018 12:51:52 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 089833147420e1b6018c79d1929a8284b1b8aa8a
Author: Jay Satiro <address@hidden>
AuthorDate: Sun Jul 29 15:06:00 2018 -0400
examples/ephiperfifo: checksrc compliance
---
docs/examples/ephiperfifo.c | 45 ++++++++++++++++++++++++++-------------------
1 file changed, 26 insertions(+), 19 deletions(-)
diff --git a/docs/examples/ephiperfifo.c b/docs/examples/ephiperfifo.c
index e11715f1c..e27372598 100644
--- a/docs/examples/ephiperfifo.c
+++ b/docs/examples/ephiperfifo.c
@@ -154,17 +154,19 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms,
GlobalInfo *g)
fprintf(MSG_OUT, "multi_timer_cb: Setting timeout to %ld ms\n", timeout_ms);
timerfd_settime(g->tfd, /*flags=*/0, &its, NULL);
- if (timeout_ms > 0) {
+ if(timeout_ms > 0) {
its.it_interval.tv_sec = 1;
its.it_interval.tv_nsec = 0;
its.it_value.tv_sec = timeout_ms / 1000;
its.it_value.tv_nsec = (timeout_ms % 1000) * 1000;
timerfd_settime(g->tfd, /*flags=*/0, &its, NULL);
- } else if (timeout_ms == 0) {
+ }
+ else if(timeout_ms == 0) {
rc = curl_multi_socket_action(g->multi,
CURL_SOCKET_TIMEOUT, 0, &g->still_running);
mcode_or_die("multi_timer_cb: curl_multi_socket_action", rc);
- } else {
+ }
+ else {
memset(&its, 0, sizeof(struct itimerspec));
timerfd_settime(g->tfd, /*flags=*/0, &its, NULL);
}
@@ -232,12 +234,12 @@ static void timer_cb(GlobalInfo* g, int revents)
* epoll buffer (i.e. the timer may have fired multiple times). The
* event count is cleared after the first call so future events in the
* epoll buffer will fail to read from the timer. */
- if (errno == EAGAIN) {
+ if(errno == EAGAIN) {
fprintf(MSG_OUT, "EAGAIN on tfd %d\n", g->tfd);
return;
}
}
- if(err != sizeof(uint64_t)){
+ if(err != sizeof(uint64_t)) {
fprintf(stderr, "read(tfd) == %ld", err);
perror("read(tfd)");
}
@@ -268,10 +270,10 @@ static void setsock(SockInfo *f, curl_socket_t s, CURL
*e, int act,
GlobalInfo *g)
{
struct epoll_event ev;
- int kind =
- (act & CURL_POLL_IN ? EPOLLIN : 0) | (act & CURL_POLL_OUT ? EPOLLOUT :
0);
+ int kind = (act & CURL_POLL_IN ? EPOLLIN : 0) |
+ (act & CURL_POLL_OUT ? EPOLLOUT : 0);
- if(f->sockfd){
+ if(f->sockfd) {
epoll_ctl(g->epfd, EPOLL_CTL_DEL, f->sockfd, NULL);
}
@@ -398,7 +400,8 @@ static void fifo_cb(GlobalInfo* g, int revents)
s[n]='\0';
if(n && s[0]) {
new_conn(s, g); /* if we read a URL, go get it! */
- } else
+ }
+ else
break;
} while(rv != EOF);
}
@@ -451,8 +454,9 @@ static void clean_fifo(GlobalInfo *g)
int g_should_exit_ = 0;
-void SignalHandler(int signo) {
- if (signo == SIGINT) {
+void SignalHandler(int signo)
+{
+ if(signo == SIGINT) {
g_should_exit_ = 1;
}
}
@@ -505,28 +509,31 @@ int main(int argc _Unused, char **argv _Unused)
fprintf(MSG_OUT, "Entering wait loop\n");
fflush(MSG_OUT);
- while (!g_should_exit_) {
+ while(!g_should_exit_) {
/* TODO(josh): use epoll_pwait to avoid a race on the signal. Mask the
* signal before the while loop, and then re-enable the signal during
* epoll wait. Mask at the end of the loop. */
err = epoll_wait(g.epfd, events, sizeof(events)/sizeof(struct epoll_event),
10000);
- if (err == -1) {
- if (errno == EINTR) {
+ if(err == -1) {
+ if(errno == EINTR) {
fprintf(MSG_OUT, "note: wait interrupted\n");
continue;
- } else {
+ }
+ else {
perror("epoll_wait");
exit(1);
}
}
- for (idx = 0; idx < err; ++idx) {
- if (events[idx].data.fd == g.fifofd) {
+ for(idx = 0; idx < err; ++idx) {
+ if(events[idx].data.fd == g.fifofd) {
fifo_cb(&g, events[idx].events);
- } else if (events[idx].data.fd == g.tfd) {
+ }
+ else if(events[idx].data.fd == g.tfd) {
timer_cb(&g, events[idx].events);
- } else {
+ }
+ else {
event_cb(&g, events[idx].data.fd, events[idx].events);
}
}
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 60/153: ssl: set engine implicitly when a PKCS#11 URI is provided, (continued)
- [GNUnet-SVN] [gnurl] 60/153: ssl: set engine implicitly when a PKCS#11 URI is provided, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 74/153: lib1502: fix memory leak in torture test, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 75/153: travis: execute "set -eo pipefail" for coverage build, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 73/153: docs: mention NULL is fine input to several functions, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 66/153: telnet: Remove unused macros TELOPTS and TELCMDS, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 69/153: asyn-thread: Remove unused macro, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 70/153: test1540: Remove unused macro TEST_HANG_TIMEOUT, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 64/153: configure: fix for -lpthread detection with OpenSSL and pkg-config, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 65/153: openssl: fix debug messages, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 36/153: conn_free: updated comment to clarify, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 41/153: examples/ephiperfifo: checksrc compliance,
gnunet <=
- [GNUnet-SVN] [gnurl] 62/153: windows: follow up to the buffer-tuning 1ba1dba7, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 59/153: CMake: Respect BUILD_SHARED_LIBS, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 33/153: mime: check Curl_rand_hex's return code, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 54/153: lib/Makefile: only do symbol hiding if told to, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 38/153: tests/http_pipe.py: Use /usr/bin/env to find python, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 57/153: cmake: link curl to the OpenSSL targets instead of lib absolute paths, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 48/153: mailmap: Daniel Jelinski, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 42/153: travis: run a 'make checksrc' too, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 46/153: curl: use Content-Disposition before the "URL end" for -OJ, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 29/153: docs/CURLOPT_WRITEFUNCTION: size is always 1, gnunet, 2018/09/11