+static struct tcpip_state *tcpip_state_create(void)
+{
+ tcpip_state *sp = (struct tcpip_state *) xmalloc(sizeof(*sp));
+
+ sp->altbuf = 0;
+ sp->altsize = sp->altlen = 0;
+ sp->towrite = sp->written = -1;
+ sp->complete = cs_complete_auto;
+
+#if HAVE_GETADDRINFO
+ sp->ai = 0;
+ sp->ai_connect = 0;
+#if RESOLVER_THREAD
+ sp->hoststr = 0;
+ sp->pipefd[0] = sp->pipefd[1] = -1;
+ sp->port = 0;
+#endif
+#endif
+
+#if HAVE_GNUTLS_H
+ sp->cred_ptr = 0;
+ sp->session = 0;
+ strcpy(sp->cert_fname, "yaz.pem");
+#endif
+ sp->connect_request_buf = 0;
+ sp->connect_request_len = 0;
+ sp->connect_response_buf = 0;
+ sp->connect_response_len = 0;
+ return sp;
+}
+