22 #ifndef SRC_NODE_CRYPTO_BIO_H_ 23 #define SRC_NODE_CRYPTO_BIO_H_ 25 #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 27 #include "openssl/bio.h" 40 initial_(kInitialBufferLength),
52 static BIO* NewFixed(
const char*
data,
size_t len);
54 void AssignEnvironment(Environment* env);
57 void TryMoveReadHead();
60 void TryAllocateForWrite(
size_t hint);
63 size_t Read(
char* out,
size_t size);
71 char* Peek(
size_t* size);
75 size_t PeekMultiple(
char** out,
size_t* size,
size_t* count);
79 size_t IndexOf(
char delim,
size_t limit);
85 void Write(
const char*
data,
size_t size);
89 char* PeekWritable(
size_t* size);
92 void Commit(
size_t size);
96 inline size_t Length()
const {
100 inline void set_initial(
size_t initial) {
104 static inline NodeBIO* FromBIO(BIO* bio) {
105 CHECK_NE(bio->ptr,
nullptr);
106 return static_cast<NodeBIO*
>(bio->ptr);
110 static int New(BIO* bio);
111 static int Free(BIO* bio);
112 static int Read(BIO* bio,
char* out,
int len);
113 static int Write(BIO* bio,
const char*
data,
int len);
114 static int Puts(BIO* bio,
const char* str);
115 static int Gets(BIO* bio,
char* out,
int size);
116 static long Ctrl(BIO* bio,
int cmd,
long num,
120 static const size_t kInitialBufferLength = 1024;
121 static const size_t kThroughputBufferLength = 16384;
123 static const BIO_METHOD
method;
127 Buffer(Environment* env,
size_t len) :
env_(env),
132 data_ =
new char[
len];
134 env_->isolate()->AdjustAmountOfExternalAllocatedMemory(len);
139 if (
env_ !=
nullptr) {
140 const int64_t len =
static_cast<int64_t
>(len_);
141 env_->isolate()->AdjustAmountOfExternalAllocatedMemory(-len);
163 #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 165 #endif // SRC_NODE_CRYPTO_BIO_H_
union node::cares_wrap::@8::CaresAsyncData::@0 data
size_t Length(Local< Value > val)
MaybeLocal< Object > New(Isolate *isolate, Local< String > string, enum encoding enc)