MCPcopy Create free account
hub / github.com/HumbleNet/HumbleNet / internal_register_protocol

Function internal_register_protocol

src/humblenet/src/libsocket.cpp:342–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340}
341
342void internal_register_protocol( internal_context_t* ctx, const char* name, internal_callbacks_t* callbacks ) {
343 internal_callbacks_t cb = *callbacks;
344 sanitize_callbacks( cb );
345
346 ctx->protocols.insert( std::make_pair( std::string(name), cb ) );
347 // TODO: Sanatize callbacks
348
349 libwebsocket_protocols* protocol = protocols + ctx->protocols.size();
350 // make sure the next protocols is "empty"
351 *(protocol + 1) = *protocol;
352 // now copy the prior record
353 *protocol = *(protocol-1);
354 // and update the name
355 protocol->name = name;
356 protocol->protocol_index++;
357}
358
359void internal_deinit(internal_context_t* ctx) {
360 // how to destroy connection factory

Callers 1

register_protocolFunction · 0.85

Calls 3

sanitize_callbacksFunction · 0.85
insertMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected