From: Ludovico C. <lud...@cs...> - 2006-11-09 09:44:16
|
Hi, I am trying to play with SIPDHT. I have two questions. The first could be a bug. In file put.c, at the end of callback put_res_handler(), line 122, there is: su_home_unref(put->p_home); So it deallocates the memory where the put object is stored, which was allocated in sipdht_put_create() at line 70: put = su_home_new(sizeof(sipdht_put_t)); So, when later someone calls sipdht_put_deinit() and sipdht_put_destroy(), they act on the put object which is no longer valid. Moreover sipdht_put_destroy() calls: su_home_unref(put->p_home); What do you think about it? Maybe line 122 should not be there? The same considerations apply to get.c. Second question: I am trying to make a client that uses sipdht, which should act as a peer and perform GETs and PUTs within the same process. The easiest way it so glue together the code from sipdht-tools, but using just one root object. This is not so nice because it opens a socket for the peer, one for each put or get, and the process connects to itself via UDP. To use just one socket I guess I should create just one agent and create different legs. So I cannot use sipdht public API, but internal one. Am I right? Thank you for you attention, Reagrds, Ludovico Cavedon |