version 1.67, 2006/06/23 20:35:25 |
version 1.68, 2006/07/07 12:00:25 |
|
|
if (!port) |
if (!port) |
port = "443"; |
port = "443"; |
|
|
if (debug) |
|
printf("CONNECT %s:%s HTTP/1.1\n\n", host, port); |
|
l = asprintf(&connstr, "CONNECT %s:%s HTTP/1.1\n\n", host, port); |
l = asprintf(&connstr, "CONNECT %s:%s HTTP/1.1\n\n", host, port); |
if (l == -1) |
if (l == -1) |
errx(1, "Could not allocate memory to assemble connect string!"); |
errx(1, "Could not allocate memory to assemble connect string!"); |
|
if (debug) |
|
printf("%s", connstr); |
if (write(socket, connstr, l) != l) |
if (write(socket, connstr, l) != l) |
errx(1, "Could not send connect string: %s", strerror(errno)); |
err(1, "Could not send connect string"); |
read(socket, &buf, sizeof(buf)); /* only proxy header XXX: error handling? */ |
read(socket, &buf, sizeof(buf)); /* only proxy header XXX: error handling? */ |
return(200); |
return(200); |
} |
} |