Known bugs

From uIP

Jump to: navigation, search

This page is supposed to contain a list of bugs, workarounds, and bugfixes for uIP.

Uip 1.0 Webserver example stats page order not correct

  • Description

Webserver example stats page (uip version 1.0) show received, send, droped but the data behind the texts are droped,received,send

  • Severity

Minor

  • Consequences

None, but i got a bit confused

  • Workaround

You could change the html page, or you could change the stats structure

  • Fix

I may have found a bug in uip_send. If the len argument is zero, then the function does nothing, but I would argue that it needs to do something, ie set uip_slen to 0. Otherwise, if there is a stale value in uip_slen from a previous function call or from another connection, then this may send data from the last connection to the current connection. I noticed this when I started to see my TELNET data contaminating my HTTP stream. mark at lakata.org

 // patched code (end of uip.c)
 void
 uip_send(const void *data, int len)
 {
   uip_slen = len; // moved this line from inside the if bracket
   if(len > 0) {
     if(data != uip_sappdata) {
       memcpy(uip_sappdata, (data), uip_slen);
     }
   }
 }


Uip 1.0 Webserver example compilation problem in AVR32:


ok boys so i have been trying to get this compiled. unfortunately my httdp-fsdata.c file is giving me grief. on line 585 it has this value "NULL". and compiler is saying 'NULL' undeclared here(not in function). I am pulling my hair and cant get this to go :(

anyone fixed this?


psock的疏漏!

    用过psock模块的都知道PSOCK_SEND()的功能是向指定的socket输出指定的字节数据,然而,代码中的疏漏使得它无法实现发送大于uip_mss()个字节数.这是因为:

PT_WAIT_UNTIL(&s->psockpt, data_acked(s) & send_data(s));语句第一次执行时,通过send_data(s)把第一个数据包发送到网络.而第二次执行以发送后续数据时,如果uip_acked()成立,那么data_acked(s)也成立,接着继续执行send_data(s)发送后续数据,此时send_data(s)也成立,所以PT_WAIT_UNTIL()的等待条件成立,此时执行外围的while(s->sendlen > 0){}循环将再次执行PT_WAIT_UNTIL().由于PT_WAIT_UNTIL()会再次调用data_acked(s) 和 send_data(s),这时导致了问题.因为uip_acked()标志还是返回ture值,也就是说条件(data_acked(s) & send_data(s))总是成立,PT_WAIT_UNTIL()宏也就没有机会执行return语句,直到把要发送的数据折腾完!所以,后续的数据并没有发送出去,虽然调用了send_data(s),它只是完成数据到缓冲区的拷贝而已.大家知道,uip的数据要发送到网络,必须要从UIP_APPCALL()返回之后才行!

  以上的疏漏导致的结果是:用PSOCK_SEND()发送10000字节的数据,只能发送出去最前面的uip_mss()个,而后续的字节并不会发送出去!
   该错误同样影响到PSOCK_SEND_STR()和PSOCK_GENERATOR_SEND()!


  解决的办法是在data_acked(s)函数的if(s->state == STATE_DATA_SENT && uip_acked()){}代码块内清除uip_flags变量的UIP_ACKDATA位, 修改后如下: 

if(s->state == STATE_DATA_SENT && uip_acked()){

      uip_flags &= ~UIP_ACKDATA;
      ......
  }


  好了,我已经把该错误登记到uip官方网站,希望新版uip会把该错误妥善改正,谢谢uip作者!
  2009.9.12 xuyao (大家可以加入QQ交流:26750452)