+ std::string proxyhostname;
+ std::string tmp_file;
+ bool legacy_format = false;
+
+ if (m_p->content_proxy_server.length())
+ {
+ proxyhostname = m_p->content_proxy_server;
+ legacy_format = true;
+ }
+
+ if (m_p->content_tmp_file.length())
+ tmp_file = m_p->content_tmp_file;
+
+ if (m_p->content_config_file.length())
+ {
+ FILE *inf = fopen(m_p->content_config_file.c_str(), "r");
+ if (inf)
+ {
+ char buf[1024];
+ while (fgets(buf, sizeof(buf)-1, inf))
+ {
+ char *cp;
+ cp = strchr(buf, '#');
+ if (cp)
+ *cp = '\0';
+ cp = strchr(buf, '\n');
+ if (cp)
+ *cp = '\0';
+ cp = strchr(buf, ':');
+ if (cp)
+ {
+ char *cp1 = cp;
+ while (cp1 != buf && cp1[-1] == ' ')
+ cp1--;
+ *cp1 = '\0';
+ cp++;
+ while (*cp == ' ')
+ cp++;
+ if (!strcmp(buf, "proxyhostname"))
+ proxyhostname = cp;
+ if (!strcmp(buf, "sessiondir") && *cp)
+ {
+ if (cp[strlen(cp)-1] == '/')
+ cp[strlen(cp)-1] = '\0';
+ tmp_file = std::string(cp) + std::string("/cf.XXXXXX.p");
+ }
+ }
+ }
+ fclose(inf);
+ }
+ else
+ {
+ package.log("zoom", YLOG_WARN|YLOG_ERRNO,
+ "unable to open content config %s",
+ m_p->content_config_file.c_str());
+ *error = YAZ_BIB1_TEMPORARY_SYSTEM_ERROR;
+ *addinfo = (char *) odr_malloc(odr, 60 + tmp_file.length());
+ sprintf(*addinfo, "unable to open content config %s",
+ m_p->content_config_file.c_str());
+ return false;
+ }
+ }
+
+ if (proxyhostname.length() == 0)
+ {
+ package.log("zoom", YLOG_WARN, "no proxyhostname");
+ return true;
+ }
+ if (tmp_file.length() == 0)
+ {
+ package.log("zoom", YLOG_WARN, "no tmp_file");
+ return true;
+ }
+
+ char *fname = xstrdup(tmp_file.c_str());