$ git clone https://ion.nu/git/libsimplesocket
commit 470e4c46bf4f76e878dd66e0a4f6b7e1f7861102
Author: Alicia <...>
Date: Wed Jun 21 19:15:00 2017 +0200
Use readwrap() and writewrap() to handle SIMPLESOCK_STDIO for unencrypted data too.
diff --git a/socket.c b/socket.c
index e13d867..820b380 100644
--- a/socket.c
+++ b/socket.c
@@ -68,7 +68,7 @@ ssize_t simplesocket_read(SimpleSocket* ss, void* buf, size_t len)
{
return gnutls_record_recv(ss->tls, buf, len);
}else{
- return read(ss->sock, buf, len);
+ return readwrap(ss, buf, len);
}
}
@@ -78,7 +78,7 @@ ssize_t simplesocket_write(SimpleSocket* ss, const void* buf, size_t len)
{
return gnutls_record_send(ss->tls, buf, len);
}else{
- return write(ss->sock, buf, len);
+ return writewrap(ss, buf, len);
}
}