Ignore:
Timestamp:
2001-04-05T17:08:52+12:00 (23 years ago)
Author:
sjboddie
Message:

Had a bit of a tidy up in the fnord webserver code. The main change of note
was the removal of our reliance on the MAX_URL_SIZE constant. URLs and post
data of any length should now work.

File:
1 edited

Legend:

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

    r2280 r2286  
    1 /*
    2 Copyright (C) 1996
    3 
    4 This program is free software; you can redistribute it and/or modify
    5 it under the terms of the GNU General Public License as published by
    6 the Free Software Foundation; either version 2 of the License, or
    7 (at your option) any later version.
    8 
    9 This program is distributed in the hope that it will be useful,
    10 but WITHOUT ANY WARRANTY; without even the implied warranty of
    11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    12 GNU General Public License for more details.
    13 
    14 You should have received a copy of the GNU General Public License
    15 along with this program; if not, write to the Free Software
    16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    17 
    18 The author can be contacted via Email at [email protected]
    19 */
     1/**********************************************************************
     2 *
     3 * httpreq.cpp
     4 * Copyright (C) 1996
     5 *
     6 * A component of the fnord webserver written by [email protected].
     7 *
     8 * Altered for use with the Greenstone digital library software by the
     9 * New Zealand Digital Library Project at the University of Waikato,
     10 * New Zealand.
     11 *
     12 * This program is free software; you can redistribute it and/or modify
     13 * it under the terms of the GNU General Public License as published by
     14 * the Free Software Foundation; either version 2 of the License, or
     15 * (at your option) any later version.
     16 *
     17 * This program is distributed in the hope that it will be useful,
     18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     20 * GNU General Public License for more details.
     21 *
     22 * You should have received a copy of the GNU General Public License
     23 * along with this program; if not, write to the Free Software
     24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     25 *
     26 *********************************************************************/
     27
    2028#include "text_t.h"
    2129#include <windows.h>
     
    303311      if (RequestFields.AcceptStr[0] == '\0') {
    304312        strncpy(RequestFields.AcceptStr, FieldValStr, ReqAcceptStrLen - 1);
    305     //          if (Len >= ReqAcceptStrLen)
    306     //        if (log_debug) log_message("Accept field truncated");
    307313      }
    308314      else {
     
    317323    else if (strcmp("DATE:", FieldNameStr) == 0) {
    318324      strncpy(RequestFields.DateStr, FieldValStr, ReqDateStrLen - 1);
    319       //            if (Len >= ReqDateStrLen) LogError("Date field truncated");
    320325    }
    321326    else if (strcmp("USER-AGENT:", FieldNameStr) == 0) {
    322327      strncpy(RequestFields.UserAgentStr, FieldValStr, ReqUserAgentStrLen - 1);
    323       //            if (Len >= ReqUserAgentStrLen) {
    324       //            LogError("User Agent field truncated, value follows");
    325       //            LogError(RequestFields.UserAgentStr);
    326       //            }
    327328    }
    328329    else if (strcmp("CONNECTION:", FieldNameStr) == 0) {
    329330      strncpy(RequestFields.ConnectionStr, FieldValStr, ReqConnectionStrLen - 1);
    330       //            if (Len >= ReqConnectionStrLen) LogError("Connection field truncated");
    331331    }
    332332    //--Sometimes--
    333333    else if (strcmp("ACCEPT-LANGUAGE:", FieldNameStr) == 0) {
    334334      strncpy(RequestFields.AcceptLangStr, FieldValStr, ReqAcceptLangStrLen - 1);
    335       //            if (Len >= ReqAcceptLangStrLen) LogError("Accept-Language field truncated");
    336335    }
    337336    else if (strcmp("REFERER:", FieldNameStr) == 0) {
    338337      strncpy(RequestFields.RefererStr, FieldValStr, ReqRefererStrLen - 1);
    339       //            if (Len >= ReqRefererStrLen) LogError("Referer field truncated");
    340338    }
    341339    else if (strcmp("IF-MODIFIED-SINCE:", FieldNameStr) == 0) {
    342340      strncpy(RequestFields.IfModSinceStr, FieldValStr, ReqIfModSinceStrLen - 1);
    343       //            if (Len >= ReqIfModSinceStrLen) LogError("If Modified Since field truncated");
    344341    }
    345342    //--Uncommon--
    346343    else if (strcmp("FROM:", FieldNameStr) == 0) {
    347344      strncpy(RequestFields.FromStr, FieldValStr, ReqFromStrLen - 1);
    348       //            if (Len >= ReqFromStrLen) LogError("From field truncated");
    349345    }
    350346    else if (strcmp("MIME-VERSION:", FieldNameStr) == 0) {
    351347      strncpy(RequestFields.MIMEVerStr, FieldValStr, ReqMIMEVerStrLen - 1);
    352       //            if (Len >= ReqMIMEVerStrLen) LogError("MIME Version field truncated");
    353348    }
    354349    else if (strcmp("PRAGMA:", FieldNameStr) == 0) {
    355350      strncpy(RequestFields.PragmaStr, FieldValStr, ReqPragmaStrLen - 1);
    356       //            if (Len >= ReqPragmaStrLen) LogError("Pragma field truncated");
    357351    }
    358352    //--Special case--
    359353    else if (strcmp("AUTHORIZATION:", FieldNameStr) == 0) {
    360354      strncpy(RequestFields.AuthorizationStr, FieldValStr, ReqAuthorizationStrLen - 1);
    361       //            if (Len >= ReqAuthorizationStrLen) LogError("Authorization field truncated");
    362355    }
    363356    else if (strcmp("CONTENT-LENGTH:", FieldNameStr) == 0) {
    364357      strncpy(RequestFields.ContentLengthStr, FieldValStr, ReqContentLengthStrLen - 1);
    365       //            if (Len >= ReqContentLengthStrLen) LogError("Content Length field truncated");
    366358    }
    367359    else if (strcmp("CONTENT-TYPE:", FieldNameStr) == 0) {
    368360      strncpy(RequestFields.ContentTypeStr, FieldValStr, ReqContentTypeStrLen - 1);
    369       //            if (Len >= ReqContentTypeStrLen) LogError("Content Type field truncated");
    370361    }
    371362    else if (strcmp("CONTENT-ENCODING:", FieldNameStr) == 0) {
    372363      strncpy(RequestFields.ContentEncodingStr, FieldValStr, ReqContentEncodingStrLen - 1);
    373       //            if (Len >= ReqContentEncodingStrLen) LogError("Content Encoding field truncated");
    374364    }
    375365    else {
     
    390380  }
    391381 
    392  
    393382  if (RequestFields.ContentLengthStr[0] != 0) { //Do we have attached data?
    394383    unsigned int NumRecv;
     
    396385    RequestFields.ContentLength = atol(RequestFields.ContentLengthStr);
    397386    if (RequestFields.ContentLength > 0) {
    398       //            ThreadDebugMessage(RequestInfo.ThreadNum, "Getting content");
    399387     
    400388      //Allocate memory
Note: See TracChangeset for help on using the changeset viewer.