fork download
  1. for(int it = 0; it < raw_scgi_netstring.size(); ++it)
  2. {
  3. std::cout << "Header Name: " << header_name << "\n";
  4. std::cout << "Header Value: " << header_value << "\n";
  5.  
  6. if(raw_scgi_netstring.at(it) == ',')
  7. {
  8. in_req_body = true;
  9. in_length = false;
  10. in_header_name = false;
  11. in_header_value = false;
  12.  
  13. continue;
  14. }
  15. else if(in_length)
  16. {
  17. if(raw_scgi_netstring.at(it) == ':')
  18. {
  19. in_length = false;
  20. in_header_name = true;
  21.  
  22. continue;
  23. }
  24. else
  25. {
  26. length.push_back(raw_scgi_netstring.at(it));
  27. }
  28. }
  29. else if(in_header_name)
  30. {
  31. if(raw_scgi_netstring.at(it) == '\0')
  32. {
  33. in_header_name = false;
  34. in_header_value = true;
  35. header_name.clear();
  36.  
  37. continue;
  38. }
  39. else
  40. {
  41. header_name.push_back(raw_scgi_netstring.at(it));
  42. }
  43. }
  44. else if(in_header_value)
  45. {
  46. if(raw_scgi_netstring.at(it) == '\0')
  47. {
  48. in_header_value = false;
  49. in_header_name = true;
  50. header_value.clear();
  51.  
  52. continue;
  53. }
  54. else
  55. {
  56. header_value.push_back(raw_scgi_netstring.at(it));
  57. }
  58. }
  59. else if(in_req_body)
  60. {
  61. req_body.push_back(raw_scgi_netstring.at(it));
  62. }
  63. // add header information to headers in unordered_map
  64. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:2: error: expected unqualified-id before ‘for’
  for(int it = 0; it < raw_scgi_netstring.size(); ++it)
  ^
prog.cpp:1:18: error: ‘it’ does not name a type
  for(int it = 0; it < raw_scgi_netstring.size(); ++it)
                  ^
prog.cpp:1:50: error: expected unqualified-id before ‘++’ token
  for(int it = 0; it < raw_scgi_netstring.size(); ++it)
                                                  ^
stdout
Standard output is empty