Commit Graph

33 Commits (27ab3f76dbedbb48cfb84e1bfc61e403f0a2c851)

Author SHA1 Message Date
Stefan Bühler 593599f14a rewrite network (write) backends
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3012 152afb58-edef-0310-8abb-c4023f1b3aa9
2015-08-22 16:00:59 +00:00
Stefan Bühler ad3e93ea96 Use buffer API to read and modify "used" member
- a lot of code tried to handle manually adding terminating zeroes and
  keeping track of the correct "used" count.
  Replaced all "external" usages with simple wrapper functions:
  * buffer_string_is_empty (used <= 1), buffer_is_empty (used == 0);
    prefer buffer_string_is_empty
  * buffer_string_set_length
  * buffer_string_length
  * CONST_BUF_LEN() macro
- removed "static" buffer hacks (buffers pointing to constant/stack
  memory instead of malloc()ed data)
- buffer_append_strftime(): refactor buffer+strftime uses
- li_tohex(): no need for a buffer for binary-to-hex conversion:
  the output data length is easy to predict
- remove "-Winline" from extra warnings: the "inline" keyword just
  supresses the warning about unused but defined (static) functions;
  don't care whether it actually gets inlined or not.

From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2979 152afb58-edef-0310-8abb-c4023f1b3aa9
2015-02-08 19:10:44 +00:00
Stefan Bühler b106513e58 [network] check return value of lseek()
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2953 152afb58-edef-0310-8abb-c4023f1b3aa9
2014-02-16 13:08:32 +00:00
Stefan Bühler 07dd0bd0a5 add force_assert() to enforce assertions as simple assert()s are disabled by -DNDEBUG (fixes #2546)
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2948 152afb58-edef-0310-8abb-c4023f1b3aa9
2014-02-16 13:08:20 +00:00
Stefan Bühler 6d4d2118c3 [ssl] accept ssl renegotiations if they are not disabled (fixes #2491)
* don't fiddle with ssl internals
 * renegotiations should be safe with recent openssl versions,
   openssl itself should reject unsafe renegotiations

From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2890 152afb58-edef-0310-8abb-c4023f1b3aa9
2013-08-30 13:14:48 +00:00
Stefan Bühler 38e3e4a65a [ssl] fix ssl connection aborts if files are larger than the MAX_WRITE_LIMIT (256kb)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2813 152afb58-edef-0310-8abb-c4023f1b3aa9
2011-12-05 17:08:17 +00:00
Stefan Bühler a94bdd07df [ssl] count renegotiations to prevent client renegotiations
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2808 152afb58-edef-0310-8abb-c4023f1b3aa9
2011-11-30 18:40:08 +00:00
Stefan Bühler f434d514ad Limit amount of bytes we send in one go; fixes stalling in one connection and timeouts on slow systems.
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2801 152afb58-edef-0310-8abb-c4023f1b3aa9
2011-08-22 15:12:28 +00:00
Stefan Bühler 22e8b456a9 Fix header inclusion order, always include "config.h" before any system header
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2624 152afb58-edef-0310-8abb-c4023f1b3aa9
2009-10-11 14:31:42 +00:00
Stefan Bühler 2b46e3dacc Fix #285 again: read error after SSL_shutdown (thx marton.illes@balabit.com) and clear the error queue before some other calls
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2136 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-03-26 11:51:06 +00:00
Stefan Bühler ad722324d9 r2089@chromobil: stefan | 2008-02-26 17:02:46 +0100
Fix #285: Remove workaround for buggy Opera version with ssl/chunked encoding.
 
  - The workaround may lead to a realloc, but the memory address for a repeated SSL_write must not change.


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2084 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-02-26 16:20:26 +00:00
Jan Kneschke b719752a6c handle ECONNRESET in the openssl backend
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2066 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-01-28 07:02:11 +00:00
Jan Kneschke 9d6da0d16c handle ECONNRESET as write-error()
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2063 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-01-27 16:57:43 +00:00
Marcus Rückert 8cd1471cb3 - white space cleanup part 2 this time 1.4 ;)
i hope it helps with merging stuff back to 1.5

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1371 152afb58-edef-0310-8abb-c4023f1b3aa9
2006-10-04 13:26:23 +00:00
Jan Kneschke 85775e6a5e removed debug info
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.11-ssl-fixes@1323 152afb58-edef-0310-8abb-c4023f1b3aa9
2006-09-21 08:03:15 +00:00
Jan Kneschke 2721197ff6 workaround a hanging ssl-connections in Opera 9.01 and 8.54 (and earlier) if chunked-encoding is used
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.11-ssl-fixes@1315 152afb58-edef-0310-8abb-c4023f1b3aa9
2006-09-18 16:41:43 +00:00
Jan Kneschke 28f6aa9ba8 skip empty buffers
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.11-ssl-fixes@1272 152afb58-edef-0310-8abb-c4023f1b3aa9
2006-09-01 09:51:51 +00:00
Jan Kneschke f0583d8b73 fixed unsigned compare
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@851 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-11-17 12:53:44 +00:00
Jan Kneschke 3888c10357 handle missing SSL-close-notify if keep-alive is disabled (fixed #311)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@803 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-10-31 08:44:54 +00:00
Jan Kneschke c87a000c13 renamed file.offset to file.start (we had 3 different 'offset' which was confusing)
added a offset tag to the mmap part of the file-struct to allow moving mmap-windows




git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@795 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-10-24 11:36:22 +00:00
Jan Kneschke ff29203dba close fds on error and add CLOEXEC to FDs which stay open for a longer time
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@794 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-10-22 08:10:07 +00:00
Jan Kneschke c949273aa4 clean the error-queue is case we have a read/write error
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@789 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-10-15 14:29:51 +00:00
Jan Kneschke bd893badb9 added the fd as parameter for the write() functions
- the plugins can use them now too


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@737 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-09-26 08:52:37 +00:00
Jan Kneschke b32a18b1e8 updated cq->written and con->bytes_written correctly
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@728 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-09-22 09:08:06 +00:00
Jan Kneschke 88c96e46a0 stipped data. from chunk structure (belongs to the last changeset)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@704 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-09-14 10:43:00 +00:00
Jan Kneschke d00bb524f7 improve error-reporting (should fixed the Success 5 0 0 messages)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@693 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-09-08 09:55:23 +00:00
Jan Kneschke e93ac5407b if the write is waiting, break the loop.
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@621 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-25 06:21:32 +00:00
Jan Kneschke 632703d7ae we can't use mmap() with SSL_write as we don't have guarantee that
after a SSL_ERROR_WANT_WRITE we get the same mmap()ed address as
start pointer. On OpenBSD the start-address is completly random.

Using a local sendbuffer solves this problem.


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@607 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-22 10:43:26 +00:00
Jan Kneschke 5e134da075 dropped file-cache, added stat-cache and modules ALWAYS cleanup at connection-end
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@502 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-08 08:22:06 +00:00
Jan Kneschke 068152996b handle EPIPE in SSL_read as remote-close
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@85 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-03-03 17:35:46 +00:00
Jan Kneschke 1956311750 check errno on SSL_ERROR_SYSCALL
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@83 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-03-03 17:17:18 +00:00
Jan Kneschke af3ddde684 handle remote shutdown correctly
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@82 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-03-03 16:59:36 +00:00
Jan Kneschke bcdc6a3bbc moved everything below trunk/ and added branches/ and tags/
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@30 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-02-20 14:27:00 +00:00