[En-Nut-Discussion] [PATCH] Minor fixes: httpserv and TCP debugging

Marti Raudsepp marti at voicecom.ee
Fri Apr 20 10:36:54 CEST 2007


Hello,

I have been testing Nut/OS 4.3.2 beta on an AT91SAM7X evaluation board 
and I am incredibly pleased with it, thanks for a great embedded OS!

I had some problems with the latest change to the at91_emac.c driver, 
and it works after rolling back. We will be investigating this further.

Here are two fixes to some minor problems that I've hit. Copy-pasting 
these patches probably won't work due to wrapping, so I've attached a 
patch file as well.

First, all HTTP threads in the httpd demo appear to start with the name 
"httpd0", instead of being enumerated from 1 to 4. Evidently, this is 
because the character string points to the ROM and is not placed on the 
stack.

--- a/app/httpd/httpserv.c      Wed Apr 18 11:34:31 2007 +0300
+++ b/app/httpd/httpserv.c      Fri Apr 20 11:17:40 2007 +0300
@@ -771,7 +771,7 @@ int main(void)
      for (i = 1; i <= 4; i++) {
-        char *thname = "httpd0";
+        char thname[] = "httpd0";

          thname[5] = '0' + i;


Another is that the 'ds' argument to NutDumpTcpHeader() takes a 
character string, but the argument is defined as u_char*, making GCC 
(version 4.1.1) complain about signedness, given that string literals 
are of signed characters.


--- a/include/net/netdebug.h    Wed Apr 18 11:34:31 2007 +0300
+++ b/include/net/netdebug.h    Fri Apr 20 11:17:40 2007 +0300
@@ -76,7 +76,7 @@ extern void NutTraceTcp(FILE *stream, u_
  extern void NutTraceTcp(FILE *stream, u_char flags);
  extern void NutTracePPP(FILE *stream, u_char flags);

-extern void NutDumpTcpHeader(FILE *stream, u_char *ds, TCPSOCKET *sock, 
NETBUF *nb);
+extern void NutDumpTcpHeader(FILE *stream, char *ds, TCPSOCKET *sock, 
NETBUF *nb);
  extern void NutDumpSockState(FILE *stream, u_char state, char *lead, 
char *trail);
  extern void NutDumpSocketList(FILE *stream);

--- a/net/netdebug.c    Wed Apr 18 11:34:31 2007 +0300
+++ b/net/netdebug.c    Fri Apr 20 11:17:40 2007 +0300
@@ -84,7 +84,7 @@ FILE *__tcp_trs;                /*!< \br
  FILE *__tcp_trs;                /*!< \brief TCP trace output stream. */
  u_char __tcp_trf;               /*!< \brief TCP trace flags. */

-void NutDumpTcpHeader(FILE * stream, u_char * ds, TCPSOCKET * sock, 
NETBUF * nb)
+void NutDumpTcpHeader(FILE * stream, char * ds, TCPSOCKET * sock, 
NETBUF * nb)
  {
      static prog_char fmt[] = "%s%p[%u]-SEQ(%lx)";
      TCPHDR *th = (TCPHDR *) nb->nb_tp.vp;


Regards,
Marti Raudsepp
Voicecom OÜ

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: httpserv-tcpdebug-fixes.patch
Url: http://lists.egnite.de/pipermail/en-nut-discussion/attachments/20070420/45a0d7a3/attachment.ksh 



More information about the En-Nut-Discussion mailing list