View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0022260FPCFCLpublic2012-06-13 18:102014-03-04 17:40
ReporterMario Ray Mahardhika 
Assigned ToMichael Van Canneyt 
PrioritynormalSeveritycrashReproducibilitysometimes
StatusclosedResolutionfixed 
PlatformlinuxOSi386OS Version12.04
Product Version2.7.1Product Build21512 
Target Version2.7.1Fixed in Version2.6.4 
Summary0022260: HTTP server application can't deal with a lot of requests
DescriptionI'm continuing my experiment using THTTPServer application, I tried testing the server with httest with this simple script:

CLIENT 2000
_REQ localhost 9000
__GET / HTTP/1.1
__Host: localhost
__
_EXPECT /index/home "HTTP/1.1 200 OK"
_WAIT
END FAILED
END

So basically 2000 requests would be sent to the server at once. This always triggers "Missing HTTP protocol version in request" error which normally comes non-deterministically. The call stack shows:

#0 fpc_raiseexception at :0
0000001 PARSESTARTLINE(0xb7928020, 0x0) at ./src/base/fphttpserver.pp:389
0000002 TFPHTTPCONNECTION__READREQUESTHEADERS(<error reading variable>) at ./src/base/fphttpserver.pp:437
0000003 TFPHTTPCONNECTION__HANDLEREQUEST(<error reading variable>) at ./src/base/fphttpserver.pp:465
0000004 TFPCUSTOMHTTPSERVER__DOCONNECT(0xb7de12c0, 0xb7fd3ce0, <error reading variable>) at ./src/base/fphttpserver.pp:605
0000005 SSOCKETS$_$TSOCKETSERVER_$__$$_DOCONNECT$TSOCKETSTREAM at :0
0000006 RESSTR_$HTTPDEFS_$$_SERRINVALIDREQUESTMETHOD at :0
0000007 SSOCKETS$_$TSOCKETSERVER_$__$$_STARTACCEPTING at :0
0000008 TFPCUSTOMHTTPSERVER__CREATESERVERSOCKET(<error reading variable>) at ./src/base/fphttpserver.pp:622
0000009 TFPCUSTOMHTTPSERVER__SETACTIVE(true, <error reading variable>) at ./src/base/fphttpserver.pp:531
0000010 TFPHTTPSERVERHANDLER__RUN(<error reading variable>) at ./src/base/custhttpapp.pp:267
0000011 TCUSTOMWEBAPPLICATION__DORUN(<error reading variable>) at ./src/base/custweb.pp:635
0000012 CUSTAPP$_$TCUSTOMAPPLICATION_$__$$_RUN at :0
0000013 main at tkd1depok.lpr:51

I hope this could be fixed
Steps To Reproduce1. Create any HTTP Server application in Lazarus
2. Add an action to the (automatically created) webmodule
3. Run the application (better in lazarus, with debug info everywhere)
4. Run httest with above script (adjust the parameters)
5. The exception would occur
Additional InformationI attach my real project where this behavior occurs
TagsNo tags attached.
FPCOldBugId
Fixed in Revision24544
Attached Fileszip file icon tkd1depok.org.zip [^] (54,438 bytes) 2012-06-13 18:10

- Relationships
related to 0024923closedMichael Van Canneyt FCL-Web/HTTPApp: Missing HTTP protocol version in request. 

-  Notes
(0064515)
Michael Van Canneyt (administrator)
2012-12-28 12:41

Fixed.
I added better error handling in case of an unexpected error: there are error handlers at various levels. The default is to log the error to the system log.

In each case the server now continues to serve requests.

Note that you will need also an updated version of fcl-net. (revision 23237)
(0064560)
Mario Ray Mahardhika (reporter)
2012-12-31 17:52

Nice, over 20000 connections with a peak of 8000 concurrent connections (until httest gets segmentation fault) and the server is still alive!
(0073456)
Jonas Maebe (manager)
2014-03-04 17:40

Merged to 2.6.4 in spite of 2.7.1 target version

- Issue History
Date Modified Username Field Change
2012-06-13 18:10 Mario Ray Mahardhika New Issue
2012-06-13 18:10 Mario Ray Mahardhika File Added: tkd1depok.org.zip
2012-06-13 20:26 Jonas Maebe Status new => assigned
2012-06-13 20:26 Jonas Maebe Assigned To => Michael Van Canneyt
2012-12-28 12:41 Michael Van Canneyt Fixed in Revision => 23238
2012-12-28 12:41 Michael Van Canneyt Status assigned => resolved
2012-12-28 12:41 Michael Van Canneyt Fixed in Version => 2.7.1
2012-12-28 12:41 Michael Van Canneyt Resolution open => fixed
2012-12-28 12:41 Michael Van Canneyt Note Added: 0064515
2012-12-28 12:41 Michael Van Canneyt Target Version => 2.7.1
2012-12-31 17:52 Mario Ray Mahardhika Status resolved => closed
2012-12-31 17:52 Mario Ray Mahardhika Note Added: 0064560
2013-08-30 15:39 Michael Van Canneyt Relationship added related to 0024923
2014-03-04 17:40 Jonas Maebe Fixed in Revision 23238 => 24544
2014-03-04 17:40 Jonas Maebe Note Added: 0073456
2014-03-04 17:40 Jonas Maebe Fixed in Version 2.7.1 => 2.6.4



MantisBT 1.2.12[^]
Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker