]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add build.info for QUIC server demo
authorTomas Mraz <tomas@openssl.org>
Thu, 23 Jan 2025 16:28:43 +0000 (17:28 +0100)
committerNeil Horman <nhorman@openssl.org>
Mon, 17 Feb 2025 16:27:33 +0000 (11:27 -0500)
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26544)

demos/build.info
demos/quic/build.info [new file with mode: 0644]
demos/quic/server/Makefile
demos/quic/server/build.info [new file with mode: 0644]
demos/quic/server/server.c

index 5822f9bfecce281e366b0d375218939ec7f3df6d..3c74e8f3310ad7ae0ce04dba115cbb444dbdcd4e 100644 (file)
@@ -7,6 +7,10 @@ IF[{- !$disabled{"h3demo"} -}]
  ENDIF
 ENDIF
 
+IF[{- !$disabled{"quic"} -}]
+     SUBDIRS=quic
+ENDIF
+
 IF[{- !$disabled{"cms"} -}]
  IF[{- !$disabled{"deprecated"} -}]
     SUBDIRS=cms
diff --git a/demos/quic/build.info b/demos/quic/build.info
new file mode 100644 (file)
index 0000000..d9ef4c7
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS=server
index df68c7ed6f68cb46892e75a4595887f53f0acf2a..8fe295876fb8f048b02df65ea05a135da221ea0d 100644 (file)
@@ -2,11 +2,9 @@
 # To run the demo when linked with a shared library (default) ensure that
 # libcrypto and libssl are on the library path. For example:
 #
-#    LD_LIBRARY_PATH=../.. ./server 4444 \
-#      ../../test/certs/servercert.pem \
-#      ../../test/certs/serverkey.pem
-#
-# TODO(QUIC SERVER): Add build.info.
+#    LD_LIBRARY_PATH=../../.. ./server 4444 \
+#      ../../../test/certs/servercert.pem \
+#      ../../../test/certs/serverkey.pem
 #
 CFLAGS  += -I../../../include -g -Wall -Wsign-compare
 LDFLAGS += -L../../..
diff --git a/demos/quic/server/build.info b/demos/quic/server/build.info
new file mode 100644 (file)
index 0000000..296c27b
--- /dev/null
@@ -0,0 +1,14 @@
+#
+# To run the demo when linked with a shared library (default) ensure that
+# libcrypto and libssl are on the library path. For example:
+#
+#    LD_LIBRARY_PATH=../../.. ./server 4444 \
+#        ../../../test/certs/servercert.pem \
+#        ../../../test/certs/serverkey.pem
+
+
+PROGRAMS{noinst} = server
+
+INCLUDE[server]=../../../include
+SOURCE[server]=server.c
+DEPEND[server]=../../../libcrypto ../../../libssl
index ad0fc1f462070063b2c38aa1270c1c512e438bcc..183c59c6f953780a298231ba767b809de6e313a5 100644 (file)
@@ -9,8 +9,12 @@
 #include <openssl/err.h>
 #include <openssl/ssl.h>
 #include <openssl/quic.h>
-#include <netinet/in.h>
-#include <unistd.h>
+#ifdef _WIN32 /* Windows */
+# include <winsock2.h>
+#else /* Linux/Unix */
+# include <netinet/in.h>
+# include <unistd.h>
+#endif
 #include <assert.h>
 
 /*
@@ -155,7 +159,8 @@ static int run_quic_server(SSL_CTX *ctx, int fd)
      * so the below call is not actually necessary. The configured behaviour is
      * inherited by child objects.
      */
-    SSL_set_blocking_mode(listener, 1);
+    if (!SSL_set_blocking_mode(listener, 1))
+        goto err;
 
     for (;;) {
         /* Blocking wait for an incoming connection, similar to accept(2). */