Skip to content

Commit

Permalink
fix singlebin and use new qt
Browse files Browse the repository at this point in the history
  • Loading branch information
apinprastya committed Dec 20, 2019
1 parent 1c46d4a commit dd76030
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 8 deletions.
6 changes: 3 additions & 3 deletions external_library/pillow/pillowcore/HttpClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,16 +645,16 @@ void Pillow::HttpClient::sendRequest()

if (_hostHeaderValue.isEmpty())
{
_hostHeaderValue = _request.url.encodedHost();
_hostHeaderValue = _request.url.toAce(_request.url.host());
if (_request.url.port(80) != 80)
{
_hostHeaderValue.append(':');
Pillow::ByteArrayHelpers::appendNumber<int, 10>(_hostHeaderValue, _request.url.port(80));
}
}

QByteArray uri = _request.url.encodedPath();
const QByteArray query = _request.url.encodedQuery();
QByteArray uri = _request.url.path().toUtf8();
const QByteArray query = _request.url.toEncoded();
if (!query.isEmpty()) uri.append('?').append(query);

Pillow::HttpHeaderCollection headers;
Expand Down
6 changes: 3 additions & 3 deletions external_library/pillow/pillowcore/HttpHandlerProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ bool Pillow::HttpHandlerProxy::handleRequest(Pillow::HttpConnection *request)
if (_proxiedUrl.isEmpty()) return false;

QUrl targetUrl = _proxiedUrl;
targetUrl.setEncodedPath(request->requestPath());
if (!request->requestQueryString().isEmpty()) targetUrl.setEncodedQuery(request->requestQueryString());
if (!request->requestFragment().isEmpty()) targetUrl.setEncodedFragment(request->requestFragment());
targetUrl.setPath(request->requestPath());
if (!request->requestQueryString().isEmpty()) targetUrl.setQuery(request->requestQueryString());
if (!request->requestFragment().isEmpty()) targetUrl.setFragment(request->requestFragment());

QNetworkRequest proxiedRequest(targetUrl);
foreach (const Pillow::HttpHeader& header, request->requestHeaders())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ bool HttpHandlerSimpleRouter::handleRequest(Pillow::HttpConnection *request)
{
QString methodParam = request->requestParamValue(methodToken);
if (!methodParam.isEmpty())
requestMethod = methodParam.toAscii();
requestMethod = methodParam.toUtf8();
}

QString requestPath = QUrl::fromPercentEncoding(request->requestPath());
Expand Down
33 changes: 33 additions & 0 deletions external_library/pillow/pillowcore/pillowcore_src.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
INCLUDEPATH += $$PWD

SOURCES += \
$$PWD/parser/parser.c \
$$PWD/parser/http_parser.c \
$$PWD/HttpServer.cpp \
$$PWD/HttpHandler.cpp \
#$$PWD/HttpHandlerQtScript.cpp \
$$PWD/HttpHelpers.cpp \
$$PWD/HttpsServer.cpp \
$$PWD/HttpHandlerSimpleRouter.cpp \
$$PWD/HttpConnection.cpp \
$$PWD/HttpHandlerProxy.cpp \
$$PWD/HttpClient.cpp \
$$PWD/HttpHeader.cpp

HEADERS += \
$$PWD/parser/parser.h \
$$PWD/parser/http_parser.h \
$$PWD/HttpServer.h \
$$PWD/HttpHandler.h \
#$$PWD/HttpHandlerQtScript.h \
$$PWD/HttpHelpers.h \
$$PWD/HttpsServer.h \
$$PWD/HttpHandlerSimpleRouter.h \
$$PWD/HttpConnection.h \
$$PWD/HttpHandlerProxy.h \
$$PWD/ByteArrayHelpers.h \
$$PWD/private/ByteArray.h \
$$PWD/HttpClient.h \
$$PWD/pch.h \
$$PWD/HttpHeader.h \
$$PWD/PillowCore.h
2 changes: 1 addition & 1 deletion sultan/sultan.pro
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CONFIG += c++11

contains(CONFIG, SINGLEBIN) {
include(../external_library/o2/src/src.pri)
include(../external_library/pillow/pillowcore/pillowcore.pri)
include(../external_library/pillow/pillowcore/pillowcore_src.pri)
include(../libglobal/libglobal_src.pri)
include(../libprint/libprint_src.pri)
include(../libdb/libdb_src.pri)
Expand Down

0 comments on commit dd76030

Please sign in to comment.