/* Create and send a dynamic Web Page. This page contains the list of running tasks and the number of page hits.  */
void DynWebPage(int conn)
/* Create and send a dynamic Web Page. This page contains the list of running tasks and the number of page hits.  */
void DynWebPage(int conn)
{
  portCHAR pagehits[10];
  memset(PAGE_BODY, 0,512);
  nPageHits++;
  sprintf( pagehits, "%d", (int)nPageHits );
  strcat(PAGE_BODY, pagehits);
  strcat((char *) PAGE_BODY, "<pre><br>Name          State  Priority  Stack   Num" );
  strcat((char *) PAGE_BODY, "<br>---------------------------------------------<br>");
  osThreadList((unsigned char *)(PAGE_BODY + strlen(PAGE_BODY)));
  strcat((char *) PAGE_BODY, "<br><br>---------------------------------------------"); 
  strcat((char *) PAGE_BODY, "<br>B : Blocked, R : Ready, D : Deleted, S : Suspended<br>");
  write(conn, PAGE_START, strlen((char*)PAGE_START));
  write(conn, PAGE_BODY, strlen(PAGE_BODY));
}