Re: Patch to support multiple interfaces...
Secure chat and conferencing protocol
Brought to you by:
priikone
From: Pekka R. <pri...@ik...> - 2002-05-29 15:11:48
|
: > "here_is_variable_that_i_pass_since_i_may_need_it_later_in_the_callba : > ck_even_though_it_has_no_meaning_to_the_procedure_in_hand" argument in : > the function. You have the "context" for that. :) : So you suggest introducing a SilcAcceptNewConnectionLookupContextStruct : which has two members, fd and server, right? : No. Rather, I suggest that you change the callback function a bit, so that it takes the SilcServerKEInternalContext as context. And you allocate it in the silc_server_accept_new_connection, since it needs to be allocated anyway in the callback (assuming there is no error, and in this case the context would be freed). There isn't "fd" in that context, but there is "context" which you can use just to deliver the data you need to the callback, ie. what you need to put there is ctx->server = server, ctx->context = fd, and take the data in the callback. Then assuming there wasn't error, reuse the same context later in the function. If error, free the context. Pekka ________________________________________________________________________ Pekka Riikonen priikone at silcnet.org Secure Internet Live Conferencing (SILC) http://silcnet.org/ |