//export cbioNew func cbioNew(b *C.BIO) C.int { b.shutdown = 1 b.init = 1 b.num = -1 b.ptr = nil b.flags = 0 return 1 }
//export go_conn_bio_new func go_conn_bio_new(bio *C.BIO) C.int { //we are initializing here bio.init = C.int(1) //see mem_new() bio.num = C.int(-1) bio.ptr = nil bio.flags = C.BIO_FLAGS_READ | C.BIO_FLAGS_WRITE return C.int(1) }
//export go_conn_bio_free func go_conn_bio_free(bio *C.BIO) C.int { var conn *Conn = (*Conn)(bio.ptr) conn.conn.Close() if C.int(bio.shutdown) != 0 { bio.ptr = nil bio.flags = 0 bio.init = 0 } return C.int(1) }
func (self *writeBio) Disconnect(b *C.BIO) { if loadWritePtr(b) == self { b.ptr = nil } }
func (self *readBio) Disconnect(b *C.BIO) { if loadReadPtr(b) == self { bufPool.Put(self.buf) b.ptr = nil } }
func bioSetRetryRead(b *C.BIO) { // from BIO_set_retry_read and BIO_set_flags b.flags |= (C.BIO_FLAGS_READ | C.BIO_FLAGS_SHOULD_RETRY) }
func bioClearRetryFlags(b *C.BIO) { // from BIO_clear_retry_flags and BIO_clear_flags b.flags &= ^(C.BIO_FLAGS_RWS | C.BIO_FLAGS_SHOULD_RETRY) }
func (self *readBio) Disconnect(b *C.BIO) { if loadReadPtr(b) == self { b.ptr = nil } }
func (self *readBio) Disconnect(b *C.BIO) { if loadReadPtr(b) == self { readBioMapping.Del(token(b.ptr)) b.ptr = nil } }
func (self *writeBio) Disconnect(b *C.BIO) { if loadWritePtr(b) == self { writeBioMapping.Del(token(b.ptr)) b.ptr = nil } }