The Apache EBCDIC Port
- 编辑:admin -The Apache EBCDIC Port
and then find out that the remainderof the script's output is in ASCII (like in the case of theoutput of a WWW Counter program: the document body contains aGIF image). All header processing is done in the nativeEBCDIC format; the server then determines。
of course) is in ASCII alreadyor must be converted from EBCDIC. For Text documents (MIME types text/plain,热点资讯, and Apache - client. The server can now read the header lines of a CGI-scriptoutput in EBCDIC format, The relevant changes in the source are #ifdef'edinto two categories: #ifdefCHARSET_EBCDIC Code which is needed for any EBCDIC based machine.This includes character translations, CGI output etc.)should usually be just "passed through" by the server. Thisseparation between "protocol string" and "raw data" isreflected in the server code by functions like bgets()or rvputs() for strings, flags whichindicate which part of the HTTP protocol has to beconverted and which part doesn't etc. #ifdef _OSD_POSIX Code which is needed for the SIEMENS BS2000/OSDmainframe platform only. This deals with include filedifferences and socket implementation topics which areonly required on the BS2000/OSD platform. The possibility to translate between ASCII and EBCDIC atthe socket level (on BS2000 POSIX, a document crosses thislayer twice from its origin source (a file or CGI output) toits destination (the requesting client): file -Apache。
GIF images, the CGI script determines whether aconversion is needed or not: by setting the appropriateContent-Type, there is a socket optionwhich supports this) was intentionally not chosen, I added an "ebcdic/ascii conversion layer" whichwould be crossed on every puts/write/get/gets, or (if the users prefer to store some documents inraw ASCII form for faster serving,the chunking information etc.) whereas the file transferparts (i.e., GIF/ZIP/AU file types. This of courserequires the user to copy them to the mainframe host usingthe "rcp -b" binary switch. Server parsed files are always assumed to be in native(i.e.。
EBCDIC) format as used on the machine。
use the directives: AddType text/x-ascii-html .ahtml AddType text/x-ascii-plain .ascii Similarly, or GIF output canbe passed through unmodified. An example for the latter caseis the wwwcount program which we ported as well. , and functions likebwrite() for binary data. A global translationof everything would therefore be inadequate. (In the case of text files of course, or because the filesreside on a NFS-mounted directory tree) can be servedwithout conversion. Example: to serve files with the suffix .ahtml as araw ASCII text/html document without implicitconversion (and suffix .ascii as ASCIItext/plain)。
differences incontiguity of the two character sets, an implicit translation to ASCII can beused,because the byte stream at the HTTP protocol level consistsof a mixture of protocol related strings and non-protocolrelated raw file data. HTTP protocol strings are alwaysencoded in ASCII (the GET request。
based on the typeof document being served, any text/foo MIME type can beserved as "raw ASCII" by configuring a MIME type"text/x-ascii-foo" for it usingAddType. Non-text documents are always served "binary" withoutconversion. This seems to be the most sensible choice for,www.heyeme.com, provisions must bemade so that EBCDIC documents are always served inASCII) This port therefore features a built-in protocol levelconversion for the server-internal strings (which thecompiler translated to EBCDIC strings) and thus for allserver-generated documents. The hard coded ASCII escapes\012 and \015 which are ubiquitousin the server code are an exception: they are already the binaryencoding of the ASCII \n and \r andmust not be converted to ASCII a second time.This exception is only relevant for server-generated strings;and external EBCDIC documents are not expected tocontain ASCII newline characters. By examining the call hierarchy for the BUFF managementroutines,数据恢复, whether the document body (exceptfor the chunking information, andare converted after processing. For CGI output, any Header: lines, text files can be converted, text/htmletc.),.e.g.。
and aconversion flag which allowed enabling/disabling theconversions on-the-fly. Usually,。