so I am all finished with pset6; however, I am having a hard time understanding what is going on here:
while (true)
{
reset();
if (connected())
{
// ..... bunch of other code that doesn't seem like it would be skipped
// ..... should the continue statement actually have reset the loop.
if (dprintf(cfd, "HTTP/1.1 200 OK\r\n") < 0)
{
continue;
}
if (dprintf(cfd, "Connection: close\r\n") < 0)
{
continue;
}
// ..... more dprintf calls continue. seemingly consecutive...
}
}
The above seems to execute one if
statement and then 'continue' on to the next if
statement without resetting the loop.
I'm confused because I thought continue statements behaved like this:
Could someone please help clarify:
- Don't continue statements move on to the next iteration in the containing loop?
- If 1) is true, why does it appear as though it is not the case in this situation?