lpcware

LWIP Server Side Include causes ACK problem

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by peterrq on Thu Oct 16 06:22:21 MST 2014
I am having problems with LWIP Server Side Includes. Some includes work whilst others don't.
A failure results in the PC re-sending the GET command.
The target then continues to retransmit its data.
There appears to be a mismatch in sequence numbers.
For example: Wireshark shows that the target's next sequence number is expected to be 337 but the target next sends 338.


FAILS:  sprintf(pcInsert, "<ptp></ptp>");
OK: sprintf(pcInsert, "<ptp>a</ptp>");
FAILS:  sprintf(pcInsert, "<ptp>ab</ptp>");
FAILS:  sprintf(pcInsert, "<ptp>abc</ptp>");
FAILS:  sprintf(pcInsert, "<ptp>abcd</ptp>");
OK:  sprintf(pcInsert, "<ptp>abcde</ptp>");

But the word alignment pattern does not always hold.... Also the target's output is correct, no funnies in the text.


I am using the keil uVision 'sa_webserver' project supplied with LPCOpen 5/15/2014 (LPCOpen 2_12).
Running on MPC4300 compiled using Keil uVision 5.11.1.0 (Armcc V5.04.0.49)

My server side include processing:

static const char *tags[] = {"mytag"};

http_set_ssi_handler(SSIHandler, tags, 1);

int SSIHandler(int iIndex, char *pcInsert, int iInsertLen)
{
  int len;

   len = api_lru(iIndex, pcInsert, iInsertLen);
   return len;
}

Where I have boiled api_lru() down to the lines above.
I have a much larger api_lwip() function that dumps lwip statistics & this function always seems to work. That despite the fact that LWIP statistic increment & so all modulo(4) outputs sizes are generated.
I have made the SSI TAG SIZE 400 bytes.

Pulling my hair out on this issue.

Outcomes