diff options
| author | Jean-Paul Calderone <exarkun@divmod.com> | 2009-04-30 20:24:35 -0400 |
|---|---|---|
| committer | Jean-Paul Calderone <exarkun@divmod.com> | 2009-04-30 20:24:35 -0400 |
| commit | 3ad85d430dc8d29c46c95924293b649d70cd7afe (patch) | |
| tree | 33f9e888bf4d4bc1afd216b65cbf5951eca0de62 /src | |
| parent | aff0fc484f5526844ec43e91eec4d48bd605c70b (diff) | |
| download | pyopenssl-3ad85d430dc8d29c46c95924293b649d70cd7afe.tar.gz | |
add Connection.bio_shutdown
Diffstat (limited to 'src')
| -rwxr-xr-x | src/ssl/connection.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/ssl/connection.c b/src/ssl/connection.c index 9abb736..1dff37c 100755 --- a/src/ssl/connection.c +++ b/src/ssl/connection.c @@ -23,8 +23,8 @@ #endif #define SSL_MODULE +#include <openssl/bio.h> #include <openssl/err.h> - #include "ssl.h" /** @@ -319,7 +319,7 @@ ssl_Connection_bio_write(ssl_ConnectionObj *self, PyObject *args) /* * There was a problem with the BIO_write of some sort. */ - handle_bio_errors(self->from_ssl, ret); + handle_bio_errors(self->into_ssl, ret); return NULL; } @@ -770,6 +770,25 @@ ssl_Connection_accept(ssl_ConnectionObj *self, PyObject *args) return tuple; } +static char ssl_Connection_bio_shutdown_doc[] = "\n\ +When using non-socket connections this function signals end of\n\ +data on the input for this connection.\n\ +\n\ +Arguments: self - The Connection object\n\ + args - The Python argument tuple, should be empty.\n\ +Returns: Nothing\n\ +"; + +static PyObject * +ssl_Connection_bio_shutdown(ssl_ConnectionObj *self, PyObject *args) +{ + BIO_set_mem_eof_return(self->into_ssl, 0); + Py_INCREF(Py_None); + return Py_None; +} + + + static char ssl_Connection_shutdown_doc[] = "\n\ Send closure alert\n\ \n\ @@ -1127,6 +1146,7 @@ static PyMethodDef ssl_Connection_methods[] = ADD_METHOD(connect), ADD_METHOD(connect_ex), ADD_METHOD(accept), + ADD_METHOD(bio_shutdown), ADD_METHOD(shutdown), ADD_METHOD(get_cipher_list), ADD_METHOD(makefile), |
