lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] protect from overflow of received data


From: Simon Goldschmidt
Subject: Re: [lwip-users] protect from overflow of received data
Date: Thu, 15 Jul 2010 12:51:24 +0200

Kieran Mansley wrote:
> If you don't want any more data from TCP, just don't receive it in your
> application.

Still, during this phase, you do receive data until the window is full. This 
data either has to be processed (and then free the pbuf but not call tcp_recved 
until you want to receive more data) or buffered (don't free the pbuf, don't 
call tcp_recved, do both later).

> The TCP window on the receiver will fill and the sender
> will have to stop.  The problem with the raw API is that it is callback
> based, and there's no way to say "don't call my callback" other than
> setting the callback to NULL which will I think drop the data.  I can
> see why being able to say "don't call my receive callback for now" would
> be useful, so perhaps we should add a task to add this to the raw API.

Hmm, that would move the code I described above from the application code into 
the stack. Especially for low memory targets, I don't know if it is clear to 
application developers then that a window full of RX pbufs is buffered until 
they say "call my receive callback again"...

Whereas if you write the buffering code on your own, it's clear enough for sure.

Simon
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



reply via email to

[Prev in Thread] Current Thread [Next in Thread]