diff --git a/src/or/buffers.c b/src/or/buffers.c index 0b56481304..57aca60afc 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -394,12 +394,12 @@ int fetch_from_buf_http(buf_t *buf, * socks5 phase two: "version command 0 addresstype..." * If it's a complete and valid handshake, and destaddr fits in * MAX_SOCKS_ADDR_LEN bytes, then pull the handshake off the buf, - * assign to *req, and return 1. + * assign to req, and return 1. * If it's invalid or too big, return -1. * Else it's not all there yet, leave buf alone and return 0. - * If you want to specify the socks reply, write it into *reply - * and set *replylen, else leave *replylen alone. - * If returning 0 or -1, *addr_out and *port_out are undefined. + * If you want to specify the socks reply, write it into req->reply + * and set req->replylen, else leave req->replylen alone. + * If returning 0 or -1, req->address and req->port are undefined. */ int fetch_from_buf_socks(buf_t *buf, socks_request_t *req) { unsigned char len; @@ -538,8 +538,31 @@ int fetch_from_buf_socks(buf_t *buf, socks_request_t *req) { buf_remove_from_front(buf, next-buf->mem+1); /* next points to the final \0 on inbuf */ return 1; + case 'G': /* get */ + case 'H': /* head */ + case 'P': /* put/post */ + case 'C': /* connect */ + strcpy(req->reply, +"HTTP/1.0 501 Tor is not an HTTP Proxy\r\n" +"Content-Type: text/html; charset=iso-8859-1\r\n" +"\n" +"
\n" +"