This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LWIP + HTTPD + MSS fragmentation

Hi.  I'm currently porting some code from Stellaris to Tiva which uses LWIP and HTTPD, but I seem to be getting packet fragmentation (On both platforms) and I was hoping someone would be able to give me some pointers.

I request a '.cgi' file from the micro, which replies with an SSI with tags.  It works except that the reply (which is only 460bytes) get split into three blocks.

If I decrease the size of TCP_MSS in lwipopts.h then I can make it fragment into more blocks, but no matter how big I make TCP_MSS it always sends three chunks.
After some playing about I did notice that in httpd.c, tcp_write was occasionally returning with ERR_MEM, but I cant seem to find any memory settings in lwipopts.h that stop this.
These are my main lwipopts.  They are a bit all over the place because I have been playing with them, but if anyone has some pointers, that would be super!

#define MEM_ALIGNMENT                   4      
#define MEM_SIZE                        (8 * 1024)

#define MEMP_NUM_PBUF                     16
#define MEMP_NUM_RAW_PCB                16
#define MEMP_NUM_TCP_PCB                  8 
#define MEMP_NUM_TCP_PCB_LISTEN           8  
#define MEMP_NUM_TCP_SEG                  32
#define MEMP_NUM_REASSDATA                19  
#define MEMP_NUM_SYS_TIMEOUT            10
#define MEMP_NUM_NETCONN                10
#define PBUF_POOL_SIZE                   10       

#define TCP_MSS                         512
#define TCP_WND                         (2 * TCP_MSS) 
#define TCP_QUEUE_OOSEQ                 1
#define TCP_CALCULATE_EFF_SEND_MSS      0
#define TCP_SND_BUF                     (2 * TCP_MSS)      
 
#define TCP_MSL                         5000ul
#define TCP_SND_QUEUELEN                24