summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--corking.c8
-rw-r--r--corking.h6
2 files changed, 8 insertions, 6 deletions
diff --git a/corking.c b/corking.c
index a6e0f84..ce10324 100644
--- a/corking.c
+++ b/corking.c
@@ -49,17 +49,17 @@ void set_tcp_uncork(int fd)
panic("Cannot uncork TCP socket!\n");
}
-void set_sock_cork(int fd, int udp)
+void set_sock_cork(int fd, bool is_udp)
{
- if (!!udp)
+ if (is_udp)
set_udp_cork(fd);
else
set_tcp_cork(fd);
}
-void set_sock_uncork(int fd, int udp)
+void set_sock_uncork(int fd, bool is_udp)
{
- if (!!udp)
+ if (is_udp)
set_udp_uncork(fd);
else
set_tcp_uncork(fd);
diff --git a/corking.h b/corking.h
index b240595..fb4483c 100644
--- a/corking.h
+++ b/corking.h
@@ -1,11 +1,13 @@
#ifndef CORKING_H
#define CORKING_H
+#include <stdbool.h>
+
extern void set_tcp_cork(int fd);
extern void set_tcp_uncork(int fd);
extern void set_udp_cork(int fd);
extern void set_udp_uncork(int fd);
-extern void set_sock_cork(int fd, int udp);
-extern void set_sock_uncork(int fd, int udp);
+extern void set_sock_cork(int fd, bool is_udp);
+extern void set_sock_uncork(int fd, bool is_udp);
#endif /* CORKING_H */