Skip to content

Commit

Permalink
Remove some redundant code from test helper BIOs
Browse files Browse the repository at this point in the history
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #22157)
  • Loading branch information
mattcaswell committed Sep 22, 2023
1 parent 0a2369f commit c29b13a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 56 deletions.
28 changes: 0 additions & 28 deletions test/helpers/noisydgrambio.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@ struct noisy_dgram_st {
uint64_t delayed_dgram;
};

static int noisy_dgram_read(BIO *bio, char *out, int outl)
{
/* We don't support this - not needed anyway */
return -1;
}

static int noisy_dgram_write(BIO *bio, const char *in, int inl)
{
/* We don't support this - not needed anyway */
return -1;
}

static long noisy_dgram_ctrl(BIO *bio, int cmd, long num, void *ptr)
{
long ret;
Expand All @@ -50,18 +38,6 @@ static long noisy_dgram_ctrl(BIO *bio, int cmd, long num, void *ptr)
return ret;
}

static int noisy_dgram_gets(BIO *bio, char *buf, int size)
{
/* We don't support this - not needed anyway */
return -1;
}

static int noisy_dgram_puts(BIO *bio, const char *str)
{
/* We don't support this - not needed anyway */
return -1;
}

static int noisy_dgram_sendmmsg(BIO *bio, BIO_MSG *msg, size_t stride,
size_t num_msg, uint64_t flags,
size_t *msgs_processed)
Expand Down Expand Up @@ -298,10 +274,6 @@ const BIO_METHOD *bio_f_noisy_dgram_filter(void)
method_noisy_dgram = BIO_meth_new(BIO_TYPE_NOISY_DGRAM_FILTER,
"Nosiy datagram filter");
if (method_noisy_dgram == NULL
|| !BIO_meth_set_write(method_noisy_dgram, noisy_dgram_write)
|| !BIO_meth_set_read(method_noisy_dgram, noisy_dgram_read)
|| !BIO_meth_set_puts(method_noisy_dgram, noisy_dgram_puts)
|| !BIO_meth_set_gets(method_noisy_dgram, noisy_dgram_gets)
|| !BIO_meth_set_ctrl(method_noisy_dgram, noisy_dgram_ctrl)
|| !BIO_meth_set_sendmmsg(method_noisy_dgram, noisy_dgram_sendmmsg)
|| !BIO_meth_set_recvmmsg(method_noisy_dgram, noisy_dgram_recvmmsg)
Expand Down
28 changes: 0 additions & 28 deletions test/helpers/pktsplitbio.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,6 @@
#include "quictestlib.h"
#include "../testutil.h"

static int pkt_split_dgram_read(BIO *bio, char *out, int outl)
{
/* We don't support this - not needed anyway */
return -1;
}

static int pkt_split_dgram_write(BIO *bio, const char *in, int inl)
{
/* We don't support this - not needed anyway */
return -1;
}

static long pkt_split_dgram_ctrl(BIO *bio, int cmd, long num, void *ptr)
{
long ret;
Expand All @@ -42,18 +30,6 @@ static long pkt_split_dgram_ctrl(BIO *bio, int cmd, long num, void *ptr)
return ret;
}

static int pkt_split_dgram_gets(BIO *bio, char *buf, int size)
{
/* We don't support this - not needed anyway */
return -1;
}

static int pkt_split_dgram_puts(BIO *bio, const char *str)
{
/* We don't support this - not needed anyway */
return -1;
}

static int pkt_split_dgram_sendmmsg(BIO *bio, BIO_MSG *msg, size_t stride,
size_t num_msg, uint64_t flags,
size_t *msgs_processed)
Expand Down Expand Up @@ -149,10 +125,6 @@ const BIO_METHOD *bio_f_pkt_split_dgram_filter(void)
method_pkt_split_dgram = BIO_meth_new(BIO_TYPE_PKT_SPLIT_DGRAM_FILTER,
"Packet splitting datagram filter");
if (method_pkt_split_dgram == NULL
|| !BIO_meth_set_write(method_pkt_split_dgram, pkt_split_dgram_write)
|| !BIO_meth_set_read(method_pkt_split_dgram, pkt_split_dgram_read)
|| !BIO_meth_set_puts(method_pkt_split_dgram, pkt_split_dgram_puts)
|| !BIO_meth_set_gets(method_pkt_split_dgram, pkt_split_dgram_gets)
|| !BIO_meth_set_ctrl(method_pkt_split_dgram, pkt_split_dgram_ctrl)
|| !BIO_meth_set_sendmmsg(method_pkt_split_dgram,
pkt_split_dgram_sendmmsg)
Expand Down

0 comments on commit c29b13a

Please sign in to comment.