diff options
author | Matt Caswell <matt@openssl.org> | 2016-10-20 16:18:39 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-10-28 10:48:54 +0200 |
commit | 3befffa39dbaf2688d823fcf2bdfc07d2487be48 (patch) | |
tree | 6fcba25e3d78c48e8c00966a8085b83472395ae1 /include | |
parent | Create BIO_read_ex() which handles size_t arguments (diff) | |
download | openssl-3befffa39dbaf2688d823fcf2bdfc07d2487be48.tar.xz openssl-3befffa39dbaf2688d823fcf2bdfc07d2487be48.zip |
Create BIO_write_ex() which handles size_t arguments
Also extend BIO_METHOD to be able to supply an implementation for the new
BIO_write_ex function.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/internal/bio.h | 4 | ||||
-rw-r--r-- | include/openssl/bio.h | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/include/internal/bio.h b/include/internal/bio.h index f840bcd32c..e1fe62af3e 100644 --- a/include/internal/bio.h +++ b/include/internal/bio.h @@ -12,7 +12,8 @@ struct bio_method_st { int type; const char *name; - int (*bwrite) (BIO *, const char *, int); + int (*bwrite) (BIO *, const char *, size_t, size_t *); + int (*bwrite_old) (BIO *, const char *, int); int (*bread) (BIO *, char *, size_t, size_t *); int (*bread_old) (BIO *, char *, int); int (*bputs) (BIO *, const char *); @@ -28,4 +29,5 @@ void bio_cleanup(void); /* Old style to new style BIO_METHOD conversion functions */ +int bwrite_conv(BIO *bio, const char *in, size_t inl, size_t *written); int bread_conv(BIO *bio, char *out, size_t outl, size_t *read); diff --git a/include/openssl/bio.h b/include/openssl/bio.h index b4b1e0acbc..d04946cfa5 100644 --- a/include/openssl/bio.h +++ b/include/openssl/bio.h @@ -556,6 +556,7 @@ int BIO_read(BIO *b, void *data, int len); int BIO_read_ex(BIO *b, void *out, size_t outl, size_t *read); int BIO_gets(BIO *bp, char *buf, int size); int BIO_write(BIO *b, const void *data, int len); +int BIO_write_ex(BIO *b, const void *in, size_t inl, size_t *written); int BIO_puts(BIO *bp, const char *buf); int BIO_indent(BIO *b, int indent, int max); long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg); @@ -743,8 +744,12 @@ __bio_h__attr__((__format__(__printf__, 3, 0))); BIO_METHOD *BIO_meth_new(int type, const char *name); void BIO_meth_free(BIO_METHOD *biom); int (*BIO_meth_get_write(BIO_METHOD *biom)) (BIO *, const char *, int); +int (*BIO_meth_get_write_ex(BIO_METHOD *biom)) (BIO *, const char *, size_t, + size_t *); int BIO_meth_set_write(BIO_METHOD *biom, int (*write) (BIO *, const char *, int)); +int BIO_meth_set_write_ex(BIO_METHOD *biom, + int (*bwrite) (BIO *, const char *, size_t, size_t *)); int (*BIO_meth_get_read(BIO_METHOD *biom)) (BIO *, char *, int); int (*BIO_meth_get_read_ex(BIO_METHOD *biom)) (BIO *, char *, size_t, size_t *); int BIO_meth_set_read(BIO_METHOD *biom, @@ -812,6 +817,7 @@ int ERR_load_BIO_strings(void); # define BIO_F_BIO_SOCK_INFO 141 # define BIO_F_BIO_SOCK_INIT 112 # define BIO_F_BIO_WRITE 113 +# define BIO_F_BIO_WRITE_EX 119 # define BIO_F_BUFFER_CTRL 114 # define BIO_F_CONN_CTRL 127 # define BIO_F_CONN_STATE 115 |