File tree 1 file changed +1
-8
lines changed
1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change @@ -144,26 +144,19 @@ int NewSessionCallback(SSL* s, SSL_SESSION* sess) {
144
144
return 0 ;
145
145
146
146
// Serialize session
147
- // TODO(@jasnell): An AllocatedBuffer or BackingStore would be better
148
- // here to start eliminating unnecessary uses of Buffer where an ordinary
149
- // Uint8Array would do just fine.
150
147
Local<Object> session = Buffer::New (env, size).FromMaybe (Local<Object>());
151
148
if (UNLIKELY (session.IsEmpty ()))
152
149
return 0 ;
153
150
154
151
unsigned char * session_data =
155
152
reinterpret_cast <unsigned char *>(Buffer::Data (session));
156
153
157
- memset (session_data, 0 , size);
158
- i2d_SSL_SESSION (sess, &session_data);
154
+ CHECK_EQ (i2d_SSL_SESSION (sess, &session_data), size);
159
155
160
156
unsigned int session_id_length;
161
157
const unsigned char * session_id_data =
162
158
SSL_SESSION_get_id (sess, &session_id_length);
163
159
164
- // TODO(@jasnell): An AllocatedBuffer or BackingStore would be better
165
- // here to start eliminating unnecessary uses of Buffer where an ordinary
166
- // Uint8Array would do just fine
167
160
Local<Object> session_id = Buffer::Copy (
168
161
env,
169
162
reinterpret_cast <const char *>(session_id_data),
You can’t perform that action at this time.
0 commit comments