williame / hellepoll Goto Github PK
View Code? Open in Web Editor NEWA blazingly-fast async HTTP server written in C++
License: Other
A blazingly-fast async HTTP server written in C++
License: Other
Chrome throws an error if out_encoding_chunked isn't set to false all the time.
The same thing happens with curl.
This is what happens with and without the Content Length.
Hey.
I just wanted to report that epoll is not supported under OS X:
http://stackoverflow.com/questions/13856413/does-os-x-not-support-epoll-function
I figured when I got the compiler error, about the file not being found
$ make
g++ -g3 -Wall -O0 -c helloworld.cpp -MD -MF helloworld.dep -o helloworld.opp
In file included from helloworld.cpp:5:
In file included from ./listener.hpp:7:
./task.hpp:13:10: fatal error: 'sys/epoll.h' file not found
#include <sys/epoll.h>
^
1 error generated.
make: *** [helloworld.opp] Error 1
Kind regards :3
this is really promising a simple solution. its right up there with nginx in terms of speed. in fact, a touch faster given its simplicity.
the following output came out a few times. unsure of the exact correlation with clients, number of clients, etc.
Listener[HTTP@42042] end of stream
This following output came out continuously when load testing with over 1,000 clients
Listener[HTTP@42042] internal error: not enough FDs
this seems more likely the listen queue (backlog) since helloworld isnt reading a file..
Changed
Listener::create(scheduler,"HTTP",port,HelloWorld::factory,100,true);
to
Listener::create(scheduler,"HTTP",port,HelloWorld::factory,100,true);
unfortunately with the same results.
im thinking it might be sysctl configurations.
void HttpServerConnection::writef(const char* fmt,...) {
va_list ap;
va_start(ap,fmt);
char buf[1024];
int len = vsnprintf(buf,sizeof(buf),fmt,ap);
if(!len) return;
check(len);
if(len == sizeof(buf)) { // overflowed?
char* s;
len = vasprintf(&s,fmt,ap);
check(len);
write(s,len);
} else
write(buf,len);
va_end(ap);
}
This will overflow due lack of boundary check
you'd want to change this line if(!len) return;
to if(!len || len >= sizeof(buf) return;
and change this if(len == sizeof(buf))
to if(len) {...}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.