From: Mark Wooding Date: Wed, 27 Sep 2017 19:49:00 +0000 (+0100) Subject: pkstream/pkstream.c: Rearrange socket setup, particularly `parseaddr'. X-Git-Tag: 1.5.0~41^2~54 X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/commitdiff_plain/3912d793312902ea53daf8300e76334a485ae8c9?hp=3912d793312902ea53daf8300e76334a485ae8c9 pkstream/pkstream.c: Rearrange socket setup, particularly `parseaddr'. * Have `parseaddr' fill in a socket address structure directly. * Change the interface to pass in either separate host and service (does this remind you of anything?) names, or a single combined string to be parsed apart, as indicated by a new flag `paf_parse'. * Have `main' keep track of the various host and service name strings and then sort everything out at the end, rather than exercising the resolver during option parsing. Take advantage of this by diagnosing incompatible option combinations. * To make this work, upgrade `cw.peer' to be full socket address. * Factor out socket-address initialization, and initialize the structures on demand rather than in advance. ---