remove obsolete timer

This commit is contained in:
Stefan Lankes 2011-09-06 07:11:23 -07:00
parent c6339bfd2d
commit 3fad9accbd

View file

@ -24,7 +24,7 @@
* This file is part of the lwIP TCP/IP stack.
*
*/
#include <metalsvm/stddef.h>
#include <metalsvm/stdlib.h>
#if defined(CONFIG_LWIP)
@ -40,8 +40,7 @@
* a circular buffer until the first byte is non-zero, then it is to consume
* another command/data pair.
* If the command is "send", the server is to send "data length" bytes from a circular
* buffer with the first byte being zero, until "some time" (6 seconds in the
* current netio126.zip download) has passed and then send one final buffer with
* buffer with the first byte being zero, until "some time" and then send one final buffer with
* the first byte being non-zero. Then it is to consume another command/data pair.
*/
@ -156,7 +155,9 @@ netio_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
len = tcp_sndbuf(pcb);
len = LWIP_MIN(len, ns->data_len - ns->cntr);
len = LWIP_MIN(len, NETIO_BUF_SIZE - ns->buf_pos);
//kprintf("data length: %d, len: %d\n", ns->data_len, len);
ns->buf_ptr[0] = 0;
do {
err = tcp_write(pcb, ns->buf_ptr + ns->buf_pos, len, TCP_WRITE_FLAG_COPY);
if (err == ERR_MEM) {
@ -216,7 +217,6 @@ netio_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
} else if (ns->state == NETIO_STATE_SEND_DATA
|| ns->state == NETIO_STATE_SEND_DATA_LAST) {
/* I don't think this should happen... */
kputs("I don't think this should happen...\n");
} else {
/* done / quit */
netio_close(ns, pcb);
@ -256,12 +256,8 @@ netio_sent(void *arg, struct tcp_pcb *pcb, u16_t len)
ns->cntr = 0;
/* check if timer expired */
if (get_clock_tick() - ns->time_stamp > 600) {
ns->buf_ptr[0] = 1;
ns->state = NETIO_STATE_SEND_DATA_LAST;
} else {
ns->buf_ptr[0] = 0;
}
ns->buf_ptr[0] = 1;
ns->state = NETIO_STATE_SEND_DATA_LAST;
}
if(ns->state == NETIO_STATE_SEND_DATA_LAST || ns->state == NETIO_STATE_SEND_DATA){
@ -291,6 +287,7 @@ netio_sent(void *arg, struct tcp_pcb *pcb, u16_t len)
ns->state = NETIO_STATE_WAIT_FOR_CMD;
ns->cntr = 0;
/* TODO LWIP_DEBUGF( print out some throughput calculation results... ); */
//kprintf("consumed ticks: %d", get_clock_tick() - ns->time_stamp);
}
return ERR_OK;
@ -345,7 +342,6 @@ netio_accept(void *arg, struct tcp_pcb *pcb, err_t err)
#endif
memset(ns->buf_ptr, 0x00, NETIO_BUF_SIZE);
//ns->buf_ptr[0] = 0;
tcp_arg(pcb, ns);
tcp_sent(pcb, netio_sent);