[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Remote EOF and MinGW builds


Hi Andreas,

On 05.03.2010 10:17, Andreas Schneider wrote:
On Wednesday 03 March 2010 20:51:24 you wrote:
what about using Apache Portable Runtime (APR) or Netscape Portable
Runtime (NSPR)? Both implement poll() for Windows, Linux and Unix and
are known to be very portable and rather bug free.

we don't want to add new dependencies to libssh, so this is not an option. We
have to implement it in libssh. We can use LGPL code or ask an author if we
can use the code in libssh under LGPL or write it on our own.

this means you want to reimplement your own portable runtime. Which is from my point of view almost impossible for such a small Project. You just have to look at the code base that was needed for NSPR and APR.

But you are right the downside is that you rely on an additional library. But you have also chosen to use a cryptographic library instead of implementing you own. The same applies to zlib.

The big advantage of a portable run time is, that it is well maintained and widely spread. There is almost no computer that does not include NSPR or APR libraries.

In theory it would be possible to include the code from APR and NSPR. Both rely on a sophisticated build process to gain platform compatibility. You would have to use their build system, which is definitely not an option.

If it's ok for you I would try get the library use APR. This would fix
the problem with the poll emulation.

I see several option.

a) Implement it with WaitForMultipleObjectsEx so that it works on Windows.

b) Add a poll function using select and add an option to compile libssh with
the select version instead of WaitForMultipleObjectsEx, but then the current
problem still exists.

c) Implement select and check during runtime if WSAPoll() is available. Then
we have only support for more then 64 handels on Vista and newer.

It really sucks that WSAPoll() is not available on WinXP.

All three points you mentioned are already implemented in NSPR. They needed several thousand lines of code and tons of ifdefs to implement this. And that's the point, why reinventing the wheel? That's why I suggest trying one of the runtime libaries...

You can join the IRC channel and we can chat there. I can assist you if you
have questions.

What is a good time to catch someone in the IRC channel?

Regards

Thomas

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Follow-Ups:
Re: Remote EOF and MinGW buildsAndreas Schneider <mail@xxxxxxxxxxxx>
References:
Remote EOF and MinGW buildsThomas Schmid <schmid-thomas@xxxxxxx>
Re: Remote EOF and MinGW buildsAris Adamantiadis <aris@xxxxxxxxxxxx>
Re: Remote EOF and MinGW buildsThomas Schmid <schmid-thomas@xxxxxxx>
Re: Remote EOF and MinGW buildsAndreas Schneider <mail@xxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org