Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement]patch poco for keep-alive #52599

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions thirdparty/download-thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ if [[ -d $TP_SOURCE_DIR/$POCO_SOURCE ]] ; then
if [ ! -f "$PATCHED_MARK" ] && [[ $POCO_SOURCE == "poco-1.12.5-release" ]] ; then
patch -p1 < "$TP_PATCH_DIR/poco-1.12.5-ca.patch"
patch -p1 < "$TP_PATCH_DIR/poco-1.12.5-zero-copy.patch"
patch -p1 < "$TP_PATCH_DIR/poco-1.12.5-keep-alive.patch"
touch "$PATCHED_MARK"
fi
cd -
Expand Down
27 changes: 27 additions & 0 deletions thirdparty/patches/poco-1.12.5-keep-alive.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/Net/src/HTTPClientSession.cpp b/Net/src/HTTPClientSession.cpp
index b9591f0..f5ac624 100644
--- a/Net/src/HTTPClientSession.cpp
+++ b/Net/src/HTTPClientSession.cpp
@@ -465,7 +465,7 @@ int HTTPClientSession::write(const char* buffer, std::streamsize length)
_reconnect = false;
return rc;
}
- catch (IOException&)
+ catch (Poco::Exception&)
{
if (_reconnect)
{
diff --git a/Net/src/HTTPStream.cpp b/Net/src/HTTPStream.cpp
index 61fce2b..9a801e5 100644
--- a/Net/src/HTTPStream.cpp
+++ b/Net/src/HTTPStream.cpp
@@ -43,7 +43,8 @@ void HTTPStreamBuf::close()
if (_mode & std::ios::out)
{
sync();
- _session.socket().shutdownSend();
+ if (!_session.getKeepAlive())
+ _session.socket().shutdownSend();
}
}

Loading