]> granicus.if.org Git - libevent/commit
http: improve error path for bufferevent_{setfd,enable,disable}()
authorAzat Khuzhin <a3at.mail@gmail.com>
Tue, 13 Nov 2018 21:20:20 +0000 (00:20 +0300)
committerAzat Khuzhin <azat@libevent.org>
Sat, 2 Feb 2019 12:18:04 +0000 (15:18 +0300)
commita8cc449ed21b29b52c801b3354d6e03613eba8fd
treed345df8f71e059d6be47dd487d5e69f0fe4bbff9
parent241780bdde7f6d03bcf8cd5dcf0738c35cc5a4c6
http: improve error path for bufferevent_{setfd,enable,disable}()

We have calls to the next functions but do not check return values,
though they can be invalid and it is better to show this somehow.

Also do bufferevent_setfd() first and only after it
bufferevent_enable()/bufferevent_disable() since:
a) it is more natural
b) it will avoid extra operations
c) it will not fail first bufferevent_enable() (this is the case for
   buffbufferevent_async at least)

In this case we could add more information for issues like #709

(cherry picked from commit b98d32d0c90864ff60bc689f3bcf738af58ca79c)
http.c