--- /dev/null
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5142bac..7b95f74 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -33,6 +33,8 @@ ENDIF(NOT CMAKE_BUILD_TYPE)
+ SET(CMAKE_C_FLAGS "-std=c99 -Wall -g ${CC_WARNING_FLAGS} ${CMAKE_C_FLAGS}")
+ SET(CMAKE_C_FLAGS_DEBUG "-O0")
+ SET(CMAKE_C_FLAGS_RELEASE "-O2")
++SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
++SET(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
+
+ INCLUDE_DIRECTORIES(
+ ${OPENSSL_INCLUDE_DIR}
+@@ -118,6 +120,16 @@ TARGET_LINK_LIBRARIES(examples-echo quicly ${OPENSSL_LIBRARIES} ${CMAKE_DL_LIBS}
+
+ ADD_EXECUTABLE(udpfw t/udpfw.c)
+
++INSTALL (
++ DIRECTORY ${CMAKE_SOURCE_DIR}/include/
++ DESTINATION include
++ FILES_MATCHING PATTERN "*.h")
++
++INSTALL(TARGETS quicly
++ RUNTIME DESTINATION bin
++ LIBRARY DESTINATION lib
++ ARCHIVE DESTINATION lib)
++
+ ADD_CUSTOM_TARGET(check env BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} WITH_DTRACE=${WITH_DTRACE} prove --exec "sh -c" -v ${CMAKE_CURRENT_BINARY_DIR}/*.t t/*.t
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ DEPENDS cli test.t)
--- /dev/null
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d1d6c09..90d7221 100644
+--- a/deps/picotls/CMakeLists.txt
++++ b/deps/picotls/CMakeLists.txt
+@@ -13,6 +13,9 @@ IF (WITH_DTRACE)
+ ENDIF ()
+
+ SET(CMAKE_C_FLAGS "-std=c99 -Wall -O2 -g ${CC_WARNING_FLAGS} ${CMAKE_C_FLAGS}")
++SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
++SET(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
++
+ INCLUDE_DIRECTORIES(
+ deps/cifra/src/ext
+ deps/cifra/src
+@@ -161,6 +164,15 @@ TARGET_LINK_LIBRARIES(ptlsbench ${PTLSBENCH_LIBS})
+
+ ADD_CUSTOM_TARGET(check env BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} prove --exec '' -v ${CMAKE_CURRENT_BINARY_DIR}/*.t t/*.t WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${TEST_EXES} cli)
+
++INSTALL (DIRECTORY ${CMAKE_SOURCE_DIR}/include/
++ DESTINATION include
++ FILES_MATCHING PATTERN "*.h")
++
++INSTALL(TARGETS picotls-core picotls-openssl
++ RUNTIME DESTINATION bin
++ LIBRARY DESTINATION lib
++ ARCHIVE DESTINATION lib)
++
+ IF (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -pthread ${CMAKE_C_FLAGS}")
+ ELSEIF ("${CMAKE_SYSTEM_NAME}" MATCHES "SunOS")
ptls_ctx->cipher_suites = qm->quic_ciphers[ctx->crypto_engine];
ptls_ctx->certificates.list = NULL;
ptls_ctx->certificates.count = 0;
- ptls_ctx->esni = NULL;
ptls_ctx->on_client_hello = NULL;
ptls_ctx->emit_certificate = NULL;
ptls_ctx->sign_certificate = NULL;
session_t *udp_session;
quicly_conn_t *conn;
size_t num_packets, i, max_packets;
- quicly_address_t dest, src;
u32 n_sent = 0;
int err = 0;
break;
num_packets = max_packets;
- if ((err = quicly_send (conn, &dest, &src, packets, &num_packets, buf,
- sizeof (buf))))
+ if ((err = quicly_send (conn, &ctx->rmt_ip, &ctx->lcl_ip, packets,
+ &num_packets, buf, sizeof (buf))))
goto quicly_error;
for (i = 0; i != num_packets; ++i)
{
- if ((err =
- quic_send_datagram (udp_session, &packets[i], &dest, &src)))
- goto quicly_error;
-
+ if ((err = quic_send_datagram (udp_session, &packets[i],
+ &ctx->rmt_ip, &ctx->lcl_ip)))
+ goto quicly_error;
}
n_sent += num_packets;
}
quic_build_sockaddr (sa, &salen, &tc->rmt_ip, tc->rmt_port, tc->is_ip4);
quicly_ctx = quic_get_quicly_ctx_from_ctx (ctx);
- ret = quicly_connect (&ctx->conn, quicly_ctx, (char *) ctx->srv_hostname,
- sa, NULL, &quic_main.wrk_ctx[thread_index].next_cid,
+ ret = quicly_connect (&ctx->conn, quicly_ctx, (char *) ctx->srv_hostname, sa,
+ NULL, &quic_main.wrk_ctx[thread_index].next_cid,
ptls_iovec_init (NULL, 0), &quic_main.hs_properties,
- NULL);
+ NULL, NULL);
++quic_main.wrk_ctx[thread_index].next_cid.master_id;
/* Save context handle in quicly connection */
quic_store_conn_ctx (ctx->conn, ctx);
}
quicly_ctx = quic_get_quicly_ctx_from_ctx (ctx);
- if ((rv = quicly_accept (&conn, quicly_ctx, NULL, &pctx->sa,
- &pctx->packet, NULL,
- &quic_main.wrk_ctx[pctx->thread_index].next_cid,
- NULL)))
+ if ((rv = quicly_accept (
+ &conn, quicly_ctx, NULL, &pctx->sa, &pctx->packet, NULL,
+ &quic_main.wrk_ctx[pctx->thread_index].next_cid, NULL, NULL)))
{
/* Invalid packet, pass */
assert (conn == NULL);
packet.iov_len = payload_len;
packet.iov_base = payload;
- struct _st_quicly_conn_public_t *conn =
- (struct _st_quicly_conn_public_t *) qctx->conn;
-
udp_session = session_get_from_handle (udp_session_handle);
- rv = quic_send_datagram (udp_session, &packet, &conn->remote.address,
- &conn->local.address);
+ rv = quic_send_datagram (udp_session, &packet, &qctx->rmt_ip, &qctx->lcl_ip);
quic_set_udp_tx_evt (udp_session);
return rv;
}