On 11/29/2011 07:42 PM, Dennis Wehrle wrote:
Hi
until here everything is OK, except that the
send-function should return the
number of bytes which are sent, but the value is always too large for three.
so it returns less than what we wrote? You can set a delay timer to not things
as fast as possible and probably get IPA packets into different IP packets.
(thunderbird will wrap this, you can try to apply it by hand)
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 2621290..24e85e3 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -512,6 +512,9 @@ static int __handle_ts1_write(struct osmo_fd *bfd, struct
e1inp_line *line)
DEBUGP(DLMI, "TX %u: %s\n", ts_nr, osmo_hexdump(msg->l2h,
msgb_l2len(msg)));
ret = send(bfd->fd, msg->data, msg->len, 0);
+ if (ret != msg->len)
+ LOGP(DLINP, LOGL_ERROR, "Failed to write: %d/%d errno: %d\n",
+ ret, msgb_l2len(msg), errno);
msgb_free(msg);
/* set tx delay timer for next event */
@@ -558,7 +561,7 @@ struct e1inp_driver ipaccess_driver = {
.want_write = ts_want_write,
.line_update = ipaccess_line_update,
.close = ipaccess_close,
- .default_delay = 0,
+ .default_delay = 50000,
};
/* callback of the OML listening filedescriptor */
ATM i don't know whats happen on the
send-function. Or maybe lcr is the
problem, but i don't know either.
Maybe someone can give me an advice where the tcp packets are build up.
TCP packets are built in the kernel. with nagle the kernel waits a bit to fill
the frame[1].
[1]
http://lxr.linux.no/linux+v3.1.4/net/ipv4/tcp.c#L914