X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fmeta.c;h=9c38fefb19e380d7c0a9bece05eb193ce6668699;hp=91ebf01dfeadeaa6cd1b711f45f41e24c0f36190;hb=a227843b739d279b63adcf3736ebb03d856080c4;hpb=c23fcf555ee4b69f03b76a0ffb731c3a475a77e7 diff --git a/src/meta.c b/src/meta.c index 91ebf01d..9c38fefb 100644 --- a/src/meta.c +++ b/src/meta.c @@ -13,11 +13,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id$ + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "system.h" @@ -34,13 +32,10 @@ #include "utils.h" #include "xalloc.h" -bool send_meta(connection_t *c, const char *buffer, int length) -{ +bool send_meta(connection_t *c, const char *buffer, int length) { int outlen; int result; - cp(); - if(!c) { logger(LOG_ERR, _("send_meta() called with NULL pointer!")); abort(); @@ -84,8 +79,7 @@ bool send_meta(connection_t *c, const char *buffer, int length) return true; } -bool flush_meta(connection_t *c) -{ +bool flush_meta(connection_t *c) { int result; ifdebug(META) logger(LOG_DEBUG, _("Flushing %d bytes to %s (%s)"), @@ -121,13 +115,10 @@ bool flush_meta(connection_t *c) return true; } -void broadcast_meta(connection_t *from, const char *buffer, int length) -{ +void broadcast_meta(connection_t *from, const char *buffer, int length) { avl_node_t *node; connection_t *c; - cp(); - for(node = connection_tree->head; node; node = node->next) { c = node->data; @@ -136,15 +127,12 @@ void broadcast_meta(connection_t *from, const char *buffer, int length) } } -bool receive_meta(connection_t *c) -{ +bool receive_meta(connection_t *c) { int oldlen, i, result; int lenin, lenout, reqlen; bool decrypted = false; char inbuf[MAXBUFSIZE]; - cp(); - /* Strategy: - Read as much as possible from the TCP socket in one go. - Decrypt it.