History log of /libevent-2.1.12/http.c (Results 1 – 25 of 401)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release-2.2.1-alpha, release-2.1.12-stable
# 97e28f09 25-Jun-2020 Azat Khuzhin <[email protected]>

Check error code of evhttp_add_header_internal() in evhttp_parse_query_impl()

(cherry picked from commit 4528d8e98781be794cbce13394f8442dd466684b)


# 1be25938 19-May-2020 Azat Khuzhin <[email protected]>

http: fix EVHTTP_CON_AUTOFREE in case of timeout (and some else)

Refs: #182
(cherry picked from commit eee26deed38fc7a6b6780b54628b007a2810efcd)


# e2424229 12-Jan-2020 Azat Khuzhin <[email protected]>

Merge branch 'http-connect'

After this patchset http-connect works with pproxy [1]:

$ pproxy -l http://:8000/ -vvv &
$ http-connect //127.1:8000 http://kernel.org:80/

[1]: https://pypi.o

Merge branch 'http-connect'

After this patchset http-connect works with pproxy [1]:

$ pproxy -l http://:8000/ -vvv &
$ http-connect //127.1:8000 http://kernel.org:80/

[1]: https://pypi.org/project/pproxy/

* http-connect:
http-connect: do not check connection on GET cb
http-connect: set Host header (for CONNECT and GET) (like curl)
http-connect: cleanup and helpers
http: do not close connection for CONNECT
http: do not assume body for CONNECT

Fixes: #946
(cherry picked from commit 462f2e97660cc2b6af563ab631050a83c3e0935b)

show more ...


# 1b42270b 12-Jan-2020 Azat Khuzhin <[email protected]>

http: do not assume body for CONNECT

(cherry picked from commit 998e68340e5cd289a16f340cc5c625e984e1f762)


# c169bdcb 18-Sep-2019 yuangongji <[email protected]>

http: rename bind_socket_ai() to create_bind_socket_nonblock()

(cherry picked from commit 0cd536b0b33d2aa59cee3805846f81cf4e4a5ce9)


Revision tags: release-2.1.11-stable, release-2.1.10-stable
# e2790a7f 25-May-2019 Azat Khuzhin <[email protected]>

http: do not name variable "sun" since this breaks solaris builds

-bash-3.2$ /opt/csw/bin/gcc -xc /dev/null -dM -E | grep '#define sun'
#define sun 1

(cherry picked from commit 1c573ab3a9037c56

http: do not name variable "sun" since this breaks solaris builds

-bash-3.2$ /opt/csw/bin/gcc -xc /dev/null -dM -E | grep '#define sun'
#define sun 1

(cherry picked from commit 1c573ab3a9037c560981ea325170ca6044c2dff6)

show more ...


# 7c4da937 12-May-2019 Azat Khuzhin <[email protected]>

Merge branch 'issue-807-accept4-getnameinfo-AF_UNIX'

* issue-807-accept4-getnameinfo-AF_UNIX:
http-server: add usage/help dialog
http: avoid use of uninitialized value for AF_UNIX/AF_LOCAL socka

Merge branch 'issue-807-accept4-getnameinfo-AF_UNIX'

* issue-807-accept4-getnameinfo-AF_UNIX:
http-server: add usage/help dialog
http: avoid use of uninitialized value for AF_UNIX/AF_LOCAL sockaddr
http-server: add ability to bind to unix-socket
build: struct sockaddr_un detection (sys/un.h, afunix.h)

Fixes: #807
(cherry picked from commit 76eded24d3b0c3fc48c5a888906cc9043223101b)

show more ...


Revision tags: release-2.1.9-beta
# eb7b472b 28-Jan-2019 Azat Khuzhin <[email protected]>

Merge branch 'http-EVHTTP_CON_READ_ON_WRITE_ERROR-fixes-v2'

* http-EVHTTP_CON_READ_ON_WRITE_ERROR-fixes-v2:
http: try to read existing data in buffer under EVHTTP_CON_READ_ON_WRITE_ERROR
test: a

Merge branch 'http-EVHTTP_CON_READ_ON_WRITE_ERROR-fixes-v2'

* http-EVHTTP_CON_READ_ON_WRITE_ERROR-fixes-v2:
http: try to read existing data in buffer under EVHTTP_CON_READ_ON_WRITE_ERROR
test: add logging for http/read_on_write_error and rearrange code
http: do not call deferred readcb if readcb is not set

Refs: #749
(cherry picked from commit 7bfe93886d7fccad2d9a6c76cf47c47d3668f9d1)

show more ...


Revision tags: release-2.0.23-beta
# 2ccd00a6 28-Dec-2018 Luke Dashjr <[email protected]>

http: Preserve socket error from listen across closesocket cleanup

Closes: #738 (cherry-picked)
(cherry picked from commit 28d7221b851093611c65b5961e138403dd7332b6)


# d30e7bba 07-Dec-2018 Azat Khuzhin <[email protected]>

http: fix connection retries when there more then one request for connection

We should not attemp to establishe the connection if there is retry
timer active, since otherwise there will be a bug.

I

http: fix connection retries when there more then one request for connection

We should not attemp to establishe the connection if there is retry
timer active, since otherwise there will be a bug.

Imagine next situation:
con = evhttp_connection_base_new()
evhttp_connection_set_retries(con, 2)
req = evhttp_request_new()
evhttp_make_request(con, req, ...)
# failed during connecting, and timer for 2 second scheduler (retry_ev)

Then another request scheduled for this evcon:
evhttp_make_request(con, req, ...)
# got request from server,
# and now it tries to read the response from the server
# (req.kind == EVHTTP_RESPONSE)
#
# but at this point retry_ev scheduled,
# and it schedules the connect again,
# and after the connect will succeeed, it will pick request with
# EVHTTP_RESPONSE for sending and this is completelly wrong and will
# fail in evhttp_make_header_response() since there is no
# "http_server" for this evcon

This was a long standing issue, that I came across few years ago
firstly, bad only now I had time to dig into it (but right now it was
pretty simple, by limiting amount of CPU for the process and using rr
for debug to go back and forth).

(cherry picked from commit f3f7aa5afff2c0be4a1a299a1a7d0a64558abc23)

show more ...


# a8cc449e 13-Nov-2018 Azat Khuzhin <[email protected]>

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

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)

