Skip to content
Commits on Jun 19, 2016
  1. @azat

    buffer: Merge branch 'evbuffer-empty-chains-fixes-v4'

    This fixes bug with empty-chains and
    evbuffer_add_buffer()/evbuffer_remove_buffer().
    
    * evbuffer-empty-chains-fixes-v4:
      buffer: evbuffer_add_buffer(): clean empty chains from destination buffer
      test/buffer: evbuffer_add_buffer() with empty chains
      test/buffer: evbuffer_remove_buffer() with empty chains (prepend)
      test/buffer: evbuffer_remove_buffer() with empty chains (evbuffer_add_buffer())
    
    Reported-by: Eduardo Panisset <eduardo@anchorfree.com>
    azat committed Jun 19, 2016
  2. @azat

    bufferevent_filter: Merge branch 'be-filter-data-stuck'

    Fixes data stuck in filters with active watermarks.
    
    * be-filter-data-stuck:
      test/be_filter: creating test case for data stuck with active watermarks
      be_filter: avoid data stuck under active watermarks
    azat committed Jun 19, 2016
  3. @azat

    test/be_filter: creating test case for data stuck with active watermarks

    v2: fix whitespaces
        s/int/size_t/
        use tt_int_op()
        s/malloc/calloc (to avoid possible false-positive)
    Eduardo Panisset committed with azat Jun 19, 2016
  4. @azat

    be_filter: avoid data stuck under active watermarks

    Suppose we have bufferevent filter attached to bufferevent socket.
    Read high watermark for bufferevent filter is configured to 4096 bytes.
    Socket receives 4343 bytes. Due to watermark, 4096 bytes are transferred
    from socket input buffer to filter input buffer and 247 bytes are left
    in bufferevent socket.
    Suppose that no more data is received through socket.
    
    At this point 247 bytes will sit forever in input buffer of bufferevent
    socket.
    The patch attached solves this issue registering read callback to
    filter's input buffer if it reaches its read high water mark and data
    was left in corresponding underlying's input buffer.
    
    This read callback calls filter process input function as soon as filter
    input buffer falls below its read high watermark and there still is data
    left in underlying input buffer. Callback is deregistered as soon as
    filter input buffer falls below its read high watermark.
    Eduardo Panisset committed with azat Jun 17, 2016
