comparison src/c/fastcgi.c @ 1055:118a5a08a881

Merge
author Adam Chlipala <adamc@hcoop.net>
date Thu, 03 Dec 2009 11:56:15 -0500
parents c2317cfb99ec
children db52c32dbe42
comparison
equal deleted inserted replaced
1054:b06a2a65e670 1055:118a5a08a881
221 return r; 221 return r;
222 } 222 }
223 else if (*len < 4) 223 else if (*len < 4)
224 return -1; 224 return -1;
225 else { 225 else {
226 int r = (((*buf)[3] & 0x7f) << 24) + ((*buf)[2] << 16) + ((*buf)[1] << 8) + (*buf)[0]; 226 int r = (((*buf)[0] & 0x7f) << 24) + ((*buf)[1] << 16) + ((*buf)[2] << 8) + (*buf)[3];
227 *buf += 4; 227 *buf += 4;
228 *len -= 4; 228 *len -= 4;
229 return r; 229 return r;
230 } 230 }
231 } 231 }
234 int nameLength, valueLength; 234 int nameLength, valueLength;
235 235
236 if ((nameLength = read_funny_len(buf, &len)) < 0) 236 if ((nameLength = read_funny_len(buf, &len)) < 0)
237 return -1; 237 return -1;
238 if ((valueLength = read_funny_len(buf, &len)) < 0) 238 if ((valueLength = read_funny_len(buf, &len)) < 0)
239 return -1; 239 return -2;
240 if (len < nameLength + valueLength) 240 if (len < nameLength + valueLength)
241 return -1; 241 return -3;
242 242
243 if (nameLength+1 > nv->name_len) { 243 if (nameLength+1 > nv->name_len) {
244 nv->name_len = nameLength+1; 244 nv->name_len = nameLength+1;
245 nv->name = realloc(nv->name, nv->name_len); 245 nv->name = realloc(nv->name, nv->name_len);
246 } 246 }
372 if (read_nvp(&buf, len - (buf - r->contentData), &hs.nvps[used_nvps]) < 0) { 372 if (read_nvp(&buf, len - (buf - r->contentData), &hs.nvps[used_nvps]) < 0) {
373 write_stderr(out, "Error reading FCGI_PARAMS name-value pair\n"); 373 write_stderr(out, "Error reading FCGI_PARAMS name-value pair\n");
374 goto done; 374 goto done;
375 } 375 }
376 376
377 write_stderr(out, "PARAM: %s -> %s\n", hs.nvps[used_nvps].name, hs.nvps[used_nvps].value); 377 //write_stderr(out, "PARAM: %s -> %s\n", hs.nvps[used_nvps].name, hs.nvps[used_nvps].value);
378 378
379 ++used_nvps; 379 ++used_nvps;
380 } 380 }
381 } 381 }
382 382