Changeset 2286 for trunk/gsdl/src/w32server/httpreq.cpp
- Timestamp:
- 2001-04-05T17:08:52+12:00 (23 years ago)
- 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 20 28 #include "text_t.h" 21 29 #include <windows.h> … … 303 311 if (RequestFields.AcceptStr[0] == '\0') { 304 312 strncpy(RequestFields.AcceptStr, FieldValStr, ReqAcceptStrLen - 1); 305 // if (Len >= ReqAcceptStrLen)306 // if (log_debug) log_message("Accept field truncated");307 313 } 308 314 else { … … 317 323 else if (strcmp("DATE:", FieldNameStr) == 0) { 318 324 strncpy(RequestFields.DateStr, FieldValStr, ReqDateStrLen - 1); 319 // if (Len >= ReqDateStrLen) LogError("Date field truncated");320 325 } 321 326 else if (strcmp("USER-AGENT:", FieldNameStr) == 0) { 322 327 strncpy(RequestFields.UserAgentStr, FieldValStr, ReqUserAgentStrLen - 1); 323 // if (Len >= ReqUserAgentStrLen) {324 // LogError("User Agent field truncated, value follows");325 // LogError(RequestFields.UserAgentStr);326 // }327 328 } 328 329 else if (strcmp("CONNECTION:", FieldNameStr) == 0) { 329 330 strncpy(RequestFields.ConnectionStr, FieldValStr, ReqConnectionStrLen - 1); 330 // if (Len >= ReqConnectionStrLen) LogError("Connection field truncated");331 331 } 332 332 //--Sometimes-- 333 333 else if (strcmp("ACCEPT-LANGUAGE:", FieldNameStr) == 0) { 334 334 strncpy(RequestFields.AcceptLangStr, FieldValStr, ReqAcceptLangStrLen - 1); 335 // if (Len >= ReqAcceptLangStrLen) LogError("Accept-Language field truncated");336 335 } 337 336 else if (strcmp("REFERER:", FieldNameStr) == 0) { 338 337 strncpy(RequestFields.RefererStr, FieldValStr, ReqRefererStrLen - 1); 339 // if (Len >= ReqRefererStrLen) LogError("Referer field truncated");340 338 } 341 339 else if (strcmp("IF-MODIFIED-SINCE:", FieldNameStr) == 0) { 342 340 strncpy(RequestFields.IfModSinceStr, FieldValStr, ReqIfModSinceStrLen - 1); 343 // if (Len >= ReqIfModSinceStrLen) LogError("If Modified Since field truncated");344 341 } 345 342 //--Uncommon-- 346 343 else if (strcmp("FROM:", FieldNameStr) == 0) { 347 344 strncpy(RequestFields.FromStr, FieldValStr, ReqFromStrLen - 1); 348 // if (Len >= ReqFromStrLen) LogError("From field truncated");349 345 } 350 346 else if (strcmp("MIME-VERSION:", FieldNameStr) == 0) { 351 347 strncpy(RequestFields.MIMEVerStr, FieldValStr, ReqMIMEVerStrLen - 1); 352 // if (Len >= ReqMIMEVerStrLen) LogError("MIME Version field truncated");353 348 } 354 349 else if (strcmp("PRAGMA:", FieldNameStr) == 0) { 355 350 strncpy(RequestFields.PragmaStr, FieldValStr, ReqPragmaStrLen - 1); 356 // if (Len >= ReqPragmaStrLen) LogError("Pragma field truncated");357 351 } 358 352 //--Special case-- 359 353 else if (strcmp("AUTHORIZATION:", FieldNameStr) == 0) { 360 354 strncpy(RequestFields.AuthorizationStr, FieldValStr, ReqAuthorizationStrLen - 1); 361 // if (Len >= ReqAuthorizationStrLen) LogError("Authorization field truncated");362 355 } 363 356 else if (strcmp("CONTENT-LENGTH:", FieldNameStr) == 0) { 364 357 strncpy(RequestFields.ContentLengthStr, FieldValStr, ReqContentLengthStrLen - 1); 365 // if (Len >= ReqContentLengthStrLen) LogError("Content Length field truncated");366 358 } 367 359 else if (strcmp("CONTENT-TYPE:", FieldNameStr) == 0) { 368 360 strncpy(RequestFields.ContentTypeStr, FieldValStr, ReqContentTypeStrLen - 1); 369 // if (Len >= ReqContentTypeStrLen) LogError("Content Type field truncated");370 361 } 371 362 else if (strcmp("CONTENT-ENCODING:", FieldNameStr) == 0) { 372 363 strncpy(RequestFields.ContentEncodingStr, FieldValStr, ReqContentEncodingStrLen - 1); 373 // if (Len >= ReqContentEncodingStrLen) LogError("Content Encoding field truncated");374 364 } 375 365 else { … … 390 380 } 391 381 392 393 382 if (RequestFields.ContentLengthStr[0] != 0) { //Do we have attached data? 394 383 unsigned int NumRecv; … … 396 385 RequestFields.ContentLength = atol(RequestFields.ContentLengthStr); 397 386 if (RequestFields.ContentLength > 0) { 398 // ThreadDebugMessage(RequestInfo.ThreadNum, "Getting content");399 387 400 388 //Allocate memory
Note:
See TracChangeset
for help on using the changeset viewer.