chiark / gitweb /
pkstream/pkstream.c: Rearrange socket setup, particularly `parseaddr'.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 27 Sep 2017 19:49:00 +0000 (20:49 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 16 Jun 2018 18:14:10 +0000 (19:14 +0100)
commit3912d793312902ea53daf8300e76334a485ae8c9
tree1953fd6d6b209b9d8054a80098f2b67620223f3f
parent1afc65b695d97ffb79a023e72bf2d255f167d7f7
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.
pkstream/pkstream.c