| 340 | } |
| 341 | |
| 342 | void 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 | |
| 359 | void internal_deinit(internal_context_t* ctx) { |
| 360 | // how to destroy connection factory |
no test coverage detected