Fix gvc graph

This commit is contained in:
c9s 2014-06-02 01:35:58 +08:00
parent 80b9f00739
commit 2a75861741
3 changed files with 10 additions and 3 deletions

View file

@ -205,7 +205,7 @@ Rendering routes with graphviz
The `test_gvc_render_file` API let you render the whole route trie into a image. The `test_gvc_render_file` API let you render the whole route trie into a image.
![Imgur](http://i.imgur.com/ZwaDEAq.png) ![Imgur](http://i.imgur.com/hA8QXRi.png)
Or you can even export it with dot format: Or you can even export it with dot format:

View file

@ -23,8 +23,8 @@ void r3_tree_build_ag_nodes(Agraph_t * g, Agnode_t * ag_parent_node, const node
node_cnt++; node_cnt++;
char *nodename = NULL; char *nodename = NULL;
if ( n->combined_pattern ) { if ( e && e->child && e->child->combined_pattern ) {
asprintf(&nodename,"%s", n->combined_pattern); asprintf(&nodename,"%s", e->child->combined_pattern);
} else { } else {
asprintf(&nodename,"#%d", node_cnt); asprintf(&nodename,"#%d", node_cnt);
} }

View file

@ -74,6 +74,13 @@ char * r3_slug_to_str(r3_slug_t *s) {
} }
/*
r3_slug_t * r3_slug_parse_next(r3_slug_t *s) {
r3_slug_parse(s->end, s->path_len - (s->end - s->begin), s->end;
}
*/
r3_slug_t * r3_slug_parse(const char *needle, int needle_len, char **errstr) { r3_slug_t * r3_slug_parse(const char *needle, int needle_len, char **errstr) {
r3_slug_t * s = r3_slug_new(needle, needle_len); r3_slug_t * s = r3_slug_new(needle, needle_len);