Christoph Zurnieden: CGI-Programme in C/C++ erstellen (unter Linux mit Apache)

Beitrag lesen

Hallo,

BTW: als Zeilenende gilt im HTTP "\r\n". Bitte merken. Den
meisten Browsern ist das zwar egal, aber im Header ist es
wichtig und wird leicht übersehen. (Passiert mir auch oft
genug ;-)

Nein, es ist *nicht* "\r\n" :) Bedenke bitte, dass "\r\n"
plattformabhaengig (lib-abhaengig?) ist.

Das ist jetzt eine gute Frage. IMHO ist es ISO C, also platformunabhängiger (ja, ich weiß) und internationaler Standard.

5.2.2 Character display semantics
[...]
1 The active position is that location on a display device where the next character output by
the fputc or fputwc function would appear.The intent of writing a printing character
(as defined by the isprint or iswprint function) to a display device is to display a
graphic representation of that character at the active position and then advance the active
position to the next position on the current line. The direction of writing is locale-
specific. If the active position is at the final position of a line (if there is one), the
behavior is unspecified.
2 Alphabetic escape sequences representing nongraphic characters in the execution
character set are intended to produce actions on display devices as follows:
\a (alert)Produces an audible or visible alert. The active position shall not be changed.
\b (backspace)Movesthe active position to the previous position on the current line. If
the active position is at the initial position of a line, the behavior is unspecified.
\f ( form feed)Movesthe active position to the initial position at the start of the next
logical page.
\n (newline)Movesthe active position to the initial position of the next line.
\r (carriage return)Movesthe active position to the initial position of the current line.
\t (horizontal tab)Movesthe active position to the next horizontal tabulation position
on the current line. If the active position is at or past the last defined horizontal
tabulation position, the behavior is unspecified.
\v (vertical tab)Movesthe active position to the initial position of the next vertical
tabulation position. If the active position is at or past the last defined vertical
tabulation position, the behavior is unspecified.
3 Each of these escape sequences shall produce a unique implementation-defined value
which can be stored in a single char object. The external representations in a text file
need not be identical to the internal representations, and are outside the scope of this
International Standard.

Mmh... doch nicht?

RFC 2616
       CR             = <US-ASCII CR, carriage return (13)>
       LF             = <US-ASCII LF, linefeed (10)>
       SP             = <US-ASCII SP, space (32)>
       HT             = <US-ASCII HT, horizontal-tab (9)>
       <">            = <US-ASCII double-quote mark (34)>

HTTP/1.1 defines the sequence CR LF as the end-of-line marker for all
   protocol elements except the entity-body (see appendix 19.3 for
   tolerant applications). The end-of-line marker within an entity-body
   is defined by its associated media type, as described in section 3.7.

CRLF           = CR LF

Aha, dann nicht.

Warum mußt Du auch immer Recht haben, ha? ;-)))

Der OP schreib von
'meist ein Linux-System', nicht jedoch *immer*. Sinnvoller
waere "\015\012" (vielleicht als ein

#define CRLF "\015\012"

oder so).

Also irgendwie kommt der mir bekannt vor, woher nur? ;-)

BTW: was ist eigentlich aus der gzip.c Version geworden? (Habe den Direktlink verschlampt und bin jetzt zu faul, mich da wieder durchzuwühlen)
Außerdem wollte ich aus dem Original ein PE-Datei bauen. Deshalb warte ich ja auch auf Deine neue Version.

so short

Christoph Zurnieden

--
/*in memoriam*/
#define goto harmfull