View | Details | Raw Unified | Return to bug 44116
Collapse All | Expand All

(-)jk_lb_worker.c (-10 / +12 lines)
Lines 358-382 Link Here
358
                         * Session cookie was found, get it's value
358
                         * Session cookie was found, get it's value
359
                         */
359
                         */
360
                        char *id_end;
360
                        char *id_end;
361
                        size_t sz;
361
                        ++id_start;
362
                        ++id_start;
362
                        id_start = jk_pool_strdup(s->pool, id_start);
363
                        if ((id_end = strpbrk(id_start, ";,")) != NULL)
363
                        if ((id_end = strchr(id_start, ';')) != NULL) {
364
                            sz = id_end - id_start;
364
                            *id_end = '\0';
365
                        else {
366
                            sz = strlen(id_start);
367
                            id_end = id_start + sz;
365
                        }
368
                        }
366
                        if ((id_end = strchr(id_start, ',')) != NULL) {
367
                            *id_end = '\0';
368
                        }
369
                        if (result == NULL) {
369
                        if (result == NULL) {
370
                            result = id_start;
370
                            result = jk_pool_alloc(s->pool, sz + 1);
371
                            memcpy(result, id_start, sz);
372
                            result[sz] = '\0';
371
                        }
373
                        }
372
                        else {
374
                        else {
373
                            size_t osz = strlen(result) + 1;
375
                            size_t osz = strlen(result) + 1;
374
                            size_t sz = osz + strlen(id_start) + 1;
375
                            result =
376
                            result =
376
                                jk_pool_realloc(s->pool, sz, result, osz);
377
                                jk_pool_realloc(s->pool, osz + sz + 1, result, osz);
377
                            strcat(result, ";");
378
                            strcat(result, ";");
378
                            strcat(result, id_start);
379
                            strncat(result, id_start, sz);
379
                        }
380
                        }
381
                        id_start = id_end;
380
                    }
382
                    }
381
                }
383
                }
382
            }
384
            }

Return to bug 44116