I am using the "standalone" program and lwip in "RAW" mode. I have a problem when two connections connect requesting a file at the same-ish time. The file is 16MByte so I am using the sent_callback() function to send the file in blocks when there is some space in tcp_sndbuf(). If one connection has downloaded say 1/2 the file and another connection requests the same file. The system gets it's knickers in a twist and you have to request the file from one connection several times to get it to download properly.
I have included the sent_callback() function below in case I am doing something silly