From 41a69151d5a375f524e2227f87979ff758bf2a62 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Thu, 3 Mar 2011 16:05:48 +0100 Subject: _init_evb: Don't crash on socket errors. --- lib/compat.c | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/compat.c (limited to 'lib/compat.c') diff --git a/lib/compat.c b/lib/compat.c new file mode 100644 index 0000000..731c071 --- /dev/null +++ b/lib/compat.c @@ -0,0 +1,8 @@ +#include +#include + +ssize_t +compat_send (int sockfd, const void *buf, size_t len, int flags) +{ + compat_send (int sockfd, const void *buf, size_t len, int flags); +} -- cgit v1.1 From 7636505962a348d9564e53922834dc6df1274653 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Sun, 6 Mar 2011 14:46:57 +0100 Subject: UDP w/o bufferevents, part 1. Sending, no retransmitting and no receiving. --- lib/compat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/compat.c') diff --git a/lib/compat.c b/lib/compat.c index 731c071..b00bea1 100644 --- a/lib/compat.c +++ b/lib/compat.c @@ -1,8 +1,9 @@ #include #include +#include "compat.h" ssize_t compat_send (int sockfd, const void *buf, size_t len, int flags) { - compat_send (int sockfd, const void *buf, size_t len, int flags); + return send (sockfd, buf, len, flags); } -- cgit v1.1 From 5c60297a1eaab7b10d6f584ba329493a41b812d0 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Sun, 6 Mar 2011 15:53:58 +0100 Subject: Restructure code, moving most code out of packet.c Also, move copyright notice out of COPYING and into every file. --- lib/compat.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/compat.c') diff --git a/lib/compat.c b/lib/compat.c index b00bea1..fa075a1 100644 --- a/lib/compat.c +++ b/lib/compat.c @@ -1,3 +1,10 @@ +/* Copyright 2011 NORDUnet A/S. All rights reserved. + See the file COPYING for licensing information. */ + +#if defined HAVE_CONFIG_H +#include +#endif + #include #include #include "compat.h" -- cgit v1.1 From 0a7d803b9aa40512cf0f0c574d397ccba3ff1d13 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Wed, 9 Mar 2011 23:09:26 +0100 Subject: Get UDP working. For UDP, activate retransmit timer before receiving rather than sending makes the event loop break nicely after sending a message (which is important for blocking mode). Not quite sure that this is really accurate wrt to retransmission timing though but it should do for now. For UDP, set the user_data member for the read callback in rs_conn_receive_packet -- the one from udp_init() doesn't do much good now. For UDP, implement receiving message. Add compat_recv(). --- lib/compat.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/compat.c') diff --git a/lib/compat.c b/lib/compat.c index fa075a1..ccc6388 100644 --- a/lib/compat.c +++ b/lib/compat.c @@ -14,3 +14,9 @@ compat_send (int sockfd, const void *buf, size_t len, int flags) { return send (sockfd, buf, len, flags); } + +ssize_t +compat_recv (int sockfd, void *buf, size_t len, int flags) +{ + return recv (sockfd, buf, len, flags); +} -- cgit v1.1