Skip to content

Commit

Permalink
Merge pull request #1 from Quicr/previous
Browse files Browse the repository at this point in the history
Fix fork sync
  • Loading branch information
TimEvens committed Aug 31, 2023
2 parents 1e2979e + b196df0 commit 000da81
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ endif()

OPTION(WITH_OPENSSL "build with OpenSSL" ON)

if(WITH_OPENSSL)
if (OPENSSL_FOUND)
message(STATUS "OpenSSL already found: ${OPENSSL_ROOT_DIR}")
elseif (WITH_OPENSSL)
find_package(OpenSSL REQUIRED)
message(STATUS "root: ${OPENSSL_ROOT_DIR}")
message(STATUS "OpenSSL_VERSION: ${OPENSSL_VERSION}")
Expand All @@ -233,6 +235,7 @@ else()
message(STATUS "Building without picotls-openssl")
list(APPEND PICOQUIC_COMPILE_DEFINITIONS PTLS_WITHOUT_OPENSSL)
endif()

# set_picoquic_compile_settings(TARGET) makes is easy to consistently
# assign compiler build options to each of the following targets
macro(set_picoquic_compile_settings)
Expand Down Expand Up @@ -387,6 +390,8 @@ add_custom_target(
# Specify Install targets
install(TARGETS picoquicdemo picolog_t picoquic-core picoquic-log picohttp-core
RUNTIME DESTINATION bin
BUNDLE DESTINATION bin
FRAMEWORK DESTINATION lib
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)

Expand Down
6 changes: 3 additions & 3 deletions cmake/FindPTLS.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# - Try to find Picotls

if (PICOQUIC_FETCH_PTLS)
if (PICOQUIC_FETCH_PTLS OR PICOQUIC_PTLS_SUBMODULE)
set(PTLS_CORE_LIBRARY picotls-core)
set(PTLS_OPENSSL_LIBRARY picotls-openssl)
set(PTLS_MINICRYPTO_LIBRARY picotls-minicrypto)
Expand All @@ -14,7 +14,7 @@ if (PICOQUIC_FETCH_PTLS)
unset(PTLS_FUSION_LIBRARY)
endif()
set(PTLS_INCLUDE_DIRS ${picotls_SOURCE_DIR}/include)
else(PICOQUIC_FETCH_PTLS)
else()
find_path(PTLS_INCLUDE_DIR
NAMES picotls/openssl.h
HINTS ${PTLS_PREFIX}/include/picotls
Expand Down Expand Up @@ -60,6 +60,6 @@ else(PICOQUIC_FETCH_PTLS)
set(PTLS_WITH_FUSION_DEFAULT ON)
endif()
endif()
endif(PICOQUIC_FETCH_PTLS)
endif()

mark_as_advanced(PTLS_LIBRARIES PTLS_INCLUDE_DIRS)
6 changes: 5 additions & 1 deletion picoquic/picosplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ static void rotate(picosplay_node_t *child);
static picosplay_node_t* leftmost(picosplay_node_t *node);
static picosplay_node_t* rightmost(picosplay_node_t *node);


/* The meat: splay the node x. */
static void zig(picosplay_node_t *x);
static void zigzig(picosplay_node_t *x, picosplay_node_t *p);
Expand Down Expand Up @@ -130,10 +129,12 @@ picosplay_node_t* picosplay_insert(picosplay_tree_t *tree, void *value) {
else
parent->right = new;
}

splay(tree, new);
tree->size++;
}


return new;
}

Expand All @@ -158,6 +159,7 @@ picosplay_node_t* picosplay_find(picosplay_tree_t *tree, void *value)
* perform measurements with and without it and keep the best alternative. */
if(curr != NULL)
splay(tree, curr);

return curr;
}

Expand Down Expand Up @@ -195,6 +197,7 @@ void picosplay_delete(picosplay_tree_t *tree, void *value) {
void picosplay_delete_hint(picosplay_tree_t *tree, picosplay_node_t *node) {
if(node == NULL)
return;

splay(tree, node); /* Now node is tree's root. */
if(node->left == NULL) {
tree->root = node->right;
Expand Down Expand Up @@ -287,6 +290,7 @@ static void mark_gp(picosplay_node_t *child);

/* Rotate to make the given child take its parent's place in the tree. */
static void rotate(picosplay_node_t *child) {

picosplay_node_t *parent = child->parent;
assert(parent != NULL);
if(parent->left == child) { /* A left child given. */
Expand Down
1 change: 0 additions & 1 deletion picoquic/quicctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <sys/time.h>
#endif


/*
* Supported versions. Specific versions may mandate different processing of different
* formats.
Expand Down
4 changes: 2 additions & 2 deletions sample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Example

Generate the certificates:
```
openssl req -x509 -newkey rsa:2048 -days 365 -keyout ca-key.pem -out ca-cert.pem
openssl req -newkey rsa:2048 -keyout server-key.pem -out server-req.pem
openssl req -nodes -x509 -newkey rsa:2048 -days 365 -keyout ca-key.pem -out ca-cert.pem
openssl req -nodes -newkey rsa:2048 -keyout server-key.pem -out server-req.pem
```
These commands will prompt a few questions, you don't need to put actual data
for this simple test.
Expand Down

0 comments on commit 000da81

Please sign in to comment.