Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #23487)
  • Loading branch information
hlandau committed Mar 28, 2024
1 parent 63685f3 commit 1c5e1f6
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
4 changes: 2 additions & 2 deletions doc/designs/quic-design/server/quic-polling.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ issues with this design:
This limitation is intrinsic to the design of `poll(2)` and poll-esque APIs.
It is not necessarily a reason not to offer this rather simple API, as use of
poll(2) and poll(2)-like APIs is widespread and users are likely to appreciate
an API which does not provide significant impedence discontinuities to
an API which does not provide significant impedance discontinuities to
applications which use select/poll, even if those applications suffer impaired
performance as a result.
Expand Down Expand Up @@ -1424,7 +1424,7 @@ socket handle and then closes it. What happens?**
Since OSes in general do not provide a way to get notified of these closures it
is not really possible to handle this automatically. It is essential that an
application deregister the handle from the poll group first.
application deregisters the handle from the poll group first.
**Q. How does code using a poll method determine what poll descriptors that
method supports?**
Expand Down
13 changes: 10 additions & 3 deletions ssl/quic/quic_obj_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* The QUIC_OBJ is a base type for QUIC APL objects which provides functionality
* common to all QUIC objects and which supports having different APL objects
* dynamically assume leader roles. It can therefore be seen as an extention of
* dynamically assume leader roles. It can therefore be seen as an extension of
* the SSL base class and extends the SSL object for QUIC APL objects. This
* avoids duplication of functionality for different types of QUIC object and
* allows access to common responsibilities of different types of APL object
Expand Down Expand Up @@ -64,8 +64,8 @@
*
* This structure must come at the start of a QUIC object structure definition.
*
* ssl->type still determines the actual object type. An SSL object pointer s
* can be safely cast to (QUIC_OBJ *) iff IS_QUIC(s) is true.
* ssl->type still determines the actual object type. An SSL object
* pointer s can be safely cast to (QUIC_OBJ *) iff IS_QUIC(s) is true.
*/
struct quic_obj_st {
/* SSL object common header. */
Expand Down Expand Up @@ -105,6 +105,11 @@ struct quic_obj_st {
unsigned int is_port_leader : 1;
};

/*
* Core Functions and Inlines
* ==========================
*/

/*
* Initialises a QUIC_OBJ structure with zero or more roles active. Returns 1
* on success or 0 on failure.
Expand Down Expand Up @@ -217,6 +222,8 @@ ossl_quic_obj_get0_port_local(const QUIC_OBJ *obj)
/*
* Convenience Inlines
* ===================
*
* These inlines are expressed in terms of the core functions and inlines above.
*/

/* Get a pointer to the QUIC domain mutex. Always returns non-NULL. */
Expand Down
4 changes: 2 additions & 2 deletions ssl/ssl_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -7479,11 +7479,11 @@ SSL *SSL_get0_listener(SSL *s)
{
#ifndef OPENSSL_NO_QUIC
if (!IS_QUIC(s))
return s;
return NULL;

return ossl_quic_get0_listener(s);
#else
return s;
return NULL;
#endif
}

Expand Down
2 changes: 0 additions & 2 deletions ssl/t1_trce.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
/* Packet trace support for OpenSSL */
#include "internal/nelem.h"
#include "internal/ssl_unwrap.h"
#include "internal/quic_predef.h"
#include "internal/quic_trace.h"
#include "quic/quic_local.h"

typedef struct {
int num;
Expand Down
6 changes: 5 additions & 1 deletion test/radix/quic_bindings.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ static RADIX_OBJ *RADIX_OBJ_new(const char *name, SSL *ssl)
if (!TEST_ptr(obj = OPENSSL_zalloc(sizeof(*obj))))
return NULL;

obj->name = OPENSSL_strdup(name);
if (!TEST_ptr(obj->name = OPENSSL_strdup(name))) {
OPENSSL_free(obj);
return NULL;
}

obj->ssl = ssl;
return obj;
}
Expand Down
2 changes: 1 addition & 1 deletion test/radix/quic_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ DEF_FUNC(hf_connect_wait)
goto err;

if (ret != 1) {
if (1 /* TODO */ && is_want(ssl, ret))
if (is_want(ssl, ret))
F_SPIN_AGAIN();

if (!TEST_int_eq(ret, 1))
Expand Down

0 comments on commit 1c5e1f6

Please sign in to comment.