85 |
else { |
else { |
86 |
state = 0; |
state = 0; |
87 |
} |
} |
88 |
|
break; |
89 |
} |
} |
90 |
} |
} |
91 |
} |
} |
92 |
|
|
93 |
char * method; |
char * method; |
94 |
char * url; |
char * url; |
95 |
char * request_line = stream->data; |
char * request_line = (char *) stream->data; |
96 |
char * first_space = strchr(request_line, ' '); |
char * first_space = strchr(request_line, ' '); |
97 |
assert(first_space != NULL); |
assert(first_space != NULL); |
98 |
char * second_space = strchr(first_space + 1, ' '); |
char * second_space = strchr(first_space + 1, ' '); |
99 |
assert(second_space != NULL); |
assert(second_space != NULL); |
100 |
method = xstrndup(stream->data, first_space - request_line); |
method = xstrndup(request_line, first_space - request_line); |
101 |
url = xstrndup(first_space + 1, second_space - (first_space + 1)); |
url = xstrndup(first_space + 1, second_space - (first_space + 1)); |
102 |
|
|
103 |
/* send response */ |
/* send response */ |