14 lines
404 B
Text
14 lines
404 B
Text
|
|
char buf[4096];
|
|
snprintf(buf, sizeof(buf), "GET / HTTP/1.0\r\nHost: %s\r\n\r\n", host);
|
|
ret = gnutls_record_send(session, buf, strlen(buf));
|
|
if (ret < 0) {
|
|
fprintf(stderr, "error: gnutls_record_send: %s\n", gnutls_strerror(ret));
|
|
exit(1);
|
|
}
|
|
ret = gnutls_record_recv(session, buf, sizeof(buf));
|
|
if (ret < 0) {
|
|
fprintf(stderr, "error: gnutls_record_recv: %s\n", gnutls_strerror(ret));
|
|
exit(1);
|
|
}
|
|
|