Fossil

Diff
Login

Diff

Differences From Artifact [added99d03]:

To Artifact [50f19c61e3]:


409
410
411
412
413
414
415




416
417
418
419
420
421
422
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426







+
+
+
+







**
** zName and zValue are not copied and must not change or be
** deallocated after this routine returns.
*/
void cgi_set_parameter_nocopy(const char *zName, const char *zValue){
  if( nAllocQP<=nUsedQP ){
    nAllocQP = nAllocQP*2 + 10;
    if( nAllocQP>1000 ){
      /* Prevent a DOS service attack against the framework */
      fossil_fatal("Too many query parameters");
    }
    aParamQP = fossil_realloc( aParamQP, nAllocQP*sizeof(aParamQP[0]) );
  }
  aParamQP[nUsedQP].zName = zName;
  aParamQP[nUsedQP].zValue = zValue;
  if( g.fHttpTrace ){
    fprintf(stderr, "# cgi: %s = [%s]\n", zName, zValue);
  }
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1180
1181
1182
1183
1184
1185
1186

1187
1188
1189
1190
1191
1192
1193







-







      /*
      ** x-forwarded-for header is a list of comma-separated addresses, 
      ** with leftmost address corresponding to the client
      */
      while(*p && *p != ',') p++;
      *p = '\0';
      zIpAddr = mprintf( "%s", zVal );
    }
#if 0
    }else if( fossil_strcmp(zFieldName,"referer:")==0 ){
      cgi_setenv("HTTP_REFERER", zVal);
#endif
    }else if( fossil_strcmp(zFieldName,"user-agent:")==0 ){
      cgi_setenv("HTTP_USER_AGENT", zVal);
    }