Skip to content

Commit

Permalink
QUIC APL: Fix stream backpressure conditions to use non-I/O errors
Browse files Browse the repository at this point in the history
Reviewed-by: Matt Caswell <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from openssl#21811)
  • Loading branch information
hlandau authored and t8m committed Aug 25, 2023
1 parent 14551f1 commit 7a5f58b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crypto/err/openssl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@ SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH:303:ssl session id has bad length
SSL_R_SSL_SESSION_ID_TOO_LONG:408:ssl session id too long
SSL_R_SSL_SESSION_VERSION_MISMATCH:210:ssl session version mismatch
SSL_R_STILL_IN_INIT:121:still in init
SSL_R_STREAM_COUNT_LIMITED:395:stream count limited
SSL_R_STREAM_COUNT_LIMITED:411:stream count limited
SSL_R_STREAM_FINISHED:365:stream finished
SSL_R_STREAM_RECV_ONLY:366:stream recv only
SSL_R_STREAM_RESET:375:stream reset
Expand Down
2 changes: 1 addition & 1 deletion include/openssl/sslerr.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
# define SSL_R_SSL_SESSION_ID_TOO_LONG 408
# define SSL_R_SSL_SESSION_VERSION_MISMATCH 210
# define SSL_R_STILL_IN_INIT 121
# define SSL_R_STREAM_COUNT_LIMITED 395
# define SSL_R_STREAM_COUNT_LIMITED 411
# define SSL_R_STREAM_FINISHED 365
# define SSL_R_STREAM_RECV_ONLY 366
# define SSL_R_STREAM_RESET 375
Expand Down
6 changes: 3 additions & 3 deletions ssl/quic/quic_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,7 @@ static SSL *quic_conn_stream_new(QCTX *ctx, uint64_t flags, int need_lock)
* opened.
*/
if (no_blocking || !qc_blocking_mode(qc)) {
QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_STREAM_COUNT_LIMITED, NULL);
QUIC_RAISE_NON_IO_ERROR(ctx, SSL_R_STREAM_COUNT_LIMITED, NULL);
goto err;
}

Expand All @@ -1774,10 +1774,10 @@ static SSL *quic_conn_stream_new(QCTX *ctx, uint64_t flags, int need_lock)
/* Blocking mode - wait until we can get a stream. */
ret = block_until_pred(ctx->qc, quic_new_stream_wait, &args, 0);
if (!quic_mutation_allowed(qc, /*req_active=*/1)) {
QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_PROTOCOL_IS_SHUTDOWN, NULL);
QUIC_RAISE_NON_IO_ERROR(ctx, SSL_R_PROTOCOL_IS_SHUTDOWN, NULL);
goto err; /* Shutdown before completion */
} else if (ret <= 0) {
QUIC_RAISE_NON_NORMAL_ERROR(ctx, ERR_R_INTERNAL_ERROR, NULL);
QUIC_RAISE_NON_IO_ERROR(ctx, ERR_R_INTERNAL_ERROR, NULL);
goto err; /* Non-protocol error */
}
}
Expand Down

0 comments on commit 7a5f58b

Please sign in to comment.