Subject: Re: agent support

Re: agent support

From: Peter Stuge <>
Date: Thu, 17 Jun 2010 22:05:26 +0200

Daniel Stenberg wrote:
>> 3) Thinking this through further down the line brings up a related
>> question for me. While in many cases the agent operations would be part of
>> a program's startup, and therefore blocking for them to complete might be
>> acceptable, what if it was not - say in a gui program without bringing
>> threads into the picture. If I had an event loop style program where I
>> check for input on sockets and then call libssh2_* and other functions in
>> response to stimulus, could the same be done with the agent socket? ie do
>> my own poll on agent->fd and on session->socket_fd, then call
>> libssh2_agent_userauth() until either error or success somehow?
> Yes, you should be able to do exactly that.

No not at all. agent is an opaque structure and you can not assume
anything about it's contents. In particular, agent->fd is not used
with Pageant on Windows.

Please don't mistake libssh2 internals for the API. The API is
portable but the internals will work differently per platform.

Received on 2010-06-17