Commits on Jun 17, 2016
  1. @dpassage @azat

    Fix bufferevent_pair to properly set BEV_EVENT_{READING,WRITING} on f…

    …lush.
    
    Here's some fun. From `bufferevent.h`:
      ```
      #define BEV_EVENT_READING	0x01	/**< error encountered while reading */
      #define BEV_EVENT_WRITING	0x02	/**< error encountered while writing */
      ```
    
    And from `event.h`:
      ```
      /** Wait for a socket or FD to become readable */
      #define EV_READ		0x02
      /** Wait for a socket or FD to become writeable */
      #define EV_WRITE	0x04
      ```
    
    Library users have to be very careful to get this right; it turns out, the
    library itself got this wrong in the `bufferevent_pair` code. It appears that
    in most of the code, only `BEV_EVENT_FINISHED` will indicate whether it's read
    or write; on error or timeout, it appears that "both" is assumed and not set in
    the callback. I read through all the other places where `BEV_EVENT_FINISHED` is
    passed to an event callback; it appears that the pair code is the only spot
    that got it wrong.
    
    azat: add TT_FORK to avoid breaking clean env, and rebase commit message
    (copied from #359)
    Fixes: #359
    dpassage committed with azat May 21, 2016
  2. @azat

    buffer: evbuffer_add_buffer(): clean empty chains from destination bu…

    …ffer
    
    
    @EMPanisset reported a problem (#358) with evbuffer_remove_buffer(), but
    actually I think that the problem is in evbuffer_add_buffer() which introduces
    this empty chain, all other callers (except evbuffer_prepend_buffer(), but it
    doesn't have this problem though) should be safe.
    
    And FWIW the only API that allows empty chains is evbuffer_add_reference(), and
    we can add check there to avoid such issues, but for now I leaved this without
    fixing, since I think that evbuffer_add_reference() with empty chains can be
    used as a barrier (but this can be tricky).
    
    Fixes: regress evbuffer/remove_buffer_with_empty2
    v2: introduce/fixes evbuffer/add_buffer_with_empty
    azat committed Jun 7, 2016
  3. @azat
  4. @azat

    test/buffer: evbuffer_remove_buffer() with empty chains (prepend)

    Using:
    - evbuffer_add()
    - evbuffer_prepend_buffer()
    - evbuffer_add_reference()
    - evbuffer_remove_buffer()
    azat committed Jun 8, 2016
  5. @azat

    test/buffer: evbuffer_remove_buffer() with empty chains (evbuffer_add…

    …_buffer())
    
    Using:
    - evbuffer_add()
    - evbuffer_add_buffer() -- the one that has problem
    - evbuffer_add_reference() -- the only one that allows empty chains to be added
    - evbuffer_remove_buffer()
    azat committed Jun 7, 2016
  6. @azat

    test/http: avoid using conditionals with omitted operands (fixes VS2015)

    But we need to add VS2015 build on appveyor.
    
    Fixes: #361
    Reported-by: @nntrab
    azat committed Jun 17, 2016
  7. @azat
  8. @azat
  9. @azat
Commits on Jun 8, 2016
  1. @hpcraink @azat
Commits on May 11, 2016
  1. @azat

    Merge branch 'travis-ci-os-matrix-v2'

    This increases libevent coverage to:
    - os:osx
    
    - cmake -DEVENT__DISABLE_MM_REPLACEMENT=ON
    - cmake -DEVENT__ENABLE_VERBOSE_DEBUG=ON
    - configure --disable-openssl
    - configure --disable-thread-support
    - configure --disable-malloc-replacement
    
    - fix travis-ci builds under automake >1.11
    
    Possible failures after this patch set (not always, IOW in some builds this
    issues aren't real issues):
    - some failures but mostly because of timing issues, must be fixed separately.
    - https://travis-ci.org/azat/libevent/jobs/129430229 # on brew update
    - https://travis-ci.org/azat/libevent/jobs/129430221 # some locking issues
    
    * travis-ci-os-matrix-v2:
      automake: define serial-tests only if automake have this option
      test/automake: don't use paralell test harness (since automake 1.12)
      travis-ci/osx: relink gcc/g++ instead of clang
      travis-ci: enable multi-os mode (osx, linux)
      travis-ci: increase matrix (--disable-foo)
      travis-ci: adjust alignment
    
    Fixes: #356
    Travis-CI: https://travis-ci.org/azat/libevent/builds/129430181
    azat committed May 12, 2016
  2. @azat

    automake: define serial-tests only if automake have this option

    P.S. I did try a lot of other ways, but seems that this is the only one that
    will work.
    
    Fixes: automake 1.11
    Travis-CI: https://travis-ci.org/azat/libevent/jobs/129398265
    azat committed May 11, 2016
  3. @azat

    test/automake: don't use paralell test harness (since automake 1.12)

    Starting from automake 1.2 there is parallel test harness, that redirects all
    output to some log, which serial-test doesn't do.
    So in case of new runner we can get no output for 10 minutes, for example on my
    desktop:
      $ time make verify VERBOSE=1
      PASS: test/test-script.sh
      ============================================================================
      Testsuite summary for libevent 2.1.5-beta
      ============================================================================
      # TOTAL: 1
      # PASS:  1
      # SKIP:  0
      # XFAIL: 0
      # FAIL:  0
      # XPASS: 0
      # ERROR: 0
      ============================================================================
    
      real    25m31.735s
      user    0m13.753s
      sys     0m7.648s
    
    And this means that this will fail on travis-ci, since it has timeout for 10
    minutes. Sure we can use `travis wait 60` instead, but I think that it is
    better to fix this by writing result to output, instead of hacking around, so
    let's use serial-tests instead of parallel always.
    And now it works on travis-ci under linux because it has automake 1.11 while
    osx has at least 1.12.
    
    Links:
    https://docs.travis-ci.com/user/common-build-problems/
    https://www.gnu.org/software/automake/manual/html_node/Serial-Test-Harness.html#Serial-Test-Harness
    https://www.gnu.org/software/automake/manual/html_node/Parallel-Test-Harness.html
    
    CI:
    https://travis-ci.org/azat/libevent/jobs/129171497 # ok on linux
    https://travis-ci.org/azat/libevent/jobs/129171532 # no output for 10 min on osx
    azat committed May 11, 2016
Commits on May 10, 2016
  1. @azat

    travis-ci/osx: relink gcc/g++ instead of clang

    Since by default osx replaces /usr/bin/gcc with it's apple clang, while we have
    gcc in our build matrix, so use real gcc.
    azat committed May 10, 2016
  2. @azat

    travis-ci: enable multi-os mode (osx, linux)

    - use addons.apt.packages instead of `apt-get install`
    - add `brew update`/`brew install ...`
    
    Link: https://docs.travis-ci.com/user/installing-dependencies/
    Link: https://docs.travis-ci.com/user/multi-os/
    azat committed May 9, 2016
Commits on May 9, 2016
  1. @azat
  2. @azat

    travis-ci: adjust alignment

    azat committed May 9, 2016
Commits on May 2, 2016
  1. @azat

    be_openssl: clear all pending errors before SSL_*() calls

    Refs: #350
    Reported-by: @CapSel
    azat committed May 2, 2016
Commits on Apr 20, 2016
  1. @azat

    Ignore all pkgconfig generated stuff

    In the referenced commit new *.pc added, and I think it is better to ignore
    them all.
    
    Refs: b8d7c62 ("libevent_core and
    libevent_extra also deserve a pkgconfig file")
    azat committed Apr 21, 2016
  2. @azat

    test/buffer: cover n_add_for_cb when evbuffer_prepend() need to alloc…

    …ate buffer
    
    Regression-for: 0abd039 ("Fix n_add_for_cb in
    evbuffer_prepend() in case of new buffer required")
    azat committed Apr 21, 2016
  3. @azat
  4. @azat

    Fix n_add_for_cb in evbuffer_prepend() in case of new buffer required

    Signed-off-by: @luoming1224
    Fixes: #349
    azat committed Apr 21, 2016
Commits on Apr 18, 2016
  1. @azat

    Merge branch 'be-filter-outputcb-disable-during-execution'

    * be-filter-outputcb-disable-during-execution:
      test/bufferevent: check that output_filter disabled during processing output
      be_filter: actually disable output_filter during processing output
    azat committed Apr 18, 2016
  2. @azat

    test/bufferevent: check that output_filter disabled during processing…

    … output
    
    Regression-for: c031215 ("be_filter: actually
    disable output_filter during processing output")
    azat committed Apr 18, 2016
  3. @simon-jive @azat

    be_filter: actually disable output_filter during processing output

    IOW: Make the code do what the comment says it should do.
    simon-jive committed with azat Feb 28, 2016
Commits on Mar 31, 2016
  1. @azat

    listener: unlock lev on error in listener_read_cb()

    Without this patch:
      $ regress --no-fork +listener/error_unlock
      listener/error_unlock: [warn] Error from accept() call: Too many open files
      [err] ../evthread.c:220: Assertion lock->count == 0 failed in ../evthread.c
      Aborted (core dumped)
    
    Fixes: #341
    Fixes: listener/error_unlock
    azat committed Mar 31, 2016
  2. @azat

    test/listener: regression for missing unlock in listener_read_cb()

    P.S. it triggers even without pthread, but this makes checks more strict.
    
    Refs: #341
    azat committed Mar 31, 2016
Commits on Mar 29, 2016
  1. @azat

    Merge remote-tracking branch 'origin/pr/339'

    * origin/pr/339:
      evbuffer_add: Use last_with_datap if set, not last.
      test/regress: add tests for evbuffer_add() breakage on empty last chain
    
    Fixes: #335
    azat committed Mar 29, 2016
Commits on Mar 26, 2016
  1. @adamel

    evbuffer_add: Use last_with_datap if set, not last.

    evbuffer_add() would always put data in the last chain, even if there
    was available space in a previous chain, and in doing so it also
    failed to update last_with_datap, causing subsequent calls to other
    functions that do look at last_with_datap to add data in the middle
    of the evbuffer instead of at the end.
    
    Fixes the evbuffer_add() part of issue #335, and the evbuffer/add2 and
    evbuffer/add3 tests, and also prevents wasting space available in the
    chain pointed to by last_with_datap.
    adamel committed Mar 26, 2016
  2. @adamel

    test/regress: add tests for evbuffer_add() breakage on empty last chain

    The evbuffer/add* tests currenly break on 2.0.21, 2.0.22 and 2.1 HEAD
    due to issue #335. The evbuffer/reference2 test breaks on 2.0.21 and
    2.0.22 due to commit b18c04d not being applied.
    adamel committed Mar 26, 2016
Something went wrong with that request. Please try again.