Date: Sat, 25 Aug 2007 13:55:36 GMT From: Matus Harvan <mharvan@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 125664 for review Message-ID: <200708251355.l7PDta8u061374@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=125664 Change 125664 by mharvan@mharvan_bike-planet on 2007/08/25 13:55:31 UDP plugin: plugin_send() cleanup Affected files ... .. //depot/projects/soc2007/mharvan-mtund/mtund.src/plugin_udp.c#14 edit Differences ... ==== //depot/projects/soc2007/mharvan-mtund/mtund.src/plugin_udp.c#14 (text+ko) ==== @@ -303,32 +303,22 @@ struct plugin_udp_data *datapl = (struct plugin_udp_data*) pl->data; int nwrite = 0; struct conn *conn = &(datapl->conns[clid]); - *consumed = 0; if (server) { nwrite = sendto(datapl->fd, data, len, 0, (struct sockaddr*)&conn->addr, conn->addrlen); - if (nwrite == len) { - *consumed = nwrite; - return (SEND_PKT_SENT); - } else { - warn("plugin_send: send returned %d", nwrite); - return (SEND_ERROR); - } } else { /* client */ - if (datapl->state != PLUGIN_STATE_CONNECTED) { - debug("not connected yet, discarding data\n"); - return (SEND_ERROR); - } nwrite = send(datapl->fd, data, len, 0); - if (nwrite == len) { - *consumed = nwrite; - return (SEND_PKT_SENT); - } else { - warn("plugin_send: send returned %d", nwrite); - return (SEND_ERROR); - } + } + + if (nwrite == len) { + *consumed = nwrite; + return (SEND_PKT_SENT); + } else { + *consumed = 0; + warn("plugin_send: send returned %d", nwrite); + return (SEND_ERROR); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708251355.l7PDta8u061374>