I don't understand github.com/espruino/Espruino/blob/master/libs/network/socketserver.c#L660
I just looked at this again, and it's correct.
The else refers to the if (options). What it's saying is (in a roundabout way) is 'if we're an HTTP connection, send a header, else send nothing'.
else
if (options)
If sendData is not undefined then we know the header has already been sent, and that if statement has no else on it.
sendData
if
For some reason the indentation there is confusing. I'll add some comments.
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I just looked at this again, and it's correct.
The
else
refers to theif (options)
. What it's saying is (in a roundabout way) is 'if we're an HTTP connection, send a header, else send nothing'.If
sendData
is not undefined then we know the header has already been sent, and thatif
statement has noelse
on it.For some reason the indentation there is confusing. I'll add some comments.