lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Extended udp_recv callback


From: address@hidden
Subject: Re: [lwip-devel] Extended udp_recv callback
Date: Tue, 13 Jan 2009 20:13:56 +0100
User-agent: Thunderbird 2.0.0.19 (Macintosh/20081209)

Alain M. wrote:
Jakob Stoklund Olesen escreveu:
I like this. Let me write a patch and get back to you.

I will do something like this:

#if UDP_EXTENDED_CALLBACK
  if (pcb->flags & UDP_FLAGS_EXTENDED_CALLBACK) {
    ((udp_extended_callback_function)pcb->recv)(pcb->recv_arg,
      pcb, p, &(iphdr->src), src, &(iphdr->dest), inp);
  } else
#endif /* UDP_EXTENDED_CALLBACK */
  {
    pcb->recv(pcb->recv_arg, pcb, p, &(iphdr->src), src);
  }

I DON'T LIKE this at all. Why ad a runtime test when a compile time already exists? it will the code only this bit bigger
Maybe to support existing application without changes at the same time as new applications that use _ext? That flag check won't slow you down that much...

Simon




reply via email to

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