Article View: news.software.nntp
Article #35291Re: nnrpd daemon (-D) mode fixes
From: bill davidsen
Date: Wed, 10 Feb 1999 00:00
Date: Wed, 10 Feb 1999 00:00
34 lines
2314 bytes
2314 bytes
In article <873e4kprj6.fsf@erlenstar.demon.co.uk>, Andrew Gierth <andrew@erlenstar.demon.co.uk> wrote: | >>>>> "bill" == bill davidsen <davidsen@tmr.com> writes: | | bill> This patch addresses one bug (wrong data type) and one missing | bill> feature (nicekids). The type was a struct defined as | bill> sockaddr_in and used with a case where sockaddr was | bill> required. Because I'm not sure all systems will have the same | bill> size for both, and my compiler whines about the original, I | bill> defined the value correctly and dropped the cast. | | Pardon me asking, but are you new to socket programming or something? | | The original code was correct in this respect. This is why accept() | et. al. have an additional size parameter for the address. The cast is | something of a historical crock, but is nevertheless correct. When a procedure prototype requires a struct of one type, and you provide a struct of another type which mayor may not be the same size on every system, using a cast is not "correct." What is correct is to declare the struct of the proper type in the first place. It's used only in one place, so this is not "clever" use of an existing struct to save space, it's just the wrong type struct. Pardon my asking, but are you new to writing portable code or something? -- bill davidsen <davidsen@tmr.com> CTO, TMR Associates, Inc Politicians and diapers have one thing in common. They should both be changed regularly and for the same reason. --Ted Symons(?)
Technical Details
Message-ID:
<79smvr$7ni8$1@newssvr04-int.news.prodigy.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<79eufj$7nh0$1@newssvr04-int.news.prodigy.com> <873e4kprj6.fsf@erlenstar.demon.co.uk>Show Full Headers
Complete Article Headers
Message-ID: <79smvr$7ni8$1@newssvr04-int.news.prodigy.com> Subject: Re: nnrpd daemon (-D) mode fixes Date: Wed, 10 Feb 1999 00:00:00 +0000 From: davidsen@tmr.com (bill davidsen) References: <79eufj$7nh0$1@newssvr04-int.news.prodigy.com> <873e4kprj6.fsf@erlenstar.demon.co.uk> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 442920499 X-Auth-User: 000000000/63fa24af6e210e92 X-Post-Time: 10 Feb 1999 19:34:19 GMT Organization: TMR Associates, Schenectady NY X-Problems-To: abuse@prodigy.net Newsgroups: news.software.nntp Originator: davidsen@darkstar.prodigy.com