- cs_parse_host(vhost, &host, &t, &proto, &connect_host);
+ const char *bind_host = strchr(vhost, ' ');
+ if (bind_host && bind_host[1])
+ bind_host++;
+ else
+ bind_host = 0;
+
+ *proxy_mode = 0;
+ if (!cs_parse_host(vhost, &host, &t, &proto, &connect_host))
+ return 0;
+
+ /* vhost proxy proxy method proxy-flag */
+ /* TCP+Z3950 TCP+Z3950 TCP+Z3950 1 */
+ /* TCP+Z3950 TCP+HTTP CONNECT 0 */
+ /* TCP+HTTP TCP+Z3950 TCP+HTTP 1 */
+ /* TCP+HTTP TCP+HTTP TCP+HTTP 1 */
+ /* SSL+* TCP+* CONNECT 0 */
+ /* ? SSL error */
+
+ if (proxy_host && !connect_host)
+ {
+ enum oid_proto proto1;
+ CS_TYPE t1;
+ const char *host1 = 0;
+
+ if (!cs_parse_host(proxy_host, &host1, &t1, &proto1, &connect_host))
+ return 0;
+ if (connect_host)
+ {
+ xfree(connect_host);
+ return 0;
+ }
+ if (t1 != tcpip_type)
+ return 0;
+
+ if (t == ssl_type || (proto == PROTO_Z3950 && proto1 == PROTO_HTTP))
+ connect_host = xstrdup(host1);
+ else
+ {
+ *proxy_mode = 1;
+ host = host1;
+ }
+ }