lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] netconn/socket: converting len argument to size_t


From: Jakob Stoklund Olesen
Subject: Re: [lwip-devel] netconn/socket: converting len argument to size_t
Date: Fri, 13 Feb 2009 09:27:16 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

address@hidden wrote:
> I'd like to change the various length/size parameters of the socket API
> from 'int' to 'size_t', mainly to be conformant to the standard (see
> opengroup.org), but also for portability (size of the types should
> always be the same).
> 
> For that, the length parameters of the netconn API would have to be
> changed, too. In my opinion, using size_t is a cleaner solution than
> int, regarding portability. This would also solve the problems we had in
> patch #6699...

You have my vote.

One of my first mistakes in working with lwIP was calling tcp_write()
with a size_t length. This meant that objects over 64K would get
silently truncated. I would have preferred ERR_MEM.

I would suggest also updating these raw API functions:

tcp_recved
tcp_write

Updating the following is not necessary (yet) and would slightly break
user code:

tcp_sent / tcp_pcb.sent
lwip_tcp_event prototype

They can wait until the window scaling patch goes in.

Regards,
/stoklund




reply via email to

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