diff --git a/apps/webget.cc b/apps/webget.cc index 4f4a3e9..e24af2f 100644 --- a/apps/webget.cc +++ b/apps/webget.cc @@ -1,4 +1,5 @@ -#include "socket.hh" +// #include "socket.hh" +#include "tcp_sponge_socket.hh" #include "util.hh" #include @@ -16,7 +17,7 @@ void get_URL(const string &host, const string &path) { // Then you'll need to print out everything the server sends back, // (not just one call to read() -- everything) until you reach // the "eof" (end of file). - TCPSocket sock; + CS144TCPSocket sock; sock.connect(Address(host, "http")); string request = "GET " + path + " HTTP/1.1\r\nHost: " + host + "\r\nConnection: close\r\n\r\n"; sock.write(request); @@ -25,6 +26,7 @@ void get_URL(const string &host, const string &path) { cout << recvd; recvd = sock.read(); } + sock.wait_until_closed(); // cerr << "Function called: get_URL(" << host << ", " << path << ").\n"; // cerr << "Warning: get_URL() has not been implemented yet.\n"; }