-const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.40 2008/04/23 16:12:28 fabiankeil Exp $";
+const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.41 2008/05/02 09:51:34 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/urlmatch.c,v $
  *
  * Revisions   :
  *    $Log: urlmatch.c,v $
+ *    Revision 1.41  2008/05/02 09:51:34  fabiankeil
+ *    In parse_http_url(), don't muck around with values
+ *    that are none of its business: require an initialized
+ *    http structure and never unset http->ssl.
+ *
  *    Revision 1.40  2008/04/23 16:12:28  fabiankeil
  *    Free with freez().
  *
          http->host = NULL;
          host_available = 0;
       }
+      else if (!http->ssl)
+      {
+         freez(buf);
+         return JB_ERR_PARSE;
+      }
 
       url_path = strchr(url_noproto, '/');
       if (url_path != NULL)
       return JB_ERR_PARSE;
    }
 
+   http->ssl = !strcmpic(v[0], "CONNECT");
+
    err = parse_http_url(v[1], http, csp);
    if (err)
    {
    /*
     * Copy the details into the structure
     */
-   http->ssl = !strcmpic(v[0], "CONNECT");
    http->cmd = strdup(req);
    http->gpc = strdup(v[0]);
    http->ver = strdup(v[2]);