Ignore:
Timestamp:
2001-04-04T22:37:36+12:00 (23 years ago)
Author:
sjboddie
Message:

In the process of making some changes to the old fnord webserver code.
Note that this version is BROKEN, I just committed it so I could continue
the work I've been doing on my home PC at work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/w32server/cgiwrapper.cpp

    r2212 r2280  
    766766}
    767767
    768 int ExamineURIStr(char *URIStr, RequestInfoT *RequestInfo,
     768int ExamineURIStr(text_t &URIStr, RequestInfoT *RequestInfo,
    769769          RequestFieldsT *RequestFields)
    770770{
    771771  char *protocol, *machine, *rest;  int port;
    772   char URICopyA[MAX_URL_SIZE], URICopyB[MAX_URL_SIZE];
     772  //  char URICopyA[MAX_URL_SIZE], URICopyB[MAX_URL_SIZE];
    773773
    774774  if (RequestFields->ContentLength > 0) {
    775775    // POST data
    776     int len = strlen (URIStr);
     776    URIStr.push_back('?');
     777    URIStr += (char*)RequestFields->Content;
     778
     779    //    int len = strlen (URIStr);
    777780    // fail relatively gracefully (and mysteriously) if POST
    778781    // arguments are too long
    779     if (len + RequestFields->ContentLength + 1 <= MAX_URL_SIZE) {
    780       URIStr[len] = '?'; len ++;
    781       for (int i = 0; i < RequestFields->ContentLength; i++) {
    782     URIStr[len] = RequestFields->Content[i];
    783     len ++;
    784       }
    785       URIStr[len] = '\0';
    786     } else {
    787       MessageBox (NULL, "POST data too long", "Greenstone Digital Library Software", MB_OK);
    788     }
    789   }
    790 
    791   strcpy(URICopyA,URIStr);
     782    //    if (len + RequestFields->ContentLength + 1 <= MAX_URL_SIZE) {
     783    //      URIStr[len] = '?'; len ++;
     784    //      for (int i = 0; i < RequestFields->ContentLength; i++) {
     785    //  URIStr[len] = RequestFields->Content[i];
     786    //  len ++;
     787    //      }
     788    //      URIStr[len] = '\0';
     789    //    } else {
     790    //      MessageBox (NULL, "POST data too long", "Greenstone Digital Library Software", MB_OK);
     791    //    }
     792  }
     793 
     794  char *URICopyA = URIStr.getcstr();
     795  char URICopyB[MAX_URL_SIZE];
     796  char *URICopytmp = URIStr.getcstr();
     797
     798    //  strcpy(URICopyA,URIStr);
    792799 
    793800  if (parse_url(URICopyA,&protocol,&machine,&port,&rest)!=http_ok) {
    794801    /* Alter local file request to address 'gsdl' */
    795     fix_prefix(URICopyB, "http://gsdl", URIStr);
     802    //    fix_prefix(URICopyB, "http://gsdl", URIStr);
     803    fix_prefix(URICopyB, "http://gsdl", URICopytmp);
    796804    URIStr = URICopyB;
    797805    strcpy(URICopyA, URICopyB);
Note: See TracChangeset for help on using the changeset viewer.