libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] Remove plibc?


From: LRN
Subject: Re: [libmicrohttpd] Remove plibc?
Date: Sun, 26 Jan 2014 19:23:19 +0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Thunderbird/29.0a1

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 26.01.2014 18:29, Evgeny Grin wrote:
> On 26.01.2014, 04:21, "LRN" wrote:
>> Going back to the list of imports: Wrappers that ARE needed
>> (require errno conversion): _win_recv _win_send _win_accept 
>> _win_socket
>> 
>> Wrappers that are NOT needed, but are good to have for error
>> reporting (again, they do errno conversion): _win_setsockopt 
>> _win_bind _win_listen
>> 
>> Implementations (may or may not be simplified, depends on the
>> case): _win_mmap _win_munmap _win_select _win_socketpair 
>> _win_strerror
>> 
>> Wrappers that are not needed: _win_close - define CLOSE(s)
>> closesocket(s) _win_shutdown - define SHUTDOWN(s) shutdown(s) 
>> _win_write - wrapper
>> 
>> Utility functions that are likely not needed: 
>> _SetErrnoFromWinError - client and wrapper/implementation code
>> will be synchronized with regards to error handling (i.e. the
>> function will only convert the errors that the caller checks
>> for), so this generic function is only needed for error reporting
>> (and having actual W32 error codes is usually better for that
>> purpose anyway). plibc_init     - they mostly do unneeded stuff,
>> however WS2 startup plibc_shutdown - and cleanup functions may
>> need to be called in MHD.
>> 
>> Implementations that are not needed (already in MHD): 
>> _win_tdelete _win_tfind _win_tsearch
> 
> Good! So, to remove plibc form code we need: * implement simplified
> errnoFromLastErr() * add _win_recv, _win_send, _win_accept,
> _win_socket, _win_setsockopt, _win_bind and _win_listen to MHD. And
> all of them will be { _type ret = func(); errnoFromLastErr(); 
> return ret; } For compilers with inline support they can be
> inlined.

Yep

> 
> * add simplified implementation of _win_socketpair(). I'd name it
> MHD_pipe and remove #ifdef from code.
There may be objections from grothoff's side. I, personally, don't care.

> * add very simplified implementation of _win_strerror(): it must
> process only winsock specific errors and call host strerror() for
> rest of errors. * add native Win32 parts to memorypool.c

Yep

> 
> Is implementation of select() really required? Isn't simple wrapper
> enough?

No, since we don't deal with pipes anymore, it's OK to call WS2
select() (well, it's _probably_ ok)


- -- 
O< ascii ribbon - stop html email! - www.asciiribbon.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)

iQEcBAEBAgAGBQJS5ShmAAoJEOs4Jb6SI2CwjWsIALqDiGvyImIkQEDGJpZY9fuz
jtQpAfeYNRMjCctzJtmjs/XA6j9KCRGYlmRCbYCftb5K57APcGdOLebfl4oEzvMX
ZqW6Sg8Smf/ISNkSAINQ/ylPbUXM4+jkViskZ+rYO4RsDxKDxTsgHcvAelW0HHyq
JAyYiBFKIjK7K2Tq+e7Vz9/ccyVphpLzEs/bMuwT8yJ+jDvrxSCBs58ODGIdD3P1
B0JjZnv0a+rthRfew181XKhwbjyYpF72WCJIAWaISKCvrCJqumUUMw8zqpAL+kgT
yfgKw3NfkJ9LblO98YKghXFynC6Ntm8wtLx8UELWg5Ew8GLQPHdL9sE0mA5SbSc=
=EuOJ
-----END PGP SIGNATURE-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]