From patchwork Fri Jul 17 07:10:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jonathan mzengeza X-Patchwork-Id: 5111 Return-Path: Received: from mail-bw0-f217.google.com (mail-bw0-f217.google.com [209.85.218.217]) by open-mesh.net (Postfix) with ESMTP id 58851154173 for ; Fri, 17 Jul 2009 07:35:02 +0000 (UTC) Received: by bwz17 with SMTP id 17so520571bwz.45 for ; Fri, 17 Jul 2009 00:10:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=9VmkT3gO8cMa5VkgLYrYVO3s9VIrA1rx9Gv0NJVNsaQ=; b=llkk9AZyRQcIQBXwlNDH/H43LJu46g/GxTf3BY0w0YT1Ol/NN6oYHS+RBpBUaYkWN9 l9Lyn7Rnx+1CWkDwQ6QIAQ6mf6BAmQDu7Sjed7j0XzEiUIsk35fx+1Hc4bOKQhFfYJgG 1mI+xafivyVXcrtedP1HGkxXRFUflFqvOZsJ8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=SE1ndoQfglMYevr/keEWxYUL5FXWvOQd+rFleiaxI6XhrkY3If9t7Kt7sc8sWwN24q +jpToB19g+6gK2xxoQfm23AC/8PhjC4TPruqEreOercuxoC1pj/xdu8UlFrdr982jegw JpfJ9Y10m30UeKKurdqieS2ecxhEuOIahKoLQ= MIME-Version: 1.0 Received: by 10.239.179.198 with SMTP id e6mr56778hbg.98.1247814656015; Fri, 17 Jul 2009 00:10:56 -0700 (PDT) In-Reply-To: <200907161900.54293.lindner_marek@yahoo.de> References: <1739bfe0907150649l61d6b0dga6825e84dc45832d@mail.gmail.com> <200907160936.25169.sven.eckelmann@gmx.de> <9B01495A-3D13-463A-B4FC-3C5E129D32EF@7degrees.co.za> <200907161900.54293.lindner_marek@yahoo.de> Date: Fri, 17 Jul 2009 09:10:55 +0200 Message-ID: <1739bfe0907170010n67ae2bd8m9bf9813d09687951@mail.gmail.com> From: jonathan mzengeza To: The list for a Better Approach To Mobile Ad-hoc Networking Subject: Re: [B.A.T.M.A.N.] [vis] fixed partial json output X-BeenThere: b.a.t.m.a.n@lists.open-mesh.net X-Mailman-Version: 2.1.11 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2009 07:35:02 -0000 I looked at the site and it talked about something I had already tried which works well. Here is another patch hope its better. Signed-off-by: Jonathan Mzengeza Index: vis.c =================================================================== --- vis.c (revision 1343) +++ vis.c (working copy) @@ -566,6 +566,7 @@ buffer_t *last_send = NULL; size_t ret; char* send_buffer = NULL; + char tmp[4096]; while ( !is_aborted() ) { @@ -600,6 +601,17 @@ } + shutdown(thread_data->socket, SHUT_WR); + + for(;;) { + ret=read(thread_data->socket, tmp, sizeof(tmp)); + if(ret < 0) { + break; + } + if(!ret) { + break; + } + } if ( debug_level > 0 ) debug_output( "TCP client has left: %s \n", thread_data->ip );