ipkn / crow

Crow is very fast and easy to use C++ micro web framework (inspired by Python Flask)
BSD 3-Clause "New" or "Revised" License
7.46k stars 889 forks source link

Fall-through or break in websocket.h:394 #355

Open giveitatry168 opened 4 years ago

giveitatry168 commented 4 years ago

In websocket.h, should line 394 a fall-through or a break?

382 switch(opcode()) 383 { 384 case 0: // Continuation 385 { 386 message += fragment; 387 if (is_FIN()) 388 { 389 if (messagehandler) 390 messagehandler(this, message_, isbinary); 391 message_.clear(); 392 } 393 } 394 break; <<<< fall through or break? 395 case 1: // Text 396 { 397 isbinary = false; 398 message += fragment; 399 if (is_FIN()) 400 { 401 if (messagehandler) 402 messagehandler(this, message_, isbinary); 403 message_.clear(); 404 } 405 } 406 break;

The-EDev commented 3 years ago

I believe fallthrough was introduced in C++ 17, this library from what I found uses C++ 11 or 14 if available, so I'm guessing it should be break;.