public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven.eckelmann@gmx.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.] [vis] fixed partial json output
Date: Wed, 15 Jul 2009 20:50:15 +0200	[thread overview]
Message-ID: <200907152050.18936.sven.eckelmann@gmx.de> (raw)
In-Reply-To: <1739bfe0907150726l70ee35b1wa92f4fb1aabfdd61@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1085 bytes --]

> Thanks, is this better?
There are different things I don't understand complete. How does the receive 
buffer affect the output buffer in this case?
Isn't it possible to disable non-blocking sockets in vis.c:635-638 and change 
the read to following for json: Try to recv data until the read fails or an 
empty line (please check HTTP rfc before implementing) appears. If the read 
fails -> discard everything. If the empty line appeared then send the data.
You should create an extra function to read (and discard) the header stuff.

My personal opinion about the errno and delay stuff is... I don't like it. It 
seems to be somewhat correct to ask again on EAGAIN corresponding to the man 
page, but we could do it in a cleaner way if possible.

Maybe someone sees a problem in my proposal. The only thing I see is that the 
read should appear before locking the current buffer or a "bad person" (me) 
could delay the new buffers for all others by connecting and then wait for a 
long time. I see the same problem in your current implementation.

Regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

  reply	other threads:[~2009-07-15 18:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-15 13:49 [B.A.T.M.A.N.] [vis] fixed partial json output jonathan mzengeza
2009-07-15 13:56 ` Sven Eckelmann
2009-07-15 14:26   ` jonathan mzengeza
2009-07-15 18:50     ` Sven Eckelmann [this message]
2009-07-16  5:49       ` Antoine van Gelder
2009-07-16  7:36         ` Sven Eckelmann
2009-07-16  7:45           ` Antoine van Gelder
2009-07-16 11:00             ` Marek Lindner
2009-07-17  7:10               ` jonathan mzengeza
2009-07-17 18:53                 ` Marek Lindner

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=200907152050.18936.sven.eckelmann@gmx.de \
    --to=sven.eckelmann@gmx.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