Project

General

Profile

Actions

Bug #2580

closed

connections.c can reset is_readable too soon

Added by joshuahoke almost 10 years ago. Updated over 7 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
-
ASK QUESTIONS IN Forums:

Description

This is a minor inefficiency, but in 1.4.x src/connections.c may sometimes reset is_readable on a false positive:

        } else if ((size_t)len < b->size - 1) {
                /* we got less then expected, wait for the next fd-event */

                con->is_readable = 0;
        }

The actual recv/read calls ask for

b->size - 1 - read_offset
bytes, so this could reset the readable flag with any amount of data left in the OS buffer, even much more than read_offset. On Linux this doesn't appear to be a big problem since epoll is used in level-triggered mode and will cause another fd-event on the next main loop, but it doesn't seem to be entirely correct either.


Files

Actions #1

Updated by stbuehler almost 10 years ago

  • Status changed from New to Wontfix
  • Target version deleted (1.4.x)

Hi!

I'm working on a API cleanup series (http://git.lighttpd.net/lighttpd/lighttpd-1.x.git/log/?h=lighttpd-1.4.x-stbuehler-api-cleanup) which also fixes this issue.

I don't think this is important enough to get fixed on its own now.

Actions #2

Updated by gstrauss almost 8 years ago

  • Status changed from Wontfix to Fixed
  • Target version set to 1.4.x

Fixed in 1.4.36

commit 1be163b44a53eebb0a7b0ed562d12e3f252794e1
Author: Stefan Bühler <stbuehler@web.de>
Date:   Sun Feb 8 19:10:36 2015 +0000

    git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2976 152afb58-edef-0310-8abb-c4023f1b3aa9
Actions #3

Updated by stbuehler over 7 years ago

  • Target version deleted (1.4.x)
Actions

Also available in: Atom