title: Im unsure of why my http server is not reading in a filelocation C++
body: <p>Im creating a http server in c++.  I know that TCPServer.h works and that thing/text.txt exists but for some reason the code doesnt read the text file when I do 127.0.0.1.  If you would like TCPServer.h to help help just ask I would be more than happy to send it but I just didnt see a reason to do it</p>
  
  <pre><code>#include "TCPServer.h"
  #include &lt;future&gt;
  #include &lt;fstream&gt;
  #include &lt;WS2tcpip.h&gt;
  #include &lt;iostream&gt;
  #define MAX_BUF (4096)
  #pragma comment (lib, "ws2_32.lib")
  char * getLoc(char * c) {
      char * ret = (char *)malloc(4096);
      ZeroMemory(ret, 4096);
      for(int i = 4; i &lt; 4092; i++) {
          if (*(c + i) == ' ') {
              return ret;
          }
      else {
          *(ret + i - 4) = *(c + i);
      }
  }
  return ret;
  }
  void doStuff(SOCKET sock) {
          char * recieved = (char *)malloc(4096);
      recv(sock, recieved, 4096, 0);
      char * loc = getLoc(recieved);
      std::string fileLocation("thing");
      fileLocation += loc;
      std::ifstream fil;
      fil.open(fileLocation);
      char * contents = (char *)malloc(4096);
      ZeroMemory(contents, 4096);
      fil.read(contents, 4096);
      fil.close();
      std::cout &lt;&lt; fileLocation;
      std::string shoot("HTTP/1.1 200 OK\n");
      shoot += contents;
      std::cout &lt;&lt; "\n\n\n" &lt;&lt; shoot;
      send(sock, shoot.c_str(), 4096, 0);
  }
  int main() {
  TCPServ s;
  s.createSock(80);
  while (true) {
      SOCKET sock = s.listenFor();
      std::future &lt;void&gt; f = std::async(doStuff, sock);
  }
  }
  </code></pre>