| 163 | } |
| 164 | |
| 165 | static char *get_cookie_param(request_rec *r, const char *name) |
| 166 | { |
| 167 | const char *cookies; |
| 168 | const char *start_cookie; |
| 169 | |
| 170 | if ((cookies = apr_table_get(r->headers_in, "Cookie"))) { |
| 171 | for (start_cookie = ap_strstr_c(cookies, name); start_cookie; |
| 172 | start_cookie = ap_strstr_c(start_cookie + 1, name)) { |
| 173 | if (start_cookie == cookies || |
| 174 | start_cookie[-1] == ';' || |
| 175 | start_cookie[-1] == ',' || |
| 176 | isspace(start_cookie[-1])) { |
| 177 | |
| 178 | start_cookie += strlen(name); |
| 179 | while(*start_cookie && isspace(*start_cookie)) |
| 180 | ++start_cookie; |
| 181 | if (*start_cookie++ == '=' && *start_cookie) { |
| 182 | /* |
| 183 | * Session cookie was found, get its value |
| 184 | */ |
| 185 | char *end_cookie, *cookie; |
| 186 | cookie = apr_pstrdup(r->pool, start_cookie); |
| 187 | if ((end_cookie = strchr(cookie, ';')) != NULL) |
| 188 | *end_cookie = '\0'; |
| 189 | if((end_cookie = strchr(cookie, ',')) != NULL) |
| 190 | *end_cookie = '\0'; |
| 191 | return cookie; |
| 192 | } |
| 193 | } |
| 194 | } |
| 195 | } |
| 196 | return NULL; |
| 197 | } |
| 198 | |
| 199 | /* Find the worker that has the 'route' defined |
| 200 | */ |
no test coverage detected