X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fcomstack.c;h=ba1cad329fcf69bdb466c5603923642bb0b279ba;hb=b55ea70d15d3ffaa247cc30db0e6b8dcc4d6ac7c;hp=7ee51fe4234c00a4a1d6ec895179b47f5ec04914;hpb=e72e394106dd25d6a8a8c7c2fa677f40ef5e7eb6;p=yaz-moved-to-github.git diff --git a/src/comstack.c b/src/comstack.c index 7ee51fe..ba1cad3 100644 --- a/src/comstack.c +++ b/src/comstack.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2004, Index Data * See the file LICENSE for details. * - * $Id: comstack.c,v 1.7 2004-04-28 22:44:59 adam Exp $ + * $Id: comstack.c,v 1.10 2004-05-03 09:00:50 adam Exp $ */ #include @@ -74,13 +74,6 @@ COMSTACK cs_create_host(const char *type_and_host, int blocking, void **vp) COMSTACK cs; CS_TYPE t; - printf ( -#if HAVE_OPENSSL_SSL_H - "cs_create_host SSL\n" -#else - "cs_create_host\n" -#endif - ); if (strncmp (type_and_host, "tcp:", 4) == 0) { t = tcpip_type; @@ -108,8 +101,8 @@ COMSTACK cs_create_host(const char *type_and_host, int blocking, void **vp) { t = tcpip_type; host = type_and_host + 5; - if (host[0] == '/' && host[1] == '/') - host = host + 2; + while (host[0] == '/') + host++; proto = PROTO_HTTP; } else if (strncmp(type_and_host, "https:", 6) == 0) @@ -117,8 +110,8 @@ COMSTACK cs_create_host(const char *type_and_host, int blocking, void **vp) #if HAVE_OPENSSL_SSL_H t = ssl_type; host = type_and_host + 6; - if (host[0] == '/' && host[1] == '/') - host = host + 2; + while (host[0] == '/') + host++; proto = PROTO_HTTP; #else return 0; @@ -128,7 +121,6 @@ COMSTACK cs_create_host(const char *type_and_host, int blocking, void **vp) { t = tcpip_type; host = type_and_host; - } cs = cs_create (t, blocking, proto); if (!cs) @@ -250,17 +242,17 @@ int cs_complete_auto(const unsigned char *buf, int len) break; } else if (i < len - 20 && - !strncasecmp(buf+i, "Transfer-Encoding:", 18)) + !strncasecmp((const char *) buf+i, "Transfer-Encoding:", 18)) { i+=18; while (buf[i] == ' ') i++; if (i < len - 8) - if (!strncasecmp(buf+i, "chunked", 7)) + if (!strncasecmp((const char *) buf+i, "chunked", 7)) chunked = 1; } else if (i < len - 17 && - !strncasecmp(buf+i, "Content-Length:", 15)) + !strncasecmp((const char *)buf+i, "Content-Length:", 15)) { i+= 15; while (buf[i] == ' ')