Skip to content

Commit

Permalink
Update to latest quiche sha (java-native-access#299)
Browse files Browse the repository at this point in the history
Motivation:

We should update to the latest quiche sha to consume fixes

Modifications:

- Update to 7eb57c4fc608932acc76c3ee2759c2e41e51d566
- Adjust pom.xml to be able to build

Result:

Use latest quiche commit
  • Loading branch information
normanmaurer authored Jun 16, 2021
1 parent b3fe095 commit c0e7880
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@
<quicheHomeIncludeDir>${quicheHomeDir}/include</quicheHomeIncludeDir>
<quicheRepository>https://github.com/cloudflare/quiche</quicheRepository>
<quicheBranch>master</quicheBranch>
<quicheCommitSha>6d070ed8694216806f3ce689d71ceb7ad76d425e</quicheCommitSha>
<quicheCommitSha>7eb57c4fc608932acc76c3ee2759c2e41e51d566</quicheCommitSha>
<generatedSourcesDir>${project.build.directory}/generated-sources</generatedSourcesDir>
<templateDir>${project.build.directory}/template</templateDir>
<cargoTarget />
<cflags>-std=c99 -Werror -fno-omit-frame-pointer -fvisibility=hidden -Wunused -Wno-unused-value -O3 -I${quicheHomeIncludeDir} -I${boringsslHomeIncludeDir}</cflags>
<cflags>-std=gnu99 -Werror -fno-omit-frame-pointer -fvisibility=hidden -Wunused -Wno-unused-value -O3 -I${quicheHomeIncludeDir} -I${boringsslHomeIncludeDir}</cflags>
<ldflags>-L${quicheHomeBuildDir} -lquiche -L${boringsslHomeBuildDir} -lssl -lcrypto</ldflags>
<extraCmakeFlags />
<extraCflags />
Expand Down Expand Up @@ -185,7 +185,7 @@
<libssl>libssl.a</libssl>
<libcrypto>libcrypto.a</libcrypto>
<libquiche>libquiche.a</libquiche>
<extraLdflags>-Wl,--strip-debug -Wl,--exclude-libs,ALL -lrt</extraLdflags>
<extraLdflags>-Wl,--strip-debug -Wl,--exclude-libs,ALL -Wl,-lrt</extraLdflags>
<bundleNativeCode>META-INF/native/lib${jniLibName}.so;osname=linux;processor=${os.detected.arch}</bundleNativeCode>
</properties>
</profile>
Expand All @@ -202,7 +202,7 @@
<libssl>libssl.a</libssl>
<libcrypto>libcrypto.a</libcrypto>
<libquiche>libquiche.a</libquiche>
<extraLdflags>-Wl,--strip-debug -Wl,--exclude-libs,ALL -lrt</extraLdflags>
<extraLdflags>-Wl,--strip-debug -Wl,--exclude-libs,ALL</extraLdflags>
<bundleNativeCode>META-INF/native/lib${jniLibName}.so;osname=linux;processor=aarch_64</bundleNativeCode>
<jniLibName>netty_quiche_linux_aarch_64</jniLibName>
<jni.classifier>linux-aarch_64</jni.classifier>
Expand Down
8 changes: 5 additions & 3 deletions src/main/c/netty_quic_quiche.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
// This needs to be included for quiche_recv_info and quiche_send_info structs.
#include <time.h>
#else
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
// This needs to be included for quiche_recv_info and quiche_send_info structs.
#include <sys/time.h>
#endif // _WIN32


#include <quiche.h>
#include "netty_jni_util.h"
#include "netty_quic_boringssl.h"
Expand All @@ -48,9 +53,6 @@ static jobject quiche_logger;
static JavaVM *global_vm = NULL;
static char* staticPackagePrefix = NULL;

// Add extern declaration to let it compile with -std=c99
extern char* strdup(const char*);

jint quic_get_java_env(JNIEnv **env)
{
return (*global_vm)->GetEnv(global_vm, (void **)env, NETTY_JNI_UTIL_JNI_VERSION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ final class QuicheQuicConnection {
// TODO: Maybe cache these per thread as we only use them temporary within a limited scope.
infoBuffer = Quiche.allocateNativeOrder(QUICHE_SEND_INFOS_OFFSET +
2 * Quiche.SIZEOF_QUICHE_SEND_INFO);
// Let's memset the memory.
infoBuffer.setZero(0, infoBuffer.capacity());
}

void free() {
Expand Down

0 comments on commit c0e7880

Please sign in to comment.