show more ...


# 6ac2ec25 13-Nov-2018 Azat Khuzhin <[email protected]>

Fix conceivable UAF of the bufferevent in evhttp_connection_free()

Although this is not a problem, since bufferevent uses finalizers and
will free itself only from the loop (well this is not a probl

Fix conceivable UAF of the bufferevent in evhttp_connection_free()

Although this is not a problem, since bufferevent uses finalizers and
will free itself only from the loop (well this is not a problem if you
do not play games with various event_base in different threads) it
generates questions, so rewrite it in more reliable way.

Fixes: #712
(cherry picked from commit 5dc88b387f7baa4bcd528832e94987a85be3b263)

show more ...


# cdcfbafe 22-Oct-2018 Azat Khuzhin <[email protected]>

Merge branch 'http-request-line-parsing'

* http-request-line-parsing:
Fix http https_basic/https_filter_basic under valgrind (increase timeout)
http: cover various non RFC3986 conformant URIs

Merge branch 'http-request-line-parsing'

* http-request-line-parsing:
Fix http https_basic/https_filter_basic under valgrind (increase timeout)
http: cover various non RFC3986 conformant URIs
http: allow non RFC3986 conformant during parsing request-line (http server)
http: do not try to parse request-line if we do not have enough bytes
http: allow trailing spaces (and only them) in request-line (like nginx)
http: cleanup of the request-line parsing

(cherry picked from commit 0ec12bc84cf09307e01dc3b00d08ac1f816b6ff7)

show more ...


# 0d5dde53 05-Jul-2018 Nathan French <[email protected]>

[http] fix C90 warnings

(cherry picked from commit 514dc7579c43e673bdf613e01690371438661260)


# 4215c003 12-Feb-2018 Greg Hazel <[email protected]>

Fix evhttp_connection_get_addr() fox incomming http connections

Install conn_address of the bufferevent on incomping http connections
(even though this is kind of subsytem violation, so let's fix it

Fix evhttp_connection_get_addr() fox incomming http connections

Install conn_address of the bufferevent on incomping http connections
(even though this is kind of subsytem violation, so let's fix it in a
simplest way and thinkg about long-term solution).

Fixes: #510
Closes: #595 (pick)
(cherry picked from commit 367cd9e5c2b8e3f9b8dbed40bfe8a0ed79285c36)

show more ...


# 0dfabd34 13-Feb-2018 Azat Khuzhin <[email protected]>

http: remove message in case !Content-Length and Connection!=close

Since [1] GET can have body, and hence for every incomming connection it
will print this error.

[1] db483e3b002b33890fc88cadd77f6f

http: remove message in case !Content-Length and Connection!=close

Since [1] GET can have body, and hence for every incomming connection it
will print this error.

[1] db483e3b002b33890fc88cadd77f6fd1fccad2d2 ("Allow bodies for
GET/DELETE/OPTIONS/CONNECT")

Noticed-by: BotoX (irc)
Refs: #408
(cherry picked from commit cd57e38c3f77d0f6a718d9c1f2e3ead78a98bd06)

show more ...


# 123362e9 09-Jan-2018 Azat Khuzhin <[email protected]>

http: fix leaks in evhttp_uriencode()

Fixes: #584
(cherry picked from commit 61c21492680505706cad9240c39666ee3b56a89c)


# 7d1ffe64 02-Dec-2017 Greg Hazel <[email protected]>

CONNECT method only takes an authority

(cherry picked from commit 65eb529a9f4dd886d01a9d77ce6d971de9fb1b97)


# b2581380 04-Nov-2017 Azat Khuzhin <[email protected]>

Fix crashing http server when callback do not reply in place from *gencb*

This is the second hunk of the first patch
5ff8eb26371c4dc56f384b2de35bea2d87814779 ("Fix crashing http server when
callback

Fix crashing http server when callback do not reply in place from *gencb*

This is the second hunk of the first patch
5ff8eb26371c4dc56f384b2de35bea2d87814779 ("Fix crashing http server when
callback do not reply in place")

Fixes: #567
(cherry picked from commit 306747e51c1f0de679a3b165b9429418c89f8d6a)

show more ...


# 23eb38b9 29-Oct-2017 Azat Khuzhin <[email protected]>

Allow bodies for GET/DELETE/OPTIONS/CONNECT

I checked with nginx, and via it's lua bindings it allows body for all
this methods. Also everybody knows that some of web-servers allows body
for GET eve

Allow bodies for GET/DELETE/OPTIONS/CONNECT

I checked with nginx, and via it's lua bindings it allows body for all
this methods. Also everybody knows that some of web-servers allows body
for GET even though this is not RFC conformant.

Refs: #408
(cherry picked from commit db483e3b002b33890fc88cadd77f6fd1fccad2d2)

show more ...


# 826f1134 26-Sep-2017 Andreas Gustafsson <[email protected]>

Do not crash when evhttp_send_reply_start() is called after a timeout.

This fixes the crash reported in issue #509. The "would be nice"
items discussed in #509 can be addressed separately.

(cherry

Do not crash when evhttp_send_reply_start() is called after a timeout.

This fixes the crash reported in issue #509. The "would be nice"
items discussed in #509 can be addressed separately.

(cherry picked from commit 99d0a952dada771b91acf63f5208b994e80a2986)

show more ...


# 5b40744d 22-Oct-2017 Azat Khuzhin <[email protected]>

Fix crashing http server when callback do not reply in place

General http callback looks like:
static void http_cb(struct evhttp_request *req, void *arg)
{
evhttp_send_reply(req, HTTP_OK, "E

Fix crashing http server when callback do not reply in place

General http callback looks like:
static void http_cb(struct evhttp_request *req, void *arg)
{
evhttp_send_reply(req, HTTP_OK, "Everything is fine", NULL);
}

And they will work fine becuase in this case http will write request
first, and during write preparation it will disable *read callback* (in
evhttp_write_buffer()), but if we don't reply immediately, for example:
static void http_cb(struct evhttp_request *req, void *arg)
{
return;
}

This will leave connection in incorrect state, and if another request
will be written to the same connection libevent will abort with:
[err] ../http.c: illegal connection state 7

Because it thinks that read for now is not possible, since there were no
write.

Fix this by disabling EV_READ entirely. We couldn't just reset callbacks
because this will leave EOF detection, which we don't need, since user
hasn't replied to callback yet.

Reported-by: Cory Fields <[email protected]>
(cherry picked from commit 5ff8eb26371c4dc56f384b2de35bea2d87814779)

show more ...


# 7e91622b 13-Sep-2017 Azat Khuzhin <[email protected]>

fix handling of close_notify (ssl) in http with openssl bufferevents

Since it can arrive after we disabled events in that bufferevent and
reseted fd, hence evhttp_error_cb() could be called after
SS

fix handling of close_notify (ssl) in http with openssl bufferevents

Since it can arrive after we disabled events in that bufferevent and
reseted fd, hence evhttp_error_cb() could be called after
SSL_RECEIVED_SHUTDOWN.

Closes: #557
(cherry picked from commit da3f2ba22adcabaf7355a90d537b4928d0c168d2)

show more ...


Revision tags: release-2.1.8-stable
# db60ade8 10-Nov-2016 Vis Virial <[email protected]>

http: do not use local settings for Date header


# 1cbf26f6 06-Dec-2016 Azat Khuzhin <[email protected]>

http: fix formatter for pritnf for req->ntoread (osx)


12345678910>>...17