Re: [HACKERS] pipe chunking vs Windows

2007-07-30 Thread Andrew Dunstan
Magnus Hagander wrote: However, the problem is that in backporting it we'd make a slight behaviour change - the log file just gets LF instead of CRLF line endings. I'm inclined to say that's a better result than living with the bug, though. Can't we add back the CRLF combo when writing

Re: [HACKERS] pipe chunking vs Windows

2007-07-30 Thread Magnus Hagander
On Sun, Jul 29, 2007 at 07:43:34PM -0400, Andrew Dunstan wrote: > > > Andreas Pflug wrote: > >Andrew Dunstan wrote: > > > >>I have no idea why that's done - it goes back to the origins of the > >>syslogger - probably because someone mistakenly thinks all WIndows > >>text files have to have CRLF

Re: [HACKERS] pipe chunking vs Windows

2007-07-30 Thread Magnus Hagander
On Sun, Jul 29, 2007 at 06:31:04PM -0400, Andrew Dunstan wrote: > > > Andreas Pflug wrote: > >Andrew Dunstan wrote: > > > >>> > >>> > I have no idea why that's done - it goes back to the origins of the > syslogger - probably because someone mistakenly thinks all WIndows > tex

Re: [HACKERS] pipe chunking vs Windows

2007-07-29 Thread Andrew Dunstan
Andreas Pflug wrote: Andrew Dunstan wrote: I have no idea why that's done - it goes back to the origins of the syslogger - probably because someone mistakenly thinks all WIndows text files have to have CRLF line endings. I tried changing that to _O_BINARY, and calling _setmode on both the

Re: [HACKERS] pipe chunking vs Windows

2007-07-29 Thread korry.douglas
I have not yet succeeded in turning this behaviour off (_setmode() didn't seem to affect it). If we can't find a way to turn it off, the only solution short of abandoning its use on Windows that I can think of is to translate LF on input to something unlikely like 0x1C and then translate it b

Re: [HACKERS] pipe chunking vs Windows

2007-07-29 Thread korry.douglas
I have not yet succeeded in turning this behaviour off (_setmode() didn't seem to affect it). If we can't find a way to turn it off, the only solution short of abandoning its use on Windows that I can think of is to translate LF on input to something unlikely like 0x1C and then translate it b

Re: [HACKERS] pipe chunking vs Windows

2007-07-29 Thread Andrew Dunstan
Andreas Pflug wrote: Andrew Dunstan wrote: Not for Wordpad though, and it's pretty universal too. And Notepad won't load a file of any great size anyway. Furthermore, we just can't have this alongside the pipe chunking protocol, so I'm inclined to blow it away altogether, unless there are

Re: [HACKERS] pipe chunking vs Windows

2007-07-29 Thread Andreas Pflug
Andrew Dunstan wrote: > > Not for Wordpad though, and it's pretty universal too. And Notepad > won't load a file of any great size anyway. Furthermore, we just can't > have this alongside the pipe chunking protocol, so I'm inclined to > blow it away altogether, unless there are pretty loud squawk

Re: [HACKERS] pipe chunking vs Windows

2007-07-29 Thread Andrew Dunstan
Andreas Pflug wrote: Andrew Dunstan wrote: I have no idea why that's done - it goes back to the origins of the syslogger - probably because someone mistakenly thinks all WIndows text files have to have CRLF line endings. Yes this was intentional, notepad still doesn't lik

Re: [HACKERS] pipe chunking vs Windows

2007-07-29 Thread Andreas Pflug
Andrew Dunstan wrote: >> >>> I have no idea why that's done - it goes back to the origins of the >>> syslogger - probably because someone mistakenly thinks all WIndows >>> text files have to have CRLF line endings. Yes this was intentional, notepad still doesn't like LF line endings. Not my prefe

Re: [HACKERS] pipe chunking vs Windows

2007-07-29 Thread Andrew Dunstan
Andreas Pflug wrote: Andrew Dunstan wrote: I have no idea why that's done - it goes back to the origins of the syslogger - probably because someone mistakenly thinks all WIndows text files have to have CRLF line endings. I tried changing that to _O_BINARY, and calling _setmode on both the

Re: [HACKERS] pipe chunking vs Windows

2007-07-29 Thread Andreas Pflug
Andrew Dunstan wrote: > > I have no idea why that's done - it goes back to the origins of the > syslogger - probably because someone mistakenly thinks all WIndows > text files have to have CRLF line endings. > > I tried changing that to _O_BINARY, and calling _setmode on both the > pipe before it's

Re: [HACKERS] pipe chunking vs Windows

2007-07-29 Thread Andrew Dunstan
korry.douglas wrote: I have not yet succeeded in turning this behaviour off (_setmode() didn't seem to affect it). If we can't find a way to turn it off, the only solution short of abandoning its use on Windows that I can think of is to translate LF on input to something unlikely like 0x1C

Re: [HACKERS] pipe chunking vs Windows

2007-07-29 Thread Magnus Hagander
Andrew Dunstan wrote: >> Uh, see port.h, lines 212-224. If you're using the pipe() command to >> create it, it's used. >> > > No, it's the other way around :-) If you use pgpipe() on Unix you're > calling pipe(): D'oh. You're right, of course. I'm obviously not in a state where I should be rea

Re: [HACKERS] pipe chunking vs Windows

2007-07-29 Thread Andrew Dunstan
Magnus Hagander wrote: Andrew Dunstan wrote: I have just discovered that the recently implemented pipe chunking protocol is broken on Windows. This is because the pipes are operating in text mode and doing LF->CR-LF translation, so the number of bytes received is not the number transmitted

Re: [HACKERS] pipe chunking vs Windows

2007-07-29 Thread Magnus Hagander
Andrew Dunstan wrote: >>> I have just discovered that the recently implemented pipe chunking >>> protocol is broken on Windows. This is because the pipes are operating >>> in text mode and doing LF->CR-LF translation, so the number of bytes >>> received is not the number transmitted and set in the

Re: [HACKERS] pipe chunking vs Windows

2007-07-29 Thread Andrew Dunstan
Magnus Hagander wrote: Andrew Dunstan wrote: I have just discovered that the recently implemented pipe chunking protocol is broken on Windows. This is because the pipes are operating in text mode and doing LF->CR-LF translation, so the number of bytes received is not the number transmitted

Re: [HACKERS] pipe chunking vs Windows

2007-07-29 Thread Magnus Hagander
Andrew Dunstan wrote: > > I have just discovered that the recently implemented pipe chunking > protocol is broken on Windows. This is because the pipes are operating > in text mode and doing LF->CR-LF translation, so the number of bytes > received is not the number transmitted and set in the proto

[HACKERS] pipe chunking vs Windows

2007-07-29 Thread Andrew Dunstan
I have just discovered that the recently implemented pipe chunking protocol is broken on Windows. This is because the pipes are operating in text mode and doing LF->CR-LF translation, so the number of bytes received is not the number transmitted and set in the protocol header. I have not yet