Got a question in regards to reciving files from a remote site.
Code:
// connect to remote site - ok!
char buf[1024];
char *msg = "GET / HTTP/1.0 \n\n";
int count = send(socketfd, msg, strlen(msg), 0);
count = recv(socketfd, buf, sizeof(buf),0);
The above code connects to a specific web server and ask for index.html file on the remote site - this works. The data is placed in the char array which is fine, but is this the best way of going about this ? 1024 Bytes is hardly enough to store a html file and I assume making a char buf[100240]; also is overkill. Is there a better method of storing the data ?
Thanks for any input