This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

recvfrom / sendto patch


Again, moving slowly towards my readv/writev patch, here's a
little patch to simplify the fhandler_socket sendto / recvfrom
code.

SUSv3 says that recvfrom, recv, and read are all equivalent on
sockets if no flags or addresses etc. are provided (and ditto for
sendto, send, and write).  So, this patch makes that true, partly
by removing some methods and making others just delegate to each
other as appropriate.  In detail:

*) I missed a couple of buflen == 0 checks in "net.cc" from my
last patch.

*) I've removed fhandler_socket recv and send methods and made the
cygwin_recv/send functions delegate to the cygwin_recvfrom/sendto
functions, with relevant default extra arguments.

*) The fhandler_socket read and write methods also delegate now to
recvfrom and sendto (rather than to recv and send as previously).

*) In all of this I discovered that fhandler_socket::sendto
couldn't handle a NULL address: patched too.

Enjoy!

// Conrad

p.s. This saves 1.5K on the DLL size!  Happy happy, joy joy!

Attachment: ChangeLog.txt
Description: Text document

Attachment: recvsend.patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]