Skip to content

Commit

Permalink
JSON_ENC: Minor tweaks
Browse files Browse the repository at this point in the history
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from #22037)
  • Loading branch information
hlandau committed Feb 2, 2024
1 parent 613917e commit 39b9345
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions include/internal/json_enc.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ int ossl_json_flush(OSSL_JSON_ENC *json);
int ossl_json_flush_cleanup(OSSL_JSON_ENC *json);

/*
* ossl_json_set_sink
* ------------------
* ossl_json_set0_sink
* -------------------
*
* Changes the sink used by the JSON encoder.
*/
int ossl_json_set_sink(OSSL_JSON_ENC *json, BIO *bio);
int ossl_json_set0_sink(OSSL_JSON_ENC *json, BIO *bio);

/*
* ossl_json_in_error
Expand Down
8 changes: 4 additions & 4 deletions ssl/quic/json_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static void wbuf_cleanup(struct json_write_buf *wbuf)
wbuf->alloc = 0;
}

static void wbuf_set_bio(struct json_write_buf *wbuf, BIO *bio)
static void wbuf_set0_bio(struct json_write_buf *wbuf, BIO *bio)
{
wbuf->bio = bio;
}
Expand Down Expand Up @@ -238,7 +238,7 @@ int ossl_json_init(OSSL_JSON_ENC *json, BIO *bio, uint32_t flags)
return 0;

json->state = STATE_PRE_COMMA;
return ossl_json_reset(json);
return 1;
}

void ossl_json_cleanup(OSSL_JSON_ENC *json)
Expand Down Expand Up @@ -273,9 +273,9 @@ int ossl_json_flush(OSSL_JSON_ENC *json)
return wbuf_flush(&json->wbuf);
}

int ossl_json_set_sink(OSSL_JSON_ENC *json, BIO *bio)
int ossl_json_set0_sink(OSSL_JSON_ENC *json, BIO *bio)
{
wbuf_set_bio(&json->wbuf, bio);
wbuf_set0_bio(&json->wbuf, bio);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion ssl/quic/qlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ int ossl_qlog_set_sink_bio(QLOG *qlog, BIO *bio)
ossl_qlog_flush(qlog); /* best effort */
BIO_free_all(qlog->bio);
qlog->bio = bio;
ossl_json_set_sink(&qlog->json, bio);
ossl_json_set0_sink(&qlog->json, bio);
return 1;
}

Expand Down

0 comments on commit 39b9345

Please sign in to comment.