mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-06 18:18:52 +08:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
818c3bcadc | ||
|
|
cd845ae111 | ||
|
|
c6785abd1f | ||
|
|
ee4732a676 | ||
|
|
eacd6eeed2 | ||
|
|
4aaf111c58 | ||
|
|
991352d201 | ||
|
|
d22573086f | ||
|
|
1148584526 | ||
|
|
5005369f71 | ||
|
|
33601f1a51 | ||
|
|
b97c088e87 | ||
|
|
e93a1bdf6d |
@@ -27,9 +27,9 @@ if [ -z "$ANDROID_HOME" ]; then
|
||||
echo 'No $ANDROID_HOME specified.'
|
||||
exit 1
|
||||
fi
|
||||
PREFIX=$ANDROID_HOME/usr/local
|
||||
TOOLCHAIN=$ANDROID_HOME/toolchain
|
||||
PATH=$TOOLCHAIN/bin:$PATH
|
||||
PREFIX="$ANDROID_HOME"/usr/local
|
||||
TOOLCHAIN="$ANDROID_HOME"/toolchain
|
||||
PATH="$TOOLCHAIN"/bin:"$PATH"
|
||||
|
||||
./configure \
|
||||
--disable-shared \
|
||||
@@ -40,8 +40,8 @@ PATH=$TOOLCHAIN/bin:$PATH
|
||||
--disable-python-bindings \
|
||||
--disable-examples \
|
||||
--enable-werror \
|
||||
CC=clang \
|
||||
CXX=clang++ \
|
||||
CC="$TOOLCHAIN"/bin/clang \
|
||||
CXX="$TOOLCHAIN"/bin/clang++ \
|
||||
CPPFLAGS="-fPIE -I$PREFIX/include" \
|
||||
PKG_CONFIG_LIBDIR="$PREFIX/lib/pkgconfig" \
|
||||
LDFLAGS="-fPIE -pie -L$PREFIX/lib"
|
||||
|
||||
@@ -25,7 +25,7 @@ dnl Do not change user variables!
|
||||
dnl http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html
|
||||
|
||||
AC_PREREQ(2.61)
|
||||
AC_INIT([nghttp2], [1.3.1], [t-tujikawa@users.sourceforge.net])
|
||||
AC_INIT([nghttp2], [1.3.2], [t-tujikawa@users.sourceforge.net])
|
||||
AC_CONFIG_AUX_DIR([.])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
@@ -47,7 +47,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
dnl See versioning rule:
|
||||
dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
||||
AC_SUBST(LT_CURRENT, 15)
|
||||
AC_SUBST(LT_REVISION, 1)
|
||||
AC_SUBST(LT_REVISION, 2)
|
||||
AC_SUBST(LT_AGE, 1)
|
||||
|
||||
major=`echo $PACKAGE_VERSION |cut -d. -f1 | sed -e "s/[^0-9]//g"`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "H2LOAD" "1" "September 12, 2015" "1.3.1" "nghttp2"
|
||||
.TH "H2LOAD" "1" "September 16, 2015" "1.3.2" "nghttp2"
|
||||
.SH NAME
|
||||
h2load \- HTTP/2 benchmarking tool
|
||||
.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "NGHTTP" "1" "September 12, 2015" "1.3.1" "nghttp2"
|
||||
.TH "NGHTTP" "1" "September 16, 2015" "1.3.2" "nghttp2"
|
||||
.SH NAME
|
||||
nghttp \- HTTP/2 experimental client
|
||||
.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "NGHTTPD" "1" "September 12, 2015" "1.3.1" "nghttp2"
|
||||
.TH "NGHTTPD" "1" "September 16, 2015" "1.3.2" "nghttp2"
|
||||
.SH NAME
|
||||
nghttpd \- HTTP/2 experimental server
|
||||
.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.\" Man page generated from reStructuredText.
|
||||
.
|
||||
.TH "NGHTTPX" "1" "September 12, 2015" "1.3.1" "nghttp2"
|
||||
.TH "NGHTTPX" "1" "September 16, 2015" "1.3.2" "nghttp2"
|
||||
.SH NAME
|
||||
nghttpx \- HTTP/2 experimental proxy
|
||||
.
|
||||
|
||||
@@ -1733,14 +1733,6 @@ static int session_prep_frame(nghttp2_session *session,
|
||||
|
||||
aux_data = &item->aux_data.headers;
|
||||
|
||||
estimated_payloadlen = session_estimate_headers_payload(
|
||||
session, frame->headers.nva, frame->headers.nvlen,
|
||||
NGHTTP2_PRIORITY_SPECLEN);
|
||||
|
||||
if (estimated_payloadlen > NGHTTP2_MAX_HEADERSLEN) {
|
||||
return NGHTTP2_ERR_FRAME_SIZE_ERROR;
|
||||
}
|
||||
|
||||
if (frame->headers.cat == NGHTTP2_HCAT_REQUEST) {
|
||||
/* initial HEADERS, which opens stream */
|
||||
nghttp2_stream *stream;
|
||||
@@ -1754,6 +1746,14 @@ static int session_prep_frame(nghttp2_session *session,
|
||||
return NGHTTP2_ERR_NOMEM;
|
||||
}
|
||||
|
||||
estimated_payloadlen = session_estimate_headers_payload(
|
||||
session, frame->headers.nva, frame->headers.nvlen,
|
||||
NGHTTP2_PRIORITY_SPECLEN);
|
||||
|
||||
if (estimated_payloadlen > NGHTTP2_MAX_HEADERSLEN) {
|
||||
return NGHTTP2_ERR_FRAME_SIZE_ERROR;
|
||||
}
|
||||
|
||||
rv = session_predicate_request_headers_send(session, item);
|
||||
if (rv != 0) {
|
||||
return rv;
|
||||
@@ -1765,6 +1765,14 @@ static int session_prep_frame(nghttp2_session *session,
|
||||
} else {
|
||||
nghttp2_stream *stream;
|
||||
|
||||
estimated_payloadlen = session_estimate_headers_payload(
|
||||
session, frame->headers.nva, frame->headers.nvlen,
|
||||
NGHTTP2_PRIORITY_SPECLEN);
|
||||
|
||||
if (estimated_payloadlen > NGHTTP2_MAX_HEADERSLEN) {
|
||||
return NGHTTP2_ERR_FRAME_SIZE_ERROR;
|
||||
}
|
||||
|
||||
stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
|
||||
|
||||
if (session_predicate_push_response_headers_send(session, stream) ==
|
||||
|
||||
@@ -205,8 +205,7 @@ void nghttp2_stream_reschedule(nghttp2_stream *stream) {
|
||||
dep_stream->descendant_last_cycle = 0;
|
||||
stream->cycle = 0;
|
||||
} else {
|
||||
dep_stream->descendant_last_cycle =
|
||||
nghttp2_max(dep_stream->descendant_last_cycle, stream->cycle);
|
||||
dep_stream->descendant_last_cycle = stream->cycle;
|
||||
|
||||
stream->cycle =
|
||||
stream_next_cycle(stream, dep_stream->descendant_last_cycle);
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
TAG=$1
|
||||
PREV_TAG=$2
|
||||
|
||||
git submodule update --init
|
||||
|
||||
git checkout refs/tags/$TAG
|
||||
git log --pretty=fuller --date=short refs/tags/$PREV_TAG..HEAD > ChangeLog
|
||||
|
||||
|
||||
@@ -1860,6 +1860,28 @@ int before_frame_send_callback(nghttp2_session *session,
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace {
|
||||
int on_frame_not_send_callback(nghttp2_session *session,
|
||||
const nghttp2_frame *frame, int lib_error_code,
|
||||
void *user_data) {
|
||||
if (frame->hd.type != NGHTTP2_HEADERS ||
|
||||
frame->headers.cat != NGHTTP2_HCAT_REQUEST) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto req = static_cast<Request *>(
|
||||
nghttp2_session_get_stream_user_data(session, frame->hd.stream_id));
|
||||
if (!req) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::cerr << "[ERROR] request " << req->uri
|
||||
<< " failed: " << nghttp2_strerror(lib_error_code) << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace {
|
||||
int on_stream_close_callback(nghttp2_session *session, int32_t stream_id,
|
||||
uint32_t error_code, void *user_data) {
|
||||
@@ -2212,6 +2234,9 @@ int run(char **uris, int n) {
|
||||
nghttp2_session_callbacks_set_before_frame_send_callback(
|
||||
callbacks, before_frame_send_callback);
|
||||
|
||||
nghttp2_session_callbacks_set_on_frame_not_send_callback(
|
||||
callbacks, on_frame_not_send_callback);
|
||||
|
||||
nghttp2_session_callbacks_set_send_callback(callbacks, send_callback);
|
||||
|
||||
if (config.padding) {
|
||||
|
||||
@@ -912,8 +912,9 @@ int event_loop() {
|
||||
// After that, we drop the root privileges if needed.
|
||||
drop_privileges();
|
||||
|
||||
#ifndef NOTHREADS
|
||||
int rv;
|
||||
|
||||
#ifndef NOTHREADS
|
||||
sigset_t signals;
|
||||
sigemptyset(&signals);
|
||||
sigaddset(&signals, REOPEN_LOG_SIGNAL);
|
||||
|
||||
@@ -146,7 +146,14 @@ int shrpx_bio_write(BIO *b, const char *buf, int len) {
|
||||
if (conn->tls.initial_handshake_done) {
|
||||
// After handshake finished, send |buf| of length |len| to the
|
||||
// socket directly.
|
||||
assert(wbuf.rleft() == 0);
|
||||
|
||||
// Only when TLS session was prematurely ended before server sent
|
||||
// all handshake message, this condition is true. This could be
|
||||
// alert from SSL_shutdown(). Since connection is already down,
|
||||
// just return error.
|
||||
if (wbuf.rleft()) {
|
||||
return -1;
|
||||
}
|
||||
auto nwrite = conn->write_clear(buf, len);
|
||||
if (nwrite < 0) {
|
||||
return -1;
|
||||
|
||||
@@ -1321,8 +1321,9 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream) {
|
||||
|
||||
size_t nheader = downstream->get_response_headers().size();
|
||||
auto nva = std::vector<nghttp2_nv>();
|
||||
// 3 means :status and possible server and via header field.
|
||||
nva.reserve(nheader + 3 + get_config()->add_response_headers.size());
|
||||
// 4 means :status and possible server, via and x-http2-push header
|
||||
// field.
|
||||
nva.reserve(nheader + 4 + get_config()->add_response_headers.size());
|
||||
std::string via_value;
|
||||
auto response_status = util::utos(downstream->get_response_http_status());
|
||||
nva.push_back(http2::make_nv_ls(":status", response_status));
|
||||
@@ -1376,6 +1377,12 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream) {
|
||||
nva.push_back(http2::make_nv(p.first, p.second));
|
||||
}
|
||||
|
||||
if (downstream->get_stream_id() % 2 == 0) {
|
||||
// This header field is basically for human on client side to
|
||||
// figure out that the resource is pushed.
|
||||
nva.push_back(http2::make_nv_ll("x-http2-push", "1"));
|
||||
}
|
||||
|
||||
if (LOG_ENABLED(INFO)) {
|
||||
log_response_headers(downstream, nva);
|
||||
}
|
||||
@@ -1648,7 +1655,8 @@ int Http2Upstream::submit_push_promise(const std::string &scheme,
|
||||
Downstream *downstream) {
|
||||
int rv;
|
||||
std::vector<nghttp2_nv> nva;
|
||||
nva.reserve(downstream->get_request_headers().size());
|
||||
// 4 for :method, :scheme, :path and :authority
|
||||
nva.reserve(4 + downstream->get_request_headers().size());
|
||||
|
||||
// juse use "GET" for now
|
||||
nva.push_back(http2::make_nv_ll(":method", "GET"));
|
||||
|
||||
Reference in New Issue
Block a user