-const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.37 2008/04/17 14:53:29 fabiankeil Exp $";
+const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.38 2008/04/18 05:17:18 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/urlmatch.c,v $
*
* Revisions :
* $Log: urlmatch.c,v $
+ * Revision 1.38 2008/04/18 05:17:18 fabiankeil
+ * Mark simplematch()'s parameters as immutable.
+ *
* Revision 1.37 2008/04/17 14:53:29 fabiankeil
* Move simplematch() into urlmatch.c as it's only
* used to match (old-school) domain patterns.
char *v[10]; /* XXX: Why 10? We should only need three. */
int n;
jb_err err;
- int is_connect = 0;
memset(http, '\0', sizeof(*http));
return JB_ERR_PARSE;
}
- if (strcmpic(v[0], "CONNECT") == 0)
- {
- is_connect = 1;
- }
-
err = parse_http_url(v[1], http, csp);
if (err)
{
/*
* Copy the details into the structure
*/
- http->ssl = is_connect;
+ http->ssl = !strcmpic(v[0], "CONNECT");
http->cmd = strdup(req);
http->gpc = strdup(v[0]);
http->ver = strdup(v[2]);
+ freez(buf);
+
if ( (http->cmd == NULL)
|| (http->gpc == NULL)
|| (http->ver == NULL) )
{
- free(buf);
return JB_ERR_MEMORY;
}
- free(buf);
return JB_ERR_OK;
}