-#endif
- if ((p = strchr(buf, ':')) == NULL)
- {
- url->port = 0;
- }
- else
- {
- *p++ = '\0';
- url->port = atoi(p);
- }
-
- if ((url->domain = strdup(buf)) == NULL)
- {
- freez(url->spec);
- freez(url->path);
-#ifdef REGEX
- freez(url->preg);
-#endif /* def REGEX */
- return 1;
- }
-
- /* split domain into components */
-
- *tmp_url = dsplit(url->domain);
- url->dbuf = tmp_url->dbuf;
- url->dcnt = tmp_url->dcnt;
- url->dvec = tmp_url->dvec;
- url->unanchored = tmp_url->unanchored;
-
- return 0; /* OK */
-}
-
-
-/*********************************************************************
- *
- * Function : unload_url
- *
- * Description : Called from the "unloaders". Freez the url
- * structure elements.
- *
- * Parameters :
- * 1 : url = pointer to a url_spec structure.
- *
- * Returns : N/A
- *
- *********************************************************************/
-static void unload_url(struct url_spec *url)
-{
- if (url == NULL) return;
-
- freez(url->spec);
- freez(url->domain);
- freez(url->dbuf);
- freez(url->dvec);
- freez(url->path);
-#ifdef REGEX
- if (url->preg)
- {
- regfree(url->preg);
- freez(url->preg);
- }
-#endif
-
-}
-
-
-#ifdef ACL_FILES
-/*********************************************************************
- *
- * Function : unload_aclfile
- *
- * Description : Unloads an aclfile.
- *
- * Parameters :
- * 1 : f = the data structure associated with the aclfile.
- *
- * Returns : N/A
- *
- *********************************************************************/
-static void unload_aclfile(void *f)
-{
- struct access_control_list *b = (struct access_control_list *)f;
- if (b == NULL) return;
-
- unload_aclfile(b->next);
-
- freez(b);
-
-}
-#endif /* def ACL_FILES */
-
-
-/*********************************************************************
- *
- * Function : unload_permissions_file
- *
- * Description : Unloads a permissions file.
- *
- * Parameters :
- * 1 : file_data = the data structure associated with the
- * permissions file.
- *
- * Returns : N/A
- *
- *********************************************************************/
-static void unload_permissions_file(void *file_data)
-{
- struct permissions_spec * next;
- struct permissions_spec * cur = (struct permissions_spec *)file_data;
- while (cur != NULL)
- {
- next = cur->next;
- unload_url(cur->url);
- freez(cur);
- cur = next;
- }
-
-}
-
-
-#ifdef TRUST_FILES
-/*********************************************************************
- *
- * Function : unload_trustfile
- *
- * Description : Unloads a trustfile.
- *
- * Parameters :
- * 1 : f = the data structure associated with the trustfile.
- *
- * Returns : N/A
- *
- *********************************************************************/
-static void unload_trustfile(void *f)
-{
- struct block_spec *b = (struct block_spec *)f;
- if (b == NULL) return;
-
- unload_trustfile(b->next);
-
- unload_url(b->url);
-
- freez(b);
-
-}
-#endif /* def TRUST_FILES */
-
-
-/*********************************************************************
- *
- * Function : unload_forwardfile
- *
- * Description : Unloads a forwardfile.
- *
- * Parameters :
- * 1 : f = the data structure associated with the forwardfile.
- *
- * Returns : N/A
- *
- *********************************************************************/
-static void unload_forwardfile(void *f)
-{
- struct forward_spec *b = (struct forward_spec *)f;
- if (b == NULL) return;
-
- unload_forwardfile(b->next);
-
- unload_url(b->url);
-
- freez(b->gw->gateway_host);
- freez(b->gw->forward_host);
-
- freez(b);
-
-}
-
-
-#ifdef PCRS
-/*********************************************************************
- *
- * Function : unload_re_filterfile
- *
- * Description : Unload the re_filter list.
- *
- * Parameters :
- * 1 : f = the data structure associated with the filterfile.
- *
- * Returns : N/A
- *
- *********************************************************************/
-static void unload_re_filterfile(void *f)
-{
- pcrs_job *joblist;
- struct re_filterfile_spec *b = (struct re_filterfile_spec *)f;
-
- if (b == NULL) return;
-
- destroy_list(b->patterns);