aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Marble <jacobmarble@google.com>2016-02-05 13:28:15 -0800
committerJacob Marble <jacobmarble@google.com>2016-02-05 23:27:47 +0000
commit70712809e243dc768bef4f9f294ad1bf94f3b607 (patch)
tree40a0c340b0d2bdd9fd7a665fdd3ddf3aa9087730
parent5616013181afd01cc3960afd03fece74d101efec (diff)
downloadlibweave-70712809e243dc768bef4f9f294ad1bf94f3b607.tar.gz
Fix some libevhtp usage details.
Path improperly fetched from request object. Bump libevhtp version in order to work around https://github.com/ellzey/libevhtp/issues/167 Change-Id: Ic53b72c7eea5c3480537f3c69c73b908940726dd Bug: 26986898 Reviewed-on: https://weave-review.googlesource.com/2512 Reviewed-by: Vitaly Buka <vitalybuka@google.com>
-rw-r--r--examples/provider/event_http_server.cc4
-rwxr-xr-xthird_party/get_libevhtp.sh8
2 files changed, 7 insertions, 5 deletions
diff --git a/examples/provider/event_http_server.cc b/examples/provider/event_http_server.cc
index 1bf58f6..c058401 100644
--- a/examples/provider/event_http_server.cc
+++ b/examples/provider/event_http_server.cc
@@ -38,7 +38,7 @@ class HttpServerImpl::RequestImpl : public Request {
~RequestImpl() {}
- std::string GetPath() const override { return req_->uri->path->path; }
+ std::string GetPath() const override { return req_->uri->path->full; }
std::string GetFirstHeader(const std::string& name) const override {
const char* header = evhtp_header_find(req_->headers_in, name.c_str());
@@ -132,7 +132,7 @@ void HttpServerImpl::GenerateX509(X509* x509, EVP_PKEY* pkey) {
void HttpServerImpl::NotFound(evhtp_request_t* req) {
EventPtr<evbuffer> buf{evbuffer_new()};
- evbuffer_add_printf(buf.get(), "404 Not Found: %s\n", req->uri->path->path);
+ evbuffer_add_printf(buf.get(), "404 Not Found: %s\n", req->uri->path->full);
evhtp_send_reply_start(req, 404);
evhtp_send_reply_body(req, buf.get());
evhtp_send_reply_end(req);
diff --git a/third_party/get_libevhtp.sh b/third_party/get_libevhtp.sh
index c270813..cfcada9 100755
--- a/third_party/get_libevhtp.sh
+++ b/third_party/get_libevhtp.sh
@@ -9,17 +9,19 @@
cd $(dirname "$0")
THIRD_PARTY=$(pwd)
+LIBEVHTP_VERSION=1.2.11n
+
mkdir -p include lib
rm -rf $THIRD_PARTY/libevhtp
-curl -L https://github.com/ellzey/libevhtp/archive/1.2.10.tar.gz | tar xz || exit 1
-mv libevhtp-1.2.10 $THIRD_PARTY/libevhtp || exit 1
+curl -L https://github.com/ellzey/libevhtp/archive/$LIBEVHTP_VERSION.tar.gz | tar xz || exit 1
+mv libevhtp-$LIBEVHTP_VERSION $THIRD_PARTY/libevhtp || exit 1
cd $THIRD_PARTY/libevhtp || exit 1
cmake -D EVHTP_DISABLE_REGEX:BOOL=ON . || exit 1
make evhtp || exit 1
-cp -rf evhtp-config.h evhtp.h evthr/evthr.h htparse/htparse.h $THIRD_PARTY/include/ || exit 1
+cp -rf *.h $THIRD_PARTY/include/ || exit 1
cp -f libevhtp.a $THIRD_PARTY/lib/ || exit 1
rm -rf $THIRD_PARTY/libevhtp