Beispiel #1
0
func (b *anyBio) Read(buf []byte) (n int, err error) {
	if len(buf) == 0 {
		return 0, nil
	}
	n = int(C.BIO_read((*C.BIO)(b), unsafe.Pointer(&buf[0]), C.int(len(buf))))
	if n <= 0 {
		return 0, io.EOF
	}
	return n, nil
}
Beispiel #2
0
//Thin wrappers over OpenSSL bio.
//See BIO_read documentation for return value negative means error
//error message is gotten be calling ssl.getError()
func (bio *BIO) Read(b []byte) int {
	C.clear_sys_error()
	return int(C.BIO_read(bio.BIO, unsafe.Pointer(&b[0]), C.int(len(b))))
}
Beispiel #3
0
//Thin wrappers over OpenSSL bio.
//See BIO_read documentation for return value negative means error
//error message is gotten be calling ssl.getError()
func (self *BIO) Read(b []byte) int {
	C.clear_sys_error()
	ret := int(C.BIO_read(self.BIO, unsafe.Pointer(&b[0]), C.int(len(b))))
	return ret
}