On Die 05.08.2003 15:20, Alexander Lazic wrote:
can anyone validate this patch to you codingstyles and rules and add to the Sources?
Sorry now the patch;
--- oops-1.5.22f1/src/run_client.c 2001-12-28 14:46:54.000000000 +0100
+++ oops-1.5.22f1_al/src/run_client.c 2003-08-05 15:11:41.000000000 +0200
@@ -1072,6 +1072,11 @@
IF_FREE(rq->method); rq->method = strdup(src);
*p = ' ';
p++;
+ /*
+ CONNECT www.gmx.at:443 HTTP/1.1
+ GET http://zipper.paco.net/~igor/oops.eng/download.html HTTP/1.0
+ */
+ my_xlog(OOPS_LOG_DBG, "run_client.c => src :%s:\n", src);
/* next space must be before HTTP */
httpv = strrchr(p, 'H');
if ( rq->meth == METH_CONNECT ) {
@@ -1096,8 +1101,13 @@
}
*httpv = ' ';
if ( sscanf(httpv+1, "HTTP/%d.%d", &http_major, &http_minor) == 2 ) {
+ /* my_xlog(OOPS_LOG_DBG, "run_client.c parse_http_request() => httpv :%s:\n",
httpv+1); */
rq->http_major = http_major;
rq->http_minor = http_minor;
+ /*
+ my_xlog(OOPS_LOG_DBG, "run_client.c parse_http_request() => http_major
:%d:\n", http_major);
+ my_xlog(OOPS_LOG_DBG, "run_client.c parse_http_request() => http_minor
:%d:\n", http_minor);
+ */
} else
return(-1);
return(0);
@@ -1106,8 +1116,13 @@
static int
parse_connect_url(char* src, char *httpv, struct url *url, int so)
{
-char *ss, *host=NULL;
+char *ss,*host=NULL;
+int http_major, http_minor;
+ /*
+ my_xlog(OOPS_LOG_DBG, "run_client.c parse_connect_url() => src :%s:\n", src);
+ my_xlog(OOPS_LOG_DBG, "run_client.c parse_connect_url() => httpv :%s:\n", httpv);
+ */
if ( !src ) return(-1);
ss = strchr(src, ':');
if ( !ss ) {
@@ -1121,6 +1136,34 @@
memcpy_to_lower(host, src, strlen(src)+1);
url->host = host;
url->port = atoi(ss+1);
+
+ /* my_xlog(OOPS_LOG_DBG, "run_client.c parse_connect_url() => httpv :%s:\n",
httpv); */
+ if ( sscanf(httpv, "TTP/%d.%d", &http_major, &http_minor) == 2 ) {
+ /*
+ my_xlog(OOPS_LOG_DBG, "run_client.c parse_connect_url im if => httpv :%s:\n",
httpv+2);
+ rq->http_major = http_major;
+ rq->http_minor = http_minor;
+ my_xlog(OOPS_LOG_DBG, "run_client.c parse_http_request() => http_major
:%d:\n", http_major);
+ my_xlog(OOPS_LOG_DBG, "run_client.c parse_http_request() => http_minor
:%d:\n", http_minor);
+ */
+ } else
+ return(-1);
+
+ /* When must i free it?! */
+ url->httpv = xmalloc(strlen("HTTP/1.x")+1, "parse_connect_url():");
+ if (!url->httpv)
+ goto err;
+
+ memset(url->httpv,0,strlen("HTTP/1.x")+1);
+ snprintf(url->httpv,strlen("HTTP/1.x")+1,"HTTP/%d.%d",http_major,http_minor);
+
+ /*
+ my_xlog(OOPS_LOG_DBG, "run_client.c parse_connect_url() => ss :%s:\n", ss);
+ my_xlog(OOPS_LOG_DBG, "run_client.c parse_connect_url() => src :%s:\n", src);
+ my_xlog(OOPS_LOG_DBG, "run_client.c parse_connect_url() => host :%s:\n", host);
+ my_xlog(OOPS_LOG_DBG, "run_client.c parse_connect_url() => port :%d:\n",
atoi(ss+1));
+ my_xlog(OOPS_LOG_DBG, "run_client.c parse_connect_url() => httpv :%s:\n", httpv);
+ */
goto done;
err:
*ss = ':';
--- oops-1.5.22f1/src/ssl.c 2002-03-01 10:42:06.000000000 +0100
+++ oops-1.5.22f1_al/src/ssl.c 2003-08-05 15:02:55.000000000 +0200
@@ -45,6 +45,7 @@
ERR_INTERNAL, rq);
goto done;
}
+ my_xlog(OOPS_LOG_DBG, "ssl.c => httpv :%s:\n", rq->url.httpv);
if ( parent_port && !is_local_dom(rq->url.host)) {
parent_req = malloc(64 + strlen(url->host));
if ( parent_req ) {
@@ -52,10 +53,12 @@
if ( parent_auth &&
(fav = format_av_pair("Proxy-Authorization: Basic", rq->peer_auth))) {
- sprintf(parent_req, "CONNECT %s:%d HTTP/1.0\r\n%s\r\n", url->host,
url->port,fav);
+ /* sprintf(parent_req, "CONNECT %s:%d HTTP/1.1\r\n%s\r\n", url->host,
url->port,fav); */
+ sprintf(parent_req, "CONNECT %s:%d %s\r\n%s\r\n", url->host,
url->port,url->httpv,fav);
xfree(fav);
} else
- sprintf(parent_req, "CONNECT %s:%d HTTP/1.0\r\n\r\n", url->host,
url->port);
+ /* sprintf(parent_req, "CONNECT %s:%d HTTP/1.0\r\n\r\n", url->host,
url->port); */
+ sprintf(parent_req, "CONNECT %s:%d %s\r\n\r\n", url->host,
url->port,url->httpv);
r = writet(server_so, parent_req, strlen(parent_req), READ_ANSW_TIMEOUT);
free(parent_req);
if ( r < 0 ) goto done;
