{
size_t pos = 0;
while (pos < response.size()) {
+#ifdef HAVE_QUICHE_STREAM_ERROR_CODES
+ uint64_t quicheErrorCode{0};
+ auto res = quiche_conn_stream_send(conn.d_conn.get(), streamID, &response.at(pos), response.size() - pos, true, &quicheErrorCode);
+#else
auto res = quiche_conn_stream_send(conn.d_conn.get(), streamID, &response.at(pos), response.size() - pos, true);
+#endif
if (res == QUICHE_ERR_DONE) {
response.erase(response.begin(), response.begin() + static_cast<ssize_t>(pos));
return false;
bool fin = false;
auto existingLength = streamBuffer.size();
streamBuffer.resize(existingLength + 512);
+#ifdef HAVE_QUICHE_STREAM_ERROR_CODES
+ uint64_t quicheErrorCode{0};
+ auto received = quiche_conn_stream_recv(conn.d_conn.get(), streamID,
+ &streamBuffer.at(existingLength), 512,
+ &fin,
+ &quicheErrorCode);
+#else
auto received = quiche_conn_stream_recv(conn.d_conn.get(), streamID,
&streamBuffer.at(existingLength), 512,
&fin);
+#endif
if (received == 0 || received == QUICHE_ERR_DONE) {
streamBuffer.resize(existingLength);
return;
AS_IF([test "x$with_quiche" != "xno"], [
AS_IF([test "x$with_quiche" = "xyes" -o "x$with_quiche" = "xauto"], [
- PKG_CHECK_MODULES([QUICHE], [quiche >= 0.15.0], [
+ PKG_CHECK_MODULES([QUICHE], [quiche >= 0.22.0], [
[HAVE_QUICHE=1]
AC_DEFINE([HAVE_QUICHE], [1], [Define to 1 if you have quiche])
- ], [ : ])
+ AC_DEFINE([HAVE_QUICHE_STREAM_ERROR_CODES], [1], [Define to 1 if the Quiche API includes error code in quiche_conn_stream_recv and quiche_conn_stream_send])
+ ], [
+ # Quiche is older than 0.22.0, or no Quiche at all
+ PKG_CHECK_MODULES([QUICHE], [quiche >= 0.15.0], [
+ [HAVE_QUICHE=1]
+ AC_DEFINE([HAVE_QUICHE], [1], [Define to 1 if you have quiche])
+ ], [ : ])
+ ])
])
])
AM_CONDITIONAL([HAVE_QUICHE], [test "x$QUICHE_LIBS" != "x"])