README: Say GCC 3.2 is needed.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Eduardo Silva <edsiper@gmail.com>
plugins: New plugin: CGI, v2

Updated file check, plus variables http_host, server_software, server_protocol

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Eduardo Silva <edsiper@gmail.com>
sched: We must call epoll_del here to work around kernel behavior

If the fd is not removed from the epoll set, it keeps getting notified and then monkey tries
to close it - and since it now refers to some other file, errors ensue.

This sounds exactly like http://osdir.com/ml/linux-kernel/2009-02/msg10362.html

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Eduardo Silva <edsiper@gmail.com>
utils: Make worker_spawn take the void *argument

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Eduardo Silva <edsiper@gmail.com>
cgi: Use worker_spawn to conserve thread resources (detached)

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Logger: adapt usage of worker_spawn()

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
cgi: set plugin disabled by default

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
cgi: make the plugin OPTIONAL and README updated

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Request: fix possible buffer overflow in Host header

The Host header allow the input of the hostname plus the TCP
port used, e.g:

 GET / HTTP/1.1
 Host: localhost:2001

If the port length was higher than 6 bytes, it make monkey crash
due an overflow in the port buffer.

This patch restrict the port length and also add a validation
to the port value so it just can hold numeric values.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
QA: new host_port_XX.htt scripts

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
iov: Fix initial zeroing of offset entries.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Mimetype: add JSON mimetype

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Palm: remove bad code in the read routine

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
includes: Guard global variables with hidden visibility, v3

This makes every plugin load faster. Each plugin is also 3-4kb smaller.

v2: Fix one goof
v3: Change to attributes.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Eduardo Silva <edsiper@gmail.com>
plugins: Properly control visibility, v2

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Eduardo Silva <edsiper@gmail.com>
plugin: epoll_del is needed here too for stability

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Eduardo Silva <edsiper@gmail.com>
cgi: Update to an event model

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Eduardo Silva <edsiper@gmail.com>
cgi: Some cleanups

Removes unused variable, unneeded argument to do_cgi, some memory leaks,
and one malloc is replaced with a static array.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Eduardo Silva <edsiper@gmail.com>
epoll: print errors just in trace mode

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
conn: if there is no cs, return 0: otherwise it tries to close a closed FD

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Eduardo Silva <edsiper@gmail.com>