home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 1 / AU_CD1.iso / internet / arcweb / !ArcWeb / Protocol < prev    next >
Text File  |  1995-01-31  |  28KB  |  590 lines

  1. /*
  2.  * Arcweb
  3.  *
  4.  * Copyright (C) Stewart Brodie, 1994, 1995
  5.  *
  6.  * This product is supplied under the terms laid down in the `Terms' file.
  7.  *
  8.  * This file: Protocol
  9.  *
  10.  *   For Arcweb versions 0.12 and later (until superceded)
  11.  *
  12.  *
  13.  *
  14.  *   Changes from protocol in version 0.11
  15.  *      Extended URL protocol defined
  16.  *      - in *Request message blocks
  17.  *      - notes about ownership of file handles
  18.  *      - in comments about the Flags word
  19.  *      - comments about how to handle Location: header from HTTP servers
  20.  *      Message_ArcwebEMailRequest/Done added
  21.  *      Handling of bit 27 in non-extended URL messages
  22.  *      In Other Notes: comment about expiry dates updated
  23.  *      Warning about setting type bits in Done messages
  24.  *      Renderer protocol warnings added
  25.  *      Sender protocol renamed to Poster protocol
  26.  *      EMail protocol added (uses a new bit in flags)
  27.  *      Suggestion about intelligent HTTP fetchers prefetching images
  28.  *      Message_ArcwebAbortRequest added   + description
  29.  *      Message_ArcwebTransferStatus added + description
  30.  *
  31.  */
  32.  
  33. This file describes the protocols used by Arcweb.  There are seven protocols
  34. planned, although only the first three are fully implemented so far.
  35.  
  36.  
  37.   * Fetcher Protocol
  38.   * Renderer Protocol
  39.   * Quit Protocol
  40.   * Extended URL Protocol
  41.   * Poster Protocol
  42.   * Email Protocol
  43.   * Expire Protocol
  44.  
  45.  
  46. Programmers supporting these protocols must be extremely careful with their
  47. memory, message and protocol management.  The protocols are allowed to be
  48. concurrent and nested.
  49.  
  50. The obvious example is that a renderer may find an inline image in a
  51. document, and will hence want to issue a request to fetch it.  A not so
  52. obvious example is an intelligent HTTP fetcher which tries to intelligently
  53. scan the returned document (if it was HTML) to pick out <img> tags and kick
  54. off requests for these in-lined images so that when ArcWeb comes to ask for
  55. them, a swifter reply can be made.  The impact of such a system would be
  56. more noticable, the more images there are inlined in a document.
  57.  
  58.  
  59. General
  60. =======
  61.  
  62.   Each protocol consists of 2 messages, a "Request" and a "Done". The
  63. Request is sent with event code 18 to force an acknowledgement.  The
  64. fetcher/renderer should acknowledge with the Done message to prevent the
  65. Wimp returning the message to the originator.  Should the fetcher/renderer
  66. wish to call Wimp_Poll before it is ready to send the Done reply, it MUST ack
  67. the message (ie. fill in the ref fields and reply with event type 19 to
  68. prevent the Wimp returning it to the originator), and then send the Done
  69. message when it is ready (having remembered to fill in the your_ref field
  70. from the my_ref of the original Request).
  71.  
  72.   Instead of sending a Wimp acknowledgement with event type 19 to prevent
  73. delivery failure, as mentioned above, it would be much better to actually
  74. reply with a Message_ArcwebTransferStatus, which doubles both as the ack and
  75. as a useful message.
  76.  
  77.   C programmers will want to use requester.h to define the structures used. 
  78. The types have been divorced from any Wimp library, only char, void and int
  79. types have been used.
  80.  
  81. For an example of a Fetcher, see !ArcwebLcl application supplied.  For an
  82. example of a Renderer, see !ArcwebImg application supplied.  ArcWeb
  83. broadcasts a RenderRequest even for HTML and plain text files, as it listens
  84. for RenderRequest messages itself (and this allows it to be overridden, when
  85. I have put the configuration bit in, by ignoring the message).
  86.  
  87.  
  88. Messages
  89. ========
  90.  
  91. buf is the buffer returned from Wimp_Poll (&e->data in Risc_OSlib).  The
  92. obvious fields have been omitted (ie. buf+0 to buf+12).
  93. The 'Private Arcweb handle' must always be preserved, as this is the only
  94. way Arcweb can deliver replies to the request originator.
  95.  
  96. The types of each entry are given:  str0 = zero terminated string.  strN = 
  97. string whose length is defined elsewhere.  str0/N = string zero terminated
  98. unless it is maximum length (defined elsewhere) in which case the terminator
  99. is missing; date5 = 5 byte date string (in UTC) as returned by OS_Word 14,3
  100.  
  101. The buffers are all defined together and then explained below.  requester.h
  102. contains C structures for these messages.
  103.  
  104.  
  105.  
  106.  
  107. Message_ArcwebFetchRequest      (msg_Arcweb__base +  0)
  108.  
  109.         buf+16  int     Message_ArcwebFetchRequest      (0x4A240)
  110.         buf+20  void*   Private Arcweb handle
  111.         buf+24  int     Flags
  112.         buf+28  int     RISC OS file handle (source)
  113.  
  114. EITHER  buf+32  str0    Uniform Resource Locator (fully qualified)
  115.  
  116.     OR  buf+32  int     RISC OS file handle (URL) (if flags bit 22 set)
  117.  
  118.  
  119. Message_ArcwebFetchDone         (msg_Arcweb__base +  1)
  120.  
  121.         buf+12  int     my_ref from Message_ArcwebFetchRequest
  122.         buf+16  int     Message_ArcwebFetchDone         (0x4A241)
  123.         buf+20  void*   Private Arcweb handle
  124.         buf+24  int     Flags
  125.  
  126.  EITHER buf+28  str0    Error message
  127.  
  128.      OR buf+28  int     Zero=this item has an expiry date
  129.         buf+32  int     Non-zero=use default expiry delay
  130.         buf+36  date5   Expiry date in UTC (if buf+32 zero, and buf+28 zero)
  131.  
  132.  
  133. Message_ArcwebRenderRequest     (msg_Arcweb__base +  2)
  134.  
  135.         buf+16  int     Message_ArcwebRenderRequest     (0x4A242)
  136.         buf+20  void*   Private Arcweb handle
  137.         buf+24  int     flags
  138.         buf+28  int     RISC OS file handle (source)
  139.         buf+32  int     RISC OS file handle (temporary)
  140.         buf+36  int     RISC OS file handle (diagram)
  141.         buf+40  int     RISC OS file handle (link)
  142.         buf+44  int     size of data following
  143.         buf+48  ---     (contents of buf+44) bytes of source file
  144.  
  145. Message_ArcwebRenderDone        (msg_Arcweb__base +  3)
  146.  
  147.         buf+16  int     Message_ArcwebRenderDone        (0x4A243)
  148.         buf+20  void*   Private Arcweb handle
  149.         buf+24  int     flags
  150.         buf+28  str0    error message
  151.  
  152.  
  153. Message_ArcwebPostRequest       (msg_Arcweb__base +  4)
  154.  
  155.         buf+16  int     Message_ArcwebPostRequest       (0x4A244)
  156.         buf+20  void*   Private Arcweb handle
  157.         buf+24  int     flags
  158.         buf+28  int     RISC OS file handle (source)
  159.         buf+32  int     RISC OS file handle (form)
  160.  
  161. EITHER  buf+36  str0    Uniform Resource Locator (if flags bit 22 clear)
  162.  
  163.     OR  buf+36  int     RISC OS file handle (URL) (if flags bit 22 set)
  164.  
  165. Message_ArcwebPostDone          (msg_Arcweb__base +  5)
  166.  
  167.         buf+12  int     my_ref from Message_ArcwebPostRequest
  168.         buf+16  int     Message_ArcwebPostDone          (0x4A245)
  169.         buf+20  void*   Private Arcweb handle
  170.         buf+24  int     flags
  171.  
  172.  EITHER buf+28  str0    Error message
  173.  
  174.      OR buf+28  int     Zero=this item has an expiry date
  175.         buf+32  int     Non-zero=use default expiry delay
  176.         buf+36  date5   Expiry date in UTC (if buf+32 zero, and buf+28 zero)
  177.  
  178. Message_ArcwebEMailRequest      (msg_Arcweb__base +  6)
  179.  
  180.         buf+16  int     Message_ArcwebEMailRequest      (0x4A246)
  181.         buf+20  void*   Private Arcweb handle
  182.         buf+24  int     flags
  183.         buf+28  int     RISC OS file handle (form file containing e-mail)
  184.  
  185. Message_ArcwebEMailDone         (msg_Arcweb__base +  7)
  186.  
  187.         buf+12  int     my_ref from Message_ArcwebEMailRequest
  188.         buf+16  int     Message_ArcwebEMailDone         (0x4A247)
  189.         buf+20  void*   Private Arcweb handle
  190.         buf+24  int     flags
  191.  
  192.  
  193. Message_ArcwebQuit              (msg_Arcweb__base + 32)
  194.  
  195.         buf+16  int     Message_ArcwebQuit              (0x4A260)
  196.  
  197.  
  198. Message_ArcwebExpire            (msg_Arcweb__base + 33)
  199.  
  200.         buf+16  int     Message_ArcwebExpire            (0x4A261)
  201.         buf+20  void*   Private Arcweb handle
  202.         buf+24  int     flags
  203.         buf+28  int     RISC OS file handle (source)
  204.  
  205. Message_ArcwebAbortRequest      (msg_Arcweb__base + 34)
  206.  
  207.         buf+16  int     Message_ArcwebAbortRequest      (0x4A262)
  208.         buf+20  void*   Private Arcweb handle
  209.         buf+24  int     reserved
  210.         buf+28  str0    reason for abort (could log this)
  211.  
  212. Message_ArcwebTransferStatus    (msg_Arcweb__base + 35)
  213.  
  214.         buf+16  int     Message_ArcwebTransferStatus    (0x4A263)
  215.         buf+20  void*   Private Arcweb handle from ..Request
  216.         buf+24  int     reserved, must be zero
  217.         buf+28  int     status flags
  218.         buf+32  int     total size of data to be transmitted
  219.         buf+36  int     size of data transmitted so far
  220.         buf+40  int     total size of data to be received (if known)
  221.         buf+44  int     size of data received so far
  222.         buf+48  str0    current status of communication
  223.  
  224.  
  225. Ownership of File Handles
  226. =========================
  227.  
  228. Some people have expressed concern at the apparent capability to lose track
  229. of which task 'owns' the RISC OS file handles passed in the messages.  This
  230. section will clarify this.
  231.  
  232. The task which sends the FetchRequest/RenderRequest/PostRequest message will
  233. have called OS_Find to open the file, and this task (normally ArcWeb itself)
  234. owns the returned file handle UNTIL it calls Wimp_Poll.  At this point, the
  235. Wimp will start delivering the Request message to each task in turn.  While
  236. the Wimp is doing this the file handle is in limbo (in effect, it is
  237. 'lost').
  238.  
  239. There are two possible continuations:
  240.  
  241. i) As soon as a task receives the Request message and decides that it wishes
  242. to reply to the Request message, it will either send the corresponding Done
  243. message, OR just ack it with the intention on replying properly later.  It
  244. is upon the sending of this Done message, or Ack, (the call to
  245. Wimp_SendMessage) that the task becomes the owner of the file handle, and
  246. hence responsible for closing the file handle when it is finished with.
  247.  
  248. ii) The other scenario is when *no* task wants to reply to the Request
  249. message. In this case, the Wimp will deliver an event code 19 copy of the
  250. message to the originator.  The originator now regains ownership of the file
  251. handle and is responsible for it (ArcWeb closes the file(s) and generates
  252. an error if this is sensible).
  253.  
  254. In general, for any task, if it receives a Request message, it is guaranteed
  255. to have exclusive use of the file handle until it next calls Wimp_Poll.
  256.  
  257. This system ensures that ownership of the file is guaranteed to be allocated
  258. to one particular task in the system at any time, and that a task has to
  259. 'claim' ownership explicitly, as shown in (i) above.
  260.  
  261.  
  262.  
  263. Flags
  264. =====
  265.  
  266. The Flags word contains several useful bits of information:
  267.  
  268.         bits 0-15       RISC OS file type/ArcWeb file type (see bits 16,30)
  269.         bit  16         If set, bits 0-15 are ArcWeb file type, else RISC OS
  270.         bits 17-19      Reserved (must preserve in replies)
  271.         bit  20         If set, the user has disabled image fetching
  272.         bit  21         If set, the email message is already complete
  273.         bit  22         If set, an extended URL is in use
  274.         bit  23         If set, ArcWeb will not display the results of the render
  275.         bit  24         If set (+bit 31 set), ArcWeb will not raise an error
  276.         bit  25         If clear, this is a 'page' fetch, else inline data
  277.         bit  26         If set, ArcWeb will close the window which issued request
  278.         bit  27         If set, extended URL has changed
  279.         bit  28         If set, symbolic link request/confirm
  280.         bit  29         If set, ArcWeb will not attempt to render the file
  281.         bit  30         If set, bits 0-16 are valid, else they are invalid
  282.         bit  31         If set, buffer contains an error message
  283.  
  284. The error bit (31) determines which of the options in two of the messages
  285. above, is in force.  If the error bit is set, ArcWeb will raise an error to
  286. the user UNLESS bit 24 is also set (indicating that the other application
  287. has already handled this - this is the preferred way of doing it).
  288.  
  289. When a request to fetch a new page is issued, ArcWeb remembers which window
  290. (if any) launched the request.  Once a successful RenderDone has been
  291. delivered to the window, it will self-destruct if bit 26 is set.  ArcWeb
  292. will set this bit itself according to the user's choice, and so this bit
  293. should always be preserved, unless you absolutely want to set it (see bit 23
  294. below).  That window is not allowed to launch further requests until the
  295. whole transaction is completed.  This blocked state is indicated to the user
  296. by the web animation in the information window for a busy page.
  297.  
  298. If you find that bit 22 is set upon receipt of a Request involving a URL,
  299. then the buffer will not contain a URL, but a file handle of a file that
  300. does.  The file will have been opened in R/W mode with OS_Find.  You should
  301. read the whole of the file to obtain the URL.  It may be terminated by a
  302. whitespace character, or by EOF.  You must close the file as you would
  303. normally with a ..Request message.
  304.  
  305. If, during a conversation with an HTTP server, you receive a Location:
  306. directive indicating a document relocation, then you should amend the
  307. contents of the extended URL file to represent the new target URL.  You must
  308. set flag bit 27 in the Done message (which you don't send immediately - you
  309. pretend as though you had received the new URL from the Request message). 
  310. The transparent obedience to Location: directives is not strictly required
  311. (and the change cannot be signalled to ArcWeb if the extended URL protocol
  312. is not being used), but is MOST HIGHLY ENCOURAGED.
  313.  
  314.  
  315. If bit 23 is set in RenderDone, Arcweb will not display the results of the
  316. render.  This is to allow applications such as image renderers to open their
  317. own window to display the picture.  This must NOT be done if bit 25 is set
  318. (as someone else is trying to render an inline image).  If bit 25 is set,
  319. the application must convert the image into a sprite file and store it in
  320. the 'diagram' file.  If you set bit 23, it is a good idea to clear bit 26 in
  321. order not to confuse the user.
  322.  
  323. Upon receipt of a FetchRequest message, the application should check bit 28. 
  324. If bit 28 is set, then the application may opt to retrieve the file to its
  325. own private directory and store the name of the file in the 'source' file. 
  326. If it declines to do this (or bit 28 is clear anyway), bit 28 should be
  327. cleared on the response and the fetched file placed in 'source'.
  328.  
  329. If bit 21 is set on receipt of a EMailRequest message, then this indicates
  330. that the form file contains a complete e-mail message ready to be mailed
  331. off (excluding From: header).  If bit 21 is clear, then this indicates that
  332. the helper application needs to open some kind of editor to allow the user
  333. to complete the e-mail.  The editor should be initialised with the contents
  334. of the form file.  If it is going to do anything at all, then the helper
  335. application must reply with a EMailDone message.
  336.  
  337. Bit 20 is used by ArcWeb to indicate to fetchers that the user has
  338. specifically requested that images are not fetched and rendered.  This
  339. allows 'intelligent' HTTP fetchers mentioned at the start of this document,
  340. to parse the HTML responses to its fetches and immediately kick off the
  341. transfers for these images before the render of the document begins.  If bit
  342. 20 is set, then the fetcher should not do this.
  343.  
  344.  
  345.  
  346. Message_ArcwebAbortRequest
  347. ==========================
  348.  
  349. Upon receipt of this message, the fetcher application retrieving a URL under
  350. the given Arcweb Private handle, should terminate the fetch with an error. 
  351. It should acknowledge this message with Message_ArcwebFetchDone, after
  352. setting the flags correctly indicating some kind of error.  All active
  353. fetches associated with the handle should be stopped.  This allows
  354. intelligent fetchers to stop any automatic fetches that they might have
  355. issued, to fetch inlined images.
  356.  
  357. At the choice of the FETCHER, it may decide to ignore the AbortRequest and
  358. continue fetching data.  The most obvious situation in which this is useful
  359. is if the fetch is large and nearly complete anyway - say less than 1 second
  360. estimated to completion.  You must acknowledge the AbortRequest with a
  361. FetchDone, in the usual manner (ie. you can acknowledge the message first,
  362. then send a reply later).  The amount of time may be configurable in the
  363. fetcher, but should not exceed a few seconds as this may confuse the user.
  364.  
  365.  
  366.  
  367. Message_ArcwebTransferStatus
  368. ============================
  369.  
  370. A fetcher which wishes to inform the user of the status of the communication
  371. between itself and the remote information server (FTP, HTTP, Gopher, etc..)
  372. may use this message to inform the browser of its progress.  The 4 size
  373. elements in the message may be used by the browser to create a graphical
  374. representation of the communication status.  Values of -1 should be known
  375. for unknown quantities (0 is reserved for indicating no bytes yet
  376. transferred or expected).  The browser may choose to ignore these values and
  377. rely on the description string, which should say something like:
  378.  
  379. 1000 bytes out of 2000 byte document read
  380. 0 bytes out of 16384 bytes of inlined image read
  381. Looking up louis.ecs.soton.ac.uk ...
  382.  
  383. or whatever it feels is appropriate.  Fetcher writers must recognise that
  384. the browser may attempt to display these messages in an icon, and will hence
  385. be issuing redraw requests (even if only via Wimp_SetIconState) for each
  386. message received.  The fetcher should provide a facility for disabling these
  387. messages, and not send them too frequently - two or three times per second
  388. is quite enough.
  389.  
  390.  
  391. If you are going to provide byte counts as in the examples above, I HIGHLY
  392. RECOMMEND using OS_Convert(Fixed)FileSize to give a useful display.  It
  393. isn't terribly useful to know that 65539 bytes out of 268435456 bytes have
  394. been received.  Far better, even if slightly inaccurate, to say '64K out of
  395. 256M' and maybe show the percentage that represents.
  396.  
  397. Returned messages should typically be less than about 64 characters long.
  398.  
  399. The browser may ignore these messages, and so the fetcher should not send
  400. them recorded delivery (Wimp event type 18).
  401.  
  402. The flags for Message_ArcwebTransferStatus:
  403.  
  404.         bit   0         If set, transmission is in progress
  405.         bit   1         If set, reception is in progress
  406.         bit   2         If set, transmission is complete
  407.         bit   3         If set, reception is complete
  408.         bit   4         If set, other comms. are in progress eg. DNS lookup
  409.         bits  5 - 31    Reserved
  410.  
  411.  
  412.  
  413. Other Notes
  414. ===========
  415.  
  416. You must preserve the Arcweb Private Handle.  This is a private pointer to a
  417. part of Arcweb's application memory used to distribute the replies which
  418. Arcweb receives.
  419.  
  420. When specifying an expiry date in FetchDone messages, if you intend to
  421. specify a date rather than allow the default to be used, then you must
  422. specify this as an exact date.  ie. not relative to the current time, you
  423. must add it up yourself.  HTTP servers may supply expiry dates on documents
  424. which they return.  These should be honoured (see documentation of the
  425. Territory module's handling of Time & Date).
  426.  
  427. The 'source', 'temporary', 'diagram' and 'link' words in the FetchRequest
  428. and RenderRequest messages are RISC OS file handles to the appropriate files
  429. in Arcweb's cache.  If you acknowledge either of the Request messages, YOU
  430. are responsible for closing the files (ie. passing the handle to OS_Find 0).
  431. You must close ALL the file handles in the message even if you don't use
  432. them all.  The reason for passing handles around is that filenames  won't
  433. necessarily fit in the message buffer (particularly when you want to pass 4
  434. of them).  If just having the handle is inconvenient, you should use OS_Args
  435. 7 to convert the handle into a filename (as !ArcwebLcl does), close the file
  436. and reopen it how you want to do it.  BUT BEWARE: only do this if you are
  437. going acknowledge the message (otherwise other recipients of the message
  438. will find that they have an illegal file handle in the message).  For
  439. FetchRequest, 'source' is opened as read/write (OS_Find 0x83 - [I always
  440. thought that was for output only, but my RO3 PRMs say otherwise]).  For
  441. RenderRequest, 'source' is opened read only (OS_Find 0x43), and the others
  442. are read/write (OS_Find 0x83).  For PostRequests, the source is as for
  443. FetchRequests, and the form file is read only.  For EMailRequests, the form
  444. file is read-only.
  445.  
  446. [An example of using OS_Args 7 in BASIC is in !ArcwebLcl which uses OS_CLI
  447. to issue a straight *COPY command when the symlink bit is clear]
  448.  
  449.  
  450. You do not need to fill in the file type bits (0-15,16 and 30) when sending
  451. the Fetch Done message, but it will assist the renderers in deciding what to
  452. do with the document if you do.  The most common types returned are plain
  453. text (&FFF), HTML (&FAF), GIF (&695), JPEG (&C85) and XBM (&10104).
  454.  
  455. WARNING: Most HTTP servers are configured with a default type to return in
  456. the case that it cannot work out the type of a file from its name or a
  457. specific directive telling it the file type.  This default type is usually
  458. text/plain.  This is a problem when you wish to store binary files (eg.
  459. arcweb.arc) on HTTP servers, as louis.ecs.soton.ac.uk's server will tell you
  460. that this is a text/plain file, when obviously it isn't.  ArcWeb 0.12 and
  461. later will examine the data in the RenderRequest message* to ensure that it
  462. does not contain non-printable characters before attempting to render it.
  463.  
  464. * see renderer protocol discussion below
  465.  
  466.  
  467. Renderer Protocol
  468. =================
  469.  
  470.   The Renderer Protocol is used to transform a file into something which can
  471. be viewed in the Arcweb window.  Arcweb generates a DrawFile (type &AFF)
  472. to represent the HTML document.  I have written my own parser to read the
  473. HTML file (conforms with the HTML 2.0 specification, 13 June 1994) and
  474. display it.  Renderers should convert images into sprites and store them in
  475. the 'diagram' file (but only if it is an inline data fetch - see discussion
  476. of bits 23 and 25 above).  ArcWeb will be expecting a sprite file to be
  477. there which it can then import.  It will take the first sprite out of the
  478. file.  Arcweb will handle RISC OS sprite files (&FF9) itself (although it
  479. will broadcast the message with the expectation of receiving it back).  You
  480. should not acknowledge render requests for files of type &FF9
  481.  
  482.   Renderers should inspect the file type bits in the RenderRequest to see
  483. whether the file is of a type which they can handle.  If the type is not
  484. known* (bit 30 is clear), then the renderer may inspect the first few bytes
  485. of the file.  Before sending the RenderRequest message, Arcweb will have
  486. loaded in as much of the file as possible to the message (to fill it up to
  487. 256 bytes).  The amount of data in the message is in buf+44, and the data
  488. starts at buf+48.  Thus up to 208 bytes of data will be present (currently
  489. it is 208 unless the file is not that long, in which case the whole file is
  490. there).  If 208 bytes is not enough, the renderer may use the file handle
  491. given in the message to read more of the file in.  The file pointer should
  492. be reset to zero if it decides that it can't handle it.  As a safeguard,
  493. Renderers MUST NOT assume that the file pointer will be zero, and should set
  494. it explicitly.
  495.  
  496. * The renderer may decide that it doesn't 'trust' the given file type.  If
  497. that is the case, then it is allowed to ignore bit 30 and attempt to
  498. recognise the file type from the data in the message buffer and act on that
  499. alone.
  500.  
  501.  
  502.  
  503. Quit Protocol
  504. =============
  505.  
  506.   Fetchers and Renderers should have a configurable option to allow them to
  507. quit when Arcweb dies.  This provides a clean way of shutting Arcweb and all
  508. its related programs down in one go.  Upon receipt of a Message_ArcwebQuit
  509. message, store the task handle (in buf+4) and wait for the Wimp task
  510. closedown message (Message_TaskCloseDown 0x400C3) to arrive with the given
  511. task handle.  [To prevent Arcweb closing down, acknowledge the
  512. Message_ArcwebQuit message - not in version 0.08.  Arcweb will exit anyway.]
  513.  
  514.   By using an extra message, this avoids the need for the auxiliary apps to
  515. lookup the task name from the handle to check whether it was Arcweb or not,
  516. and this also guards against the task name changing.
  517.  
  518.   Do not acknowledge Message_ArcwebQuit unless you wish to prevent the
  519. shutdown (treat it like you would treat Message_PreQuit)
  520.  
  521.  
  522. Expire Protocol
  523. ===============
  524.  
  525.   If a fetcher has used a symbolic link when fetching a file then that file
  526. should be expired upon receipt of Message_ArcwebExpire.  Arcweb will pass you
  527. a handle to the file in the cache.  If the symbolic link bit (bit 28) is set
  528. in the flags, then the file to be removed is really the file whose name is
  529. in the file whose handle you have been given.  !ArcwebLcl ignores this
  530. message completely (as it should).  This protocol is not fixed and should
  531. not yet be used (there is a particular problem with extended URLs), but
  532. fetcher authors should be aware of its future existence.  ArcWeb does not
  533. currently send Message_ArcwebExpire messages.
  534.  
  535.  
  536. Poster Protocol
  537. ===============
  538.  
  539. This protocol will be used when ArcWeb wants to send information to a URL
  540. rather than retrieve it, ie. when an HTML form with a method of POST has
  541. been completed and the SUBMIT button has been pressed.  If the form did not
  542. override the default (GET) or chooses the GET method, the the FetchRequest
  543. protocol is used, and the fetcher is not aware of the fact that the data
  544. transfer has happened.
  545.  
  546. PostRequest should be treated exactly like Message_ArcwebFetchRequest,
  547. except that the 'form' file handle is a RISC OS file handle pointing to a
  548. read-only file containing data to tag onto the end of the request. 
  549. Obviously, the fetcher should issue a POST command to the HTTP server
  550. instead of a GET.  The data in the form file will be suitable for tacking on
  551. IMMEDIATELY after the POST and other usual headers, as it will contain a
  552. Content-Length: header followed by a blank line, followed by the form data
  553. with all the appropriate escape characters already substituted in.  This
  554. data should be passed transparently to the HTTP server.  The fetcher should
  555. respond to ArcWeb with a Message_ArcwebPostDone in exactly the same format
  556. as a response to Message_ArcwebFetchRequest.  The buffer for PostDone is the
  557. same as the buffer for FetchDone.  This is because the target script on the
  558. server responds with a new virtual document, usually confirming that the
  559. data entry was successful/failed etc.
  560.  
  561. EMail Protocol
  562. ==============
  563.  
  564. This protocol will be used when ArcWeb wants to send some e-mail.  ArcWeb
  565. will send this message when the users attempts to follow a mailto: hypertext
  566. link, or when a form with a mailto: method is submitted.  In the former
  567. case, the message remains to be constructed, so the contents of the form
  568. file should be taken as the initial text to be placed in the editor.  ArcWeb
  569. guarantees to make the first line of the file the To: header.  Furthermore,
  570. bit 21 will be clear indicating that the message is not yet complete.  In
  571. the latter case (the invoked form), bit 21 will be set, indicating a
  572. complete message is in the buffer and ready for mailing.  ArcWeb will still
  573. guarantee that the first line in the form file is the To: header, but will
  574. also add an X-Mailer: header, a Date: header and any other headers as
  575. directed by MH tags in the form (eg. Subject: headers)
  576.  
  577. Upon receipt of the EMailRequest, the e-mail application should take over
  578. the process of sending e-mail and return an EMailDone, after taking a copy
  579. of the form file contents and closing the form file.  ArcWeb is not
  580. concerned with what happens to the e-mail next, as far as it is concerned,
  581. the email is sent.
  582.  
  583. There is no virtual document returned from an EMailRequest.  The e-mail
  584. application may flag an error in the usual way (and choose whether to report
  585. the error itself of not).  ArcWeb will open a dialogue box indicating the
  586. status of the e-mail, rather than generating a complete new page.
  587.  
  588.  
  589. ==END==
  590.