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

Upgrade quiche to version 0.18.0 #10570

Merged
merged 1 commit into from
Sep 25, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,26 @@ interface quiche_error
// The peer violated the local stream limits.
QUICHE_ERR_STREAM_LIMIT = -12,

// The received data exceeds the stream's final size.
QUICHE_ERR_FINAL_SIZE = -13,

// Error in congestion control.
QUICHE_ERR_CONGESTION_CONTROL = -14,

// The specified stream was stopped by the peer.
QUICHE_ERR_STREAM_STOPPED = -15,

// The specified stream was reset by the peer.
QUICHE_ERR_STREAM_RESET = -16,

// The received data exceeds the stream's final size.
QUICHE_ERR_FINAL_SIZE = -13,
// Too many identifiers were provided.
QUICHE_ERR_ID_LIMIT = -17,

// Error in congestion control.
QUICHE_ERR_CONGESTION_CONTROL = -14;
// Not enough available identifiers.
QUICHE_ERR_OUT_OF_IDENTIFIERS = -18,

// Error in key update.
QUICHE_ERR_KEY_UPDATE = -19;

static String errToString(long err)
{
Expand Down Expand Up @@ -116,6 +125,12 @@ static String errToString(long err)
return "QUICHE_ERR_STREAM_STOPPED";
if (err == QUICHE_ERR_STREAM_RESET)
return "QUICHE_ERR_STREAM_RESET";
if (err == QUICHE_ERR_ID_LIMIT)
return "QUICHE_ERR_ID_LIMIT";
if (err == QUICHE_ERR_OUT_OF_IDENTIFIERS)
return "QUICHE_ERR_OUT_OF_IDENTIFIERS";
if (err == QUICHE_ERR_KEY_UPDATE)
return "QUICHE_ERR_KEY_UPDATE";
return "?? " + err;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class quiche_h
{
// This interface is a translation of the quiche.h header of a specific version.
// It needs to be reviewed each time the native lib version changes.
private static final String EXPECTED_QUICHE_VERSION = "0.16.0";
private static final String EXPECTED_QUICHE_VERSION = "0.18.0";

public static final byte C_FALSE = 0;
public static final byte C_TRUE = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface LibQuiche extends Library
{
// This interface is a translation of the quiche.h header of a specific version.
// It needs to be reviewed each time the native lib version changes.
String EXPECTED_QUICHE_VERSION = "0.16.0";
String EXPECTED_QUICHE_VERSION = "0.18.0";

// The charset used to convert java.lang.String to char * and vice versa.
Charset CHARSET = StandardCharsets.UTF_8;
Expand Down Expand Up @@ -373,6 +373,17 @@ quiche_conn quiche_accept(byte[] scid, size_t scid_len, byte[] odcid, size_t odc
// field of `quiche_stats`).
int quiche_conn_path_stats(quiche_conn conn, size_t idx, quiche_path_stats out);

// Returns whether or not this is a server-side connection.
boolean quiche_conn_is_server(quiche_conn conn);

// Schedule an ack-eliciting packet on the active path.
ssize_t quiche_conn_send_ack_eliciting(quiche_conn conn);

// Schedule an ack-eliciting packet on the specified path.
ssize_t quiche_conn_send_ack_eliciting_on_path(quiche_conn conn,
sockaddr local, size_t local_len,
sockaddr peer, size_t peer_len);

@Structure.FieldOrder({"from", "from_len", "to", "to_len", "at"})
class quiche_send_info extends Structure
{
Expand Down Expand Up @@ -457,6 +468,7 @@ class quiche_stream_iter extends Structure
public byte dummy;
}

// The side of the stream to be shut down.
interface quiche_shutdown
{
int QUICHE_SHUTDOWN_READ = 0,
Expand All @@ -471,8 +483,25 @@ int quiche_conn_stream_priority(quiche_conn conn, uint64_t stream_id,
int quiche_conn_stream_shutdown(quiche_conn conn, uint64_t stream_id,
int /*quiche_shutdown*/ direction, uint64_t err);

// Returns the stream's send capacity in bytes.
ssize_t quiche_conn_stream_capacity(quiche_conn conn, uint64_t stream_id);

// Returns true if the stream has data that can be read.
boolean quiche_conn_stream_readable(quiche_conn conn, uint64_t stream_id);

// Returns the next stream that has data to read, or -1 if no such stream is
// available.
int64_t quiche_conn_stream_readable_next(quiche_conn conn);

// Returns true if the stream has enough send capacity.
//
// On error a value lower than 0 is returned.
int quiche_conn_stream_writable(quiche_conn conn, uint64_t stream_id, size_t len);

// Returns the next stream that can be written to, or -1 if no such stream is
// available.
int64_t quiche_conn_stream_writable_next(quiche_conn conn);

// Returns true if all the data has been read from the specified stream.
boolean quiche_conn_stream_finished(quiche_conn conn, uint64_t stream_id);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// ========================================================================
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License v. 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
// ========================================================================
//

package org.eclipse.jetty.quic.quiche.jna;

import com.sun.jna.IntegerType;

public class int64_t extends IntegerType
{
public int64_t()
{
this(0);
}
public int64_t(long v)
{
super(8, v, false);
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<jboss-threads.version>3.5.0.Final</jboss-threads.version>
<jetty-assembly-descriptors.version>1.1</jetty-assembly-descriptors.version>
<jetty.perf-helper.version>1.0.7</jetty.perf-helper.version>
<jetty-quiche-native.version>0.16.0</jetty-quiche-native.version>
<jetty-quiche-native.version>0.18.0</jetty-quiche-native.version>
<jetty.servlet.api.version>4.0.6</jetty.servlet.api.version>
<jetty-test-policy.version>1.2</jetty-test-policy.version>
<jetty.test.version>6.0</jetty.test.version>
Expand Down