Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of webserverBlinky by
Diff: main.cpp
- Revision:
- 30:273431bccb02
- Parent:
- 29:30de79d658f6
- Child:
- 31:e000c1b9c565
diff -r 30de79d658f6 -r 273431bccb02 main.cpp
--- a/main.cpp Wed Jan 04 23:52:46 2017 +0000
+++ b/main.cpp Thu Jan 05 02:00:04 2017 +0000
@@ -538,13 +538,13 @@
// Ok, we are done with figuring out the flags. Now we start preparing to respond
- //flagbitstcp[1] = TCP_FLAG_ACK; // if we hare here we have to ack
int temp = ack;
- ack = seq + incomingLen; // acknowledge the number of bytes they sent
- ppp.seq = temp; // adopt their idea of our sequence
+ ack = seq + incomingLen; // acknowledge the number of bytes they sent by adding it to seq
+ ppp.seq = temp; // adopt their calculation of our sequence number
seq = ppp.seq;
// let's check incoming text for an HTTP home page GET request
if ( strncmp(dataStart, "GET / HTTP/1.1", 14) == 0) {
+ flagbitstcp[1] = TCP_FLAG_FIN; // close connection after delivering page
dataLen = 15*32; // this block has to hold the web page below, but keep it under 1k
memset(dataStart,'x', dataLen ); // initialize the block
int n=0; // number of bytes we have printed so far
