Lines Matching refs:p
272 fcgi_data_seg *p; in fcgi_hash_destroy() local
280 p = h->data; in fcgi_hash_destroy()
281 while (p) { in fcgi_hash_destroy()
282 fcgi_data_seg *q = p; in fcgi_hash_destroy()
283 p = p->next; in fcgi_hash_destroy()
316 fcgi_data_seg *p = (fcgi_data_seg*)malloc(sizeof(fcgi_data_seg) - 1 + seg_size); in fcgi_hash_strndup() local
318 p->pos = p->data; in fcgi_hash_strndup()
319 p->end = p->pos + seg_size; in fcgi_hash_strndup()
320 p->next = h->data; in fcgi_hash_strndup()
321 h->data = p; in fcgi_hash_strndup()
333 fcgi_hash_bucket *p = h->hash_table[idx]; in fcgi_hash_set() local
335 while (UNEXPECTED(p != NULL)) { in fcgi_hash_set()
336 if (UNEXPECTED(p->hash_value == hash_value) && in fcgi_hash_set()
337 p->var_len == var_len && in fcgi_hash_set()
338 memcmp(p->var, var, var_len) == 0) { in fcgi_hash_set()
340 p->val_len = val_len; in fcgi_hash_set()
341 p->val = fcgi_hash_strndup(h, val, val_len); in fcgi_hash_set()
342 return p->val; in fcgi_hash_set()
344 p = p->next; in fcgi_hash_set()
353 p = h->buckets->data + h->buckets->idx; in fcgi_hash_set()
355 p->next = h->hash_table[idx]; in fcgi_hash_set()
356 h->hash_table[idx] = p; in fcgi_hash_set()
357 p->list_next = h->list; in fcgi_hash_set()
358 h->list = p; in fcgi_hash_set()
359 p->hash_value = hash_value; in fcgi_hash_set()
360 p->var_len = var_len; in fcgi_hash_set()
361 p->var = fcgi_hash_strndup(h, var, var_len); in fcgi_hash_set()
362 p->val_len = val_len; in fcgi_hash_set()
363 p->val = fcgi_hash_strndup(h, val, val_len); in fcgi_hash_set()
364 return p->val; in fcgi_hash_set()
370 fcgi_hash_bucket **p = &h->hash_table[idx]; in fcgi_hash_del() local
372 while (*p != NULL) { in fcgi_hash_del()
373 if ((*p)->hash_value == hash_value && in fcgi_hash_del()
374 (*p)->var_len == var_len && in fcgi_hash_del()
375 memcmp((*p)->var, var, var_len) == 0) { in fcgi_hash_del()
377 (*p)->val = NULL; /* NULL value means deleted */ in fcgi_hash_del()
378 (*p)->val_len = 0; in fcgi_hash_del()
379 *p = (*p)->next; in fcgi_hash_del()
382 p = &(*p)->next; in fcgi_hash_del()
389 fcgi_hash_bucket *p = h->hash_table[idx]; in fcgi_hash_get() local
391 while (p != NULL) { in fcgi_hash_get()
392 if (p->hash_value == hash_value && in fcgi_hash_get()
393 p->var_len == var_len && in fcgi_hash_get()
394 memcmp(p->var, var, var_len) == 0) { in fcgi_hash_get()
395 *val_len = p->val_len; in fcgi_hash_get()
396 return p->val; in fcgi_hash_get()
398 p = p->next; in fcgi_hash_get()
405 fcgi_hash_bucket *p = h->list; in fcgi_hash_apply() local
407 while (p) { in fcgi_hash_apply()
408 if (EXPECTED(p->val != NULL)) { in fcgi_hash_apply()
409 func(p->var, p->var_len, p->val, p->val_len, arg); in fcgi_hash_apply()
411 p = p->list_next; in fcgi_hash_apply()
1014 static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *end) in fcgi_get_params() argument
1018 while (p < end) { in fcgi_get_params()
1019 name_len = *p++; in fcgi_get_params()
1021 if (UNEXPECTED(p + 3 >= end)) return 0; in fcgi_get_params()
1023 name_len |= (*p++ << 16); in fcgi_get_params()
1024 name_len |= (*p++ << 8); in fcgi_get_params()
1025 name_len |= *p++; in fcgi_get_params()
1027 if (UNEXPECTED(p >= end)) return 0; in fcgi_get_params()
1028 val_len = *p++; in fcgi_get_params()
1030 if (UNEXPECTED(p + 3 >= end)) return 0; in fcgi_get_params()
1032 val_len |= (*p++ << 16); in fcgi_get_params()
1033 val_len |= (*p++ << 8); in fcgi_get_params()
1034 val_len |= *p++; in fcgi_get_params()
1036 if (UNEXPECTED(name_len + val_len > (unsigned int) (end - p))) { in fcgi_get_params()
1040 …fcgi_hash_set(&req->env, FCGI_HASH_FUNC(p, name_len), (char*)p, name_len, (char*)p + name_len, val… in fcgi_get_params()
1041 p += name_len + val_len; in fcgi_get_params()
1155 unsigned char *p = buf + sizeof(fcgi_header); in fcgi_read_request() local
1177 if ((p + 4 + 4 + q->var_len + zlen) >= (buf + sizeof(buf))) { in fcgi_read_request()
1181 *p++ = q->var_len; in fcgi_read_request()
1183 *p++ = ((q->var_len >> 24) & 0xff) | 0x80; in fcgi_read_request()
1184 *p++ = (q->var_len >> 16) & 0xff; in fcgi_read_request()
1185 *p++ = (q->var_len >> 8) & 0xff; in fcgi_read_request()
1186 *p++ = q->var_len & 0xff; in fcgi_read_request()
1189 *p++ = zlen; in fcgi_read_request()
1191 *p++ = ((zlen >> 24) & 0xff) | 0x80; in fcgi_read_request()
1192 *p++ = (zlen >> 16) & 0xff; in fcgi_read_request()
1193 *p++ = (zlen >> 8) & 0xff; in fcgi_read_request()
1194 *p++ = zlen & 0xff; in fcgi_read_request()
1196 memcpy(p, q->var, q->var_len); in fcgi_read_request()
1197 p += q->var_len; in fcgi_read_request()
1198 memcpy(p, Z_STRVAL_P(value), zlen); in fcgi_read_request()
1199 p += zlen; in fcgi_read_request()
1202 len = (int)(p - buf - sizeof(fcgi_header)); in fcgi_read_request()