File tree Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Expand file tree Collapse file tree 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) {
144144 return 0 ;
145145
146146 // 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.
150147 Local<Object> session = Buffer::New (env, size).FromMaybe (Local<Object>());
151148 if (UNLIKELY (session.IsEmpty ()))
152149 return 0 ;
153150
154151 unsigned char * session_data =
155152 reinterpret_cast <unsigned char *>(Buffer::Data (session));
156153
157- memset (session_data, 0 , size);
158- i2d_SSL_SESSION (sess, &session_data);
154+ CHECK_EQ (i2d_SSL_SESSION (sess, &session_data), size);
159155
160156 unsigned int session_id_length;
161157 const unsigned char * session_id_data =
162158 SSL_SESSION_get_id (sess, &session_id_length);
163159
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
167160 Local<Object> session_id = Buffer::Copy (
168161 env,
169162 reinterpret_cast <const char *>(session_id_data),
You can’t perform that action at this time.
0 commit comments