diff options
Diffstat (limited to 'src/examples/mhd2spdy_structures.c')
-rw-r--r-- | src/examples/mhd2spdy_structures.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/src/examples/mhd2spdy_structures.c b/src/examples/mhd2spdy_structures.c index da29581c..2982b2a4 100644 --- a/src/examples/mhd2spdy_structures.c +++ b/src/examples/mhd2spdy_structures.c | |||
@@ -32,7 +32,6 @@ free_uri(struct URI * uri) | |||
32 | free(uri->full_uri); | 32 | free(uri->full_uri); |
33 | free(uri->scheme); | 33 | free(uri->scheme); |
34 | free(uri->host_and_port); | 34 | free(uri->host_and_port); |
35 | //free(uri->host_and_port_for_connecting); | ||
36 | free(uri->host); | 35 | free(uri->host); |
37 | free(uri->path); | 36 | free(uri->path); |
38 | free(uri->path_and_more); | 37 | free(uri->path_and_more); |
@@ -43,6 +42,7 @@ free_uri(struct URI * uri) | |||
43 | } | 42 | } |
44 | } | 43 | } |
45 | 44 | ||
45 | |||
46 | int | 46 | int |
47 | init_parse_uri(regex_t * preg) | 47 | init_parse_uri(regex_t * preg) |
48 | { | 48 | { |
@@ -66,7 +66,9 @@ deinit_parse_uri(regex_t * preg) | |||
66 | } | 66 | } |
67 | 67 | ||
68 | int | 68 | int |
69 | parse_uri(regex_t * preg, char * full_uri, struct URI ** uri) | 69 | parse_uri(regex_t * preg, |
70 | char * full_uri, | ||
71 | struct URI ** uri) | ||
70 | { | 72 | { |
71 | int ret; | 73 | int ret; |
72 | char *colon; | 74 | char *colon; |
@@ -94,22 +96,8 @@ parse_uri(regex_t * preg, char * full_uri, struct URI ** uri) | |||
94 | if(NULL == colon) | 96 | if(NULL == colon) |
95 | { | 97 | { |
96 | (*uri)->host = strdup((*uri)->host_and_port); | 98 | (*uri)->host = strdup((*uri)->host_and_port); |
97 | /*if(0 == strcasecmp("http", uri->scheme)) | 99 | (*uri)->port = 0; |
98 | { | 100 | |
99 | uri->port = 80; | ||
100 | asprintf(&(uri->host_and_port_for_connecting), "%s:80", uri->host_and_port); | ||
101 | } | ||
102 | else if(0 == strcasecmp("https", uri->scheme)) | ||
103 | { | ||
104 | uri->port = 443; | ||
105 | asprintf(&(uri->host_and_port_for_connecting), "%s:443", uri->host_and_port); | ||
106 | } | ||
107 | else | ||
108 | { | ||
109 | PRINT_INFO("no standard scheme!"); | ||
110 | */(*uri)->port = 0; | ||
111 | /*uri->host_and_port_for_connecting = strdup(uri->host_and_port); | ||
112 | }*/ | ||
113 | return 0; | 101 | return 0; |
114 | } | 102 | } |
115 | 103 | ||
@@ -125,6 +113,7 @@ parse_uri(regex_t * preg, char * full_uri, struct URI ** uri) | |||
125 | return 0; | 113 | return 0; |
126 | } | 114 | } |
127 | 115 | ||
116 | |||
128 | void | 117 | void |
129 | free_proxy(struct Proxy *proxy) | 118 | free_proxy(struct Proxy *proxy) |
130 | { | 119 | { |
@@ -136,6 +125,7 @@ free_proxy(struct Proxy *proxy) | |||
136 | free(proxy); | 125 | free(proxy); |
137 | } | 126 | } |
138 | 127 | ||
128 | //TODO remove this | ||
139 | void *au_malloc(size_t size) | 129 | void *au_malloc(size_t size) |
140 | { | 130 | { |
141 | void *new_memory; | 131 | void *new_memory; |