On Nov 3, 2009, at 5:46 PM, Daniel Stenberg wrote:

On Tue, 3 Nov 2009, Dave McCaldon wrote:

Attached is a git patch that implements libssh2_trace_sethandler(), which allows trace output to be captured by an application provided callback that libssh2_trace() and debugdump() will call instead of the default of always writing to stderr.

One initial comment: apps will want a custom pointer passed in to the callback as well so that they can pass local/private data to the callback without using globals. Won't that be suitable to also set with the function and pass in as a paramter to the callback?

I do pass the LIBSSH2_SESSION pointer to allow the user to distinguish between different sessions, but you're right in that there would need to be a map from session to user data.

Attached is an update that adds a void* context to the libssh2_trace_sethandler() mechanism. I'm a bit new to git, so it looks like it builds on the previous patches. I'm not sure how to coalesce these into a single "squashed" patch ... if it's not ok in this format, let me know.

Thanks for the input!


Attachment: 0001-Added-a-context-parameter-to-the-libssh2_trace_setha.patch
Description: Binary data



_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Reply via email to