diff options
Diffstat (limited to 'src/spdy2http/proxy.c')
-rw-r--r-- | src/spdy2http/proxy.c | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/src/spdy2http/proxy.c b/src/spdy2http/proxy.c index c7e37f78..dc6ba351 100644 --- a/src/spdy2http/proxy.c +++ b/src/spdy2http/proxy.c | |||
@@ -244,12 +244,29 @@ parse_uri(regex_t * preg, const char * full_uri, struct URI ** uri) | |||
244 | 244 | ||
245 | (*uri)->full_uri = strdup(full_uri); | 245 | (*uri)->full_uri = strdup(full_uri); |
246 | 246 | ||
247 | asprintf(&((*uri)->scheme), "%.*s",pmatch[2].rm_eo - pmatch[2].rm_so, &full_uri[pmatch[2].rm_so]); | 247 | asprintf(&((*uri)->scheme), |
248 | asprintf(&((*uri)->host_and_port), "%.*s",pmatch[4].rm_eo - pmatch[4].rm_so, &full_uri[pmatch[4].rm_so]); | 248 | "%.*s", |
249 | asprintf(&((*uri)->path), "%.*s",pmatch[5].rm_eo - pmatch[5].rm_so, &full_uri[pmatch[5].rm_so]); | 249 | (int) (pmatch[2].rm_eo - pmatch[2].rm_so), |
250 | asprintf(&((*uri)->path_and_more), "%.*s",pmatch[9].rm_eo - pmatch[5].rm_so, &full_uri[pmatch[5].rm_so]); | 250 | &full_uri[pmatch[2].rm_so]); |
251 | asprintf(&((*uri)->query), "%.*s",pmatch[7].rm_eo - pmatch[7].rm_so, &full_uri[pmatch[7].rm_so]); | 251 | asprintf(&((*uri)->host_and_port), "%.*s", |
252 | asprintf(&((*uri)->fragment), "%.*s",pmatch[9].rm_eo - pmatch[9].rm_so, &full_uri[pmatch[9].rm_so]); | 252 | (int) (pmatch[4].rm_eo - pmatch[4].rm_so), |
253 | &full_uri[pmatch[4].rm_so]); | ||
254 | asprintf(&((*uri)->path), | ||
255 | "%.*s", | ||
256 | (int) (pmatch[5].rm_eo - pmatch[5].rm_so), | ||
257 | &full_uri[pmatch[5].rm_so]); | ||
258 | asprintf(&((*uri)->path_and_more), | ||
259 | "%.*s", | ||
260 | (int) (pmatch[9].rm_eo - pmatch[5].rm_so), | ||
261 | &full_uri[pmatch[5].rm_so]); | ||
262 | asprintf(&((*uri)->query), | ||
263 | "%.*s", | ||
264 | (int) (pmatch[7].rm_eo - pmatch[7].rm_so), | ||
265 | &full_uri[pmatch[7].rm_so]); | ||
266 | asprintf(&((*uri)->fragment), | ||
267 | "%.*s", | ||
268 | (int) (pmatch[9].rm_eo - pmatch[9].rm_so), | ||
269 | &full_uri[pmatch[9].rm_so]); | ||
253 | 270 | ||
254 | colon = strrchr((*uri)->host_and_port, ':'); | 271 | colon = strrchr((*uri)->host_and_port, ':'); |
255 | if(NULL == colon) | 272 | if(NULL == colon) |
@@ -1173,12 +1190,17 @@ run () | |||
1173 | if(glob_opt.verbose) | 1190 | if(glob_opt.verbose) |
1174 | { | 1191 | { |
1175 | 1192 | ||
1176 | struct timespec ts; | 1193 | #ifdef HAVE_CLOCK_GETTIME |
1177 | #ifdef CLOCK_MONOTONIC | 1194 | #ifdef CLOCK_MONOTONIC |
1178 | if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) | 1195 | struct timespec ts; |
1179 | PRINT_VERBOSE2("time now %lld %lld", (unsigned long long)ts.tv_sec, (unsigned long long)ts.tv_nsec); | 1196 | |
1197 | if (0 == clock_gettime(CLOCK_MONOTONIC, &ts)) | ||
1198 | PRINT_VERBOSE2 ("time now %lld %lld", | ||
1199 | (unsigned long long) ts.tv_sec, | ||
1200 | (unsigned long long) ts.tv_nsec); | ||
1180 | } | 1201 | } |
1181 | #endif | 1202 | #endif |
1203 | #endif | ||
1182 | } | 1204 | } |
1183 | while(loop); | 1205 | while(loop); |
1184 | 1206 | ||