From 9571dbef0e3cf77f38b1c514009f26fd5c76b1ce Mon Sep 17 00:00:00 2001 From: richardbarry Date: Thu, 18 Feb 2010 13:23:00 +0000 Subject: [PATCH] Tidy up SuperH port a bit ready for release. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@984 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../ethernet/FreeTCPIP/apps/httpd/httpd.c | 9 +++++ Demo/Common/ethernet/FreeTCPIP/psock.c | 2 +- Demo/Common/ethernet/FreeTCPIP/uip.c | 40 +++++++++---------- 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/Demo/Common/ethernet/FreeTCPIP/apps/httpd/httpd.c b/Demo/Common/ethernet/FreeTCPIP/apps/httpd/httpd.c index 93667da82..d40bafe56 100644 --- a/Demo/Common/ethernet/FreeTCPIP/apps/httpd/httpd.c +++ b/Demo/Common/ethernet/FreeTCPIP/apps/httpd/httpd.c @@ -297,6 +297,15 @@ static PT_THREAD( handle_input ( struct httpd_state *s ) ) else { s->inputbuf[PSOCK_DATALEN( &s->sin ) - 1] = 0; + + /* Process any form input being sent to the server. */ + #if UIP_CONF_PROCESS_HTTPD_FORMS == 1 + { + extern void vApplicationProcessFormInput( char *pcInputString ); + vApplicationProcessFormInput( s->inputbuf ); + } + #endif + strncpy( s->filename, &s->inputbuf[0], sizeof(s->filename) ); } diff --git a/Demo/Common/ethernet/FreeTCPIP/psock.c b/Demo/Common/ethernet/FreeTCPIP/psock.c index 655253391..6bd1f6aff 100644 --- a/Demo/Common/ethernet/FreeTCPIP/psock.c +++ b/Demo/Common/ethernet/FreeTCPIP/psock.c @@ -187,7 +187,7 @@ PT_THREAD(psock_send(register struct psock *s, const char *buf, /* Save the length of and a pointer to the data that is to be sent. */ s->sendptr = (unsigned char*)buf; - s->sendlen = len; + s->sendlen = (unsigned short)len; s->state = STATE_NONE; diff --git a/Demo/Common/ethernet/FreeTCPIP/uip.c b/Demo/Common/ethernet/FreeTCPIP/uip.c index 3c6d72c30..c03dde4eb 100644 --- a/Demo/Common/ethernet/FreeTCPIP/uip.c +++ b/Demo/Common/ethernet/FreeTCPIP/uip.c @@ -766,9 +766,9 @@ void uip_process( u8_t flag ) uip_slen = 0; /* Check if the connection is in a state in which we simply wait - for the connection to time out. If so, we increase the - connection's timer and remove the connection if it times - out. */ + for the connection to time out. If so, we increase the + connection's timer and remove the connection if it times + out. */ if( uip_connr->tcpstateflags == UIP_TIME_WAIT || uip_connr->tcpstateflags == UIP_FIN_WAIT_2 ) { ++( uip_connr->timer ); @@ -780,9 +780,9 @@ void uip_process( u8_t flag ) else if( uip_connr->tcpstateflags != UIP_CLOSED ) { /* If the connection has outstanding data, we increase the - connection's timer and see if it has reached the RTO value - in which case we retransmit. */ - if( uip_outstanding(uip_connr) ) + connection's timer and see if it has reached the RTO value + in which case we retransmit. */ + if( uip_outstanding(uip_connr) ) { if( uip_connr->timer-- == 0 ) { @@ -798,9 +798,9 @@ void uip_process( u8_t flag ) uip_connr->tcpstateflags = UIP_CLOSED; /* We call UIP_APPCALL() with uip_flags set to - UIP_TIMEDOUT to inform the application that the - connection has timed out. */ - uip_flags = UIP_TIMEDOUT; + UIP_TIMEDOUT to inform the application that the + connection has timed out. */ + uip_flags = UIP_TIMEDOUT; UIP_APPCALL(); /* We also send a reset packet to the remote host. */ @@ -813,17 +813,17 @@ void uip_process( u8_t flag ) ++( uip_connr->nrtx ); /* Ok, so we need to retransmit. We do this differently - depending on which state we are in. In ESTABLISHED, we - call upon the application so that it may prepare the - data for the retransmit. In SYN_RCVD, we resend the - SYNACK that we sent earlier and in LAST_ACK we have to - retransmit our FINACK. */ - UIP_STAT( ++uip_stat.tcp.rexmit ); + depending on which state we are in. In ESTABLISHED, we + call upon the application so that it may prepare the + data for the retransmit. In SYN_RCVD, we resend the + SYNACK that we sent earlier and in LAST_ACK we have to + retransmit our FINACK. */ + UIP_STAT( ++uip_stat.tcp.rexmit ); switch( uip_connr->tcpstateflags & UIP_TS_MASK ) { case UIP_SYN_RCVD: /* In the SYN_RCVD state, we should retransmit our - SYNACK. */ + SYNACK. */ goto tcp_send_synack; #if UIP_ACTIVE_OPEN @@ -836,9 +836,9 @@ void uip_process( u8_t flag ) case UIP_ESTABLISHED: /* In the ESTABLISHED state, we call upon the application - to do the actual retransmit after which we jump into - the code for sending out the packet (the apprexmit - label). */ + to do the actual retransmit after which we jump into + the code for sending out the packet (the apprexmit + label). */ uip_flags = UIP_REXMIT; UIP_APPCALL(); goto apprexmit; @@ -854,7 +854,7 @@ void uip_process( u8_t flag ) else if( (uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_ESTABLISHED ) { /* If there was no need for a retransmission, we poll the - application for new data. */ + application for new data. */ uip_flags = UIP_POLL; UIP_APPCALL(); goto appsend; -- 2.39.5