From: Marek Lindner <lindner_marek@yahoo.de>
To: The list for a Better Approach To Mobile Ad-hoc Networking
<b.a.t.m.a.n@lists.open-mesh.net>
Subject: Re: [B.A.T.M.A.N.] [PATCH] json output from vis server would fail with incomplete writes
Date: Fri, 3 Jul 2009 07:32:28 +0800 [thread overview]
Message-ID: <200907030732.38935.lindner_marek@yahoo.de> (raw)
In-Reply-To: <1739bfe0907020513m78e06c83s980ce88b5cb5cca5@mail.gmail.com>
Hi,
> We are using B.A.T.M.A.N as a mesh networking software. We ran into a bug
> which occurred with web browser whereby the data written back through the
> socket was not complete thereby causing an error with our program.
>
> The fix works by making sure that all the data that is to be sent in the
> send_buffer is sent. It checks the value of ret until it equals the size of
> the data to be sent.
thanks for your patch. This spot you found really is not that beautiful. ;-)
Looking at your patch I ask myself what will happen if the other end dies in
the process ? You are in a loop that constantly checks if all data has been
transmitted and retries to send without checking for timeout errors or
connection problems. I have the feeling it could lead to an endless loop. I
might be wrong - what do you think ?
Also, I never used fsync on a socket. It is doing the same thing as on a file ?
What about using the SIOCOUTQ ioctl (which is linux specific and not
portable) ?
Regards,
Marek
prev parent reply other threads:[~2009-07-02 23:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-02 12:13 [B.A.T.M.A.N.] [PATCH] json output from vis server would fail with incomplete writes jonathan mzengeza
2009-07-02 23:32 ` Marek Lindner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200907030732.38935.lindner_marek@yahoo.de \
--to=lindner_marek@yahoo.de \
--cc=b.a.t.m.a.n@lists.open-mesh.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox