From f5f8d8ce1dcccbc97b1d2bd5eeebd8e2da6f67ae Mon Sep 17 00:00:00 2001 From: Maxim Anisimov Date: Mon, 15 Oct 2018 07:50:29 +0000 Subject: [PATCH] uboot: rollback change during code clean --- uboot/mips/uboot-5.x.x.x/net/httpd.c | 37 +++++++++++++++++++--------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/uboot/mips/uboot-5.x.x.x/net/httpd.c b/uboot/mips/uboot-5.x.x.x/net/httpd.c index 65d25bdd1..9b94f8bde 100644 --- a/uboot/mips/uboot-5.x.x.x/net/httpd.c +++ b/uboot/mips/uboot-5.x.x.x/net/httpd.c @@ -21,19 +21,34 @@ static int arptimer = 0; void HttpdHandler(void){ int i; - - for(i = 0; i < UIP_CONNS; i++){ - uip_periodic(i); - - if(uip_len > 0){ - uip_arp_out(); - NetSendHttpd(); + struct uip_eth_hdr *eth_hdr = (struct uip_eth_hdr *)uip_buf; + if (uip_len == 0) { + for(i = 0; i < UIP_CONNS; i++){ + uip_periodic(i); + if(uip_len > 0){ + uip_arp_out(); + NetSendHttpd(); + } } - } - if(++arptimer == 20){ - uip_arp_timer(); - arptimer = 0; + if(++arptimer == 20){ + uip_arp_timer(); + arptimer = 0; + } + } else { + if (eth_hdr->type == htons(UIP_ETHTYPE_IP)) { + uip_arp_ipin(); + uip_input(); + if(uip_len > 0){ + uip_arp_out(); + NetSendHttpd(); + } + } else if (eth_hdr->type == htons(UIP_ETHTYPE_ARP)) { + uip_arp_arpin(); + if(uip_len > 0){ + NetSendHttpd(); + } + } } }