chiark / gitweb /
Make sure HTML man pages are in build directory.
[disorder] / doc / disorder_protocol.5.in
... / ...
CommitLineData
1.\"
2.\" Copyright (C) 2004-2008 Richard Kettlewell
3.\"
4.\" This program is free software: you can redistribute it and/or modify
5.\" it under the terms of the GNU General Public License as published by
6.\" the Free Software Foundation, either version 3 of the License, or
7.\" (at your option) any later version.
8.\"
9.\" This program is distributed in the hope that it will be useful,
10.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
11.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12.\" GNU General Public License for more details.
13.\"
14.\" You should have received a copy of the GNU General Public License
15.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
16.\"
17.TH disorder_protocol 5
18.SH NAME
19disorder_protocol \- DisOrder communication protocol
20.SH DESCRIPTION
21The DisOrder client and server communicate via the protocol described
22in this man page.
23.PP
24The protocol is liable to change without notice.
25You are recommended to check the implementation before believing this document.
26.SH "GENERAL SYNTAX"
27Everything is encoded using UTF-8.
28See
29.B "CHARACTER ENCODING"
30below for more detail on character encoding issues.
31.PP
32Commands and responses consist of a line perhaps followed (depending on the
33command or response) by a body.
34.PP
35The line syntax is the same as described in \fBdisorder_config\fR(5) except
36that comments are prohibited.
37.PP
38Bodies borrow their syntax from RFC821; they consist of zero or more ordinary
39lines, with any initial full stop doubled up, and are terminated by a line
40consisting of a full stop and a line feed.
41.PP
42Commands only have a body if explicitly stated below.
43If they do have a body then the body should always be sent immediately;
44unlike (for instance) the SMTP "DATA" command there is no intermediate step
45where the server asks for the body to be sent.
46.PP
47Replies also only have a body if stated below.
48The presence of a reply body can always be inferred from the response code;
49if the last digit is a 3 then a body is present, otherwise it is not.
50.SH COMMANDS
51Commands always have a command name as the first field of the line; responses
52always have a 3-digit response code as the first field.
53See below for more details about this field.
54.PP
55All commands require the connection to have been already authenticated unless
56stated otherwise.
57If not stated otherwise, the \fBread\fR right is sufficient to execute
58the command.
59.TP
60.B adduser \fIUSERNAME PASSWORD \fR[\fIRIGHTS\fR]
61Create a new user with the given username and password.
62The new user's rights list can be specified; if it is not
63then the \fBdefault_rights\fR setting applies instead.
64Requires the \fBadmin\fR right, and only works on local
65connections.
66.TP
67.B adopt \fIID\fR
68Adopts a randomly picked track, leaving it in a similar state to if it was
69picked by this user. Requires the \fBplay\fR right.
70.TP
71.B allfiles \fIDIRECTORY\fR [\fIREGEXP\fR]
72List all the files and directories in \fIDIRECTORY\fR in a response body.
73If \fIREGEXP\fR is present only matching files and directories are returned.
74.TP
75.B confirm \fICONFIRMATION
76Confirm user registration.
77\fICONFIRMATION\fR is as returned from \fBregister\fR below.
78This command can be used without logging in.
79.TP
80.B cookie \fICOOKIE
81Log a user back in using a cookie created with \fBmake\-cookie\fR.
82The response contains the username.
83.TP
84.B deluser \fIUSERNAME
85Delete the named user.
86Requires the \fBadmin\fR right, and only works on local connections.
87.TP
88.B dirs \fIDIRECTORY\fR [\fIREGEXP\fR]
89List all the directories in \fIDIRECTORY\fR in a response body.
90If \fIREGEXP\fR is present only matching directories are returned.
91.TP
92.B disable \fR[\fBnow\fR]
93Disable further playing.
94If the optional \fBnow\fR argument is present then the current track
95is stopped.
96Requires the \fBglobal prefs\fR right.
97.TP
98.B edituser \fIUSERNAME PROPERTY VALUE
99Set a user property.
100With the \fBadmin\fR right any username and property may be specified.
101Otherwise the \fBuserinfo\fR right is required and only the
102\fBemail\fR and \fBpassword\fR properties may be set.
103.IP
104User properties are syntax-checked before setting. For instance \fBemail\fR
105must contain an "@" sign or you will get an error. (Setting an empty value for
106\fBemail\fR is allowed and removes the property.)
107.TP
108.B enable
109Re-enable further playing, and is the opposite of \fBdisable\fR.
110Requires the \fBglobal prefs\fR right.
111.TP
112.B enabled
113Report whether playing is enabled.
114The second field of the response line will be \fByes\fR or \fBno\fR.
115.TP
116.B exists \fITRACK\fR
117Report whether the named track exists.
118The second field of the response line will be \fByes\fR or \fBno\fR.
119.TP
120.B files \fIDIRECTORY\fR [\fIREGEXP\fR]
121List all the files in \fIDIRECTORY\fR in a response body.
122If \fIREGEXP\fR is present only matching files are returned.
123.TP
124.B get \fITRACK\fR \fIPREF\fR
125Gets a preference value.
126On success the second field of the response line will have the value.
127.IP
128If the track or preference do not exist then the response code is 555.
129.TP
130.B get\-global \fIKEY\fR
131Get a global preference.
132.IP
133If the preference does not exist then the response code is 555.
134.TP
135.B length \fITRACK\fR
136Get the length of the track in seconds.
137On success the second field of the response line will have the value.
138.TP
139.B log
140Send event log messages in a response body.
141The command will never terminate.
142Any further data sent to the server will be discarded (explicitly;
143i.e. it will not accumulate in a buffer somewhere).
144.IP
145See \fBEVENT LOG\fR below for more details.
146.TP
147.B make\-cookie
148Returns an opaque string that can be used by the \fBcookie\fR command to log
149this user back in on another connection (until the cookie expires).
150.TP
151.B move \fITRACK\fR \fIDELTA\fR
152Move a track in the queue.
153The track may be identified by ID (preferred) or name (which might cause
154confusion if it's there twice).
155\fIDELTA\fR should be an negative or positive integer and indicates how
156many steps towards the head of the queue the track should be moved.
157.IP
158Requires one of the \fBmove mine\fR, \fBmove random\fR or \fBmove any\fR rights
159depending on how the track came to be added to the queue.
160.TP
161.B moveafter \fITARGET\fR \fIID\fR ...
162Move all the tracks in the \fIID\fR list after ID \fITARGET\fR.
163If \fITARGET\fR is the empty string then the listed tracks are put
164at the head of the queue.
165If \fITARGET\fR is listed in the ID list then the tracks are moved
166to just after the first non-listed track before it, or to the head if there is
167no such track.
168.IP
169Requires one of the \fBmove mine\fR, \fBmove random\fR or \fBmove any\fR rights
170depending on how the tracks came to be added to the queue.
171.TP
172.B new \fR[\fIMAX\fR]
173Send the most recently added \fIMAX\fR tracks in a response body.
174If the argument is ommitted, the \fBnew_max\fR most recent tracks are
175listed (see \fBdisorder_config\fR(5)).
176.TP
177.B nop
178Do nothing.
179Used by
180.BR disobedience (1)
181as a keepalive measure.
182This command does not require authentication.
183.TP
184.B part \fITRACK\fR \fICONTEXT\fI \fIPART\fR
185Get a track name part.
186Returns an empty string if a name part cannot be constructed.
187.IP
188.I CONTEXT
189is one of
190.B sort
191or
192.B display
193and
194.I PART
195is usually one of
196.BR artist ,
197.B album
198or
199.BR title .
200.TP
201.B pause
202Pause the current track.
203Requires the \fBpause\fR right.
204.TP
205.B play \fITRACK\fR
206Add a track to the queue.
207The response contains the queue ID of the track.
208Requires the \fBplay\fR right.
209.TP
210.B playafter \fITARGET\fR \fITRACK\fR ...
211Add all the tracks in the \fITRACK\fR list to the queue after \fITARGET\fR
212(which should be a track ID).
213If \fITARGET\fR is the empty string then the listed tracks are put
214at the head of the queue.
215.IP
216Currently the success result does \fInot\fR include the new track IDs.
217.IP
218Requires the \fBplay\fR right.
219.TP
220.B playing
221Report what track is playing.
222.IP
223If the response is \fB252\fR then the rest of the response line consists of
224track information (see below).
225.IP
226If the response is \fB259\fR then nothing is playing.
227.TP
228.B playlist-delete \fIPLAYLIST\fR
229Delete a playlist.
230Requires permission to modify that playlist and the \fBplay\fR right.
231.TP
232.B playlist-get \fIPLAYLIST\fR
233Get the contents of a playlist, in a response body.
234Requires permission to read that playlist and the \fBread\fR right.
235If the playlist does not exist the response is 555.
236.TP
237.B playlist-get-share \fIPLAYLIST\fR
238Get the sharing status of a playlist.
239The result will be \fBpublic\fR, \fBprivate\fR or \fBshared\fR.
240Requires permission to read that playlist and the \fBread\fR right.
241.TP
242.B playlist-lock \fIPLAYLIST\fR
243Lock a playlist.
244Requires permission to modify that playlist and the \fBplay\fR right.
245Only one playlist may be locked at a time on a given connection and the lock
246automatically expires when the connection is closed.
247.TP
248.B playlist-set \fIPLAYLIST\fR
249Set the contents of a playlist.
250The new contents should be supplied in a command body.
251Requires permission to modify that playlist and the \fBplay\fR right.
252The playlist must be locked.
253.TP
254.B playlist-set-share \fIPLAYLIST\fR \fISHARE\fR
255Set the sharing status of a playlist to
256\fBpublic\fR, \fBprivate\fR or \fBshared\fR.
257Requires permission to modify that playlist and the \fBplay\fR right.
258.TP
259.B playlist-unlock\fR
260Unlock the locked playlist.
261.TP
262.B playlists
263List all playlists that this connection has permission to read.
264Requires the \fBread\fR right.
265.TP
266.B prefs \fBTRACK\fR
267Send back the preferences for \fITRACK\fR in a response body.
268Each line of the response has the usual line syntax, the first field being the
269name of the pref and the second the value.
270.TP
271.B queue
272Send back the current queue in a response body, one track to a line, the track
273at the head of the queue (i.e. next to be be played) first.
274See below for the track information syntax.
275.TP
276.B random\-disable
277Disable random play (but don't stop the current track).
278Requires the \fBglobal prefs\fR right.
279.TP
280.B random\-enable
281Enable random play.
282Requires the \fBglobal prefs\fR right.
283.TP
284.B random\-enabled
285Report whether random play is enabled.
286The second field of the response line will be \fByes\fR or \fBno\fR.
287.TP
288.B recent
289Send back the current recently-played list in a response body, one track to a
290line, the track most recently played last.
291See below for the track information syntax.
292.TP
293.B reconfigure
294Request that DisOrder reconfigure itself.
295Requires the \fBadmin\fR right.
296.IP
297Not all configuration options can be modified during the lifetime of the
298server; of those that can't, some will just be ignored if they change while
299others will cause the new configuration to be rejected.
300See \fBdisorder_config\fR(5) for details.
301.TP
302.B register \fIUSERNAME PASSWORD EMAIL
303Register a new user.
304Requires the \fBregister\fR right.
305The result contains a confirmation string; the user will be be able
306to log in until this has been presented back to the server via the
307\fBconfirm\fR command.
308.TP
309.B reminder \fIUSERNAME\fR
310Send a password reminder to user \fIUSERNAME\fR.
311If the user has no valid email address, or no password, or a
312reminder has been sent too recently, then no reminder will be sent.
313.TP
314.B remove \fIID\fR
315Remove the track identified by \fIID\fR.
316Requires one of the \fBremove mine\fR, \fBremove random\fR or
317\fBremove any\fR rights depending on how the
318track came to be added to the queue.
319.TP
320.B rescan \fR[\fBwait\fR] \fR[\fBfresh\fR]
321Rescan all roots for new or obsolete tracks.
322Requires the \fBrescan\fR right.
323.IP
324If the \fBwait\fR flag is present then the response is delayed until the rescan
325completes.
326Otherwise the response arrives immediately.
327This is primarily intended for testing.
328.IP
329If the \fBfresh\fR flag is present a rescan is already underway then a second
330rescan will be started when it completes.
331The default behavior is to piggyback on the existing rescan.
332.IP
333NB that \fBfresh\fR is currently disabled in the server source, so using this
334flag will just provoke an error.
335.TP
336.B resolve \fITRACK\fR
337Resolve a track name, i.e. if this is an alias then return the real track name.
338.TP
339.B resume
340Resume the current track after a \fBpause\fR command.
341Requires the \fBpause\fR right.
342.TP
343.B revoke \fBcookie\fR
344Revoke a cookie previously created with \fBmake\-cookie\fR.
345It will not be possible to use this cookie in the future.
346.TP
347.B rtp\-address
348Report the RTP broadcast (or multicast) address, in the form \fIADDRESS
349PORT\fR.
350This command does not require authentication.
351.TP
352.B scratch \fR[\fIID\fR]
353Remove the track identified by \fIID\fR, or the currently playing track if no
354\fIID\fR is specified.
355Requires one of the \fBscratch mine\fR, \fBscratch random\fR or
356\fBscratch any\fR rights depending on how the track came to be
357added to the queue.
358.TP
359.B schedule-add \fIWHEN\fR \fIPRIORITY\fR \fIACTION\fR ...
360Schedule an event for the future.
361.IP
362.I WHEN
363is the time when it should happen, as \fBtime_t\fR value.
364It must refer to a time in the future.
365.IP
366.I PRIORITY
367is the event priority.
368This can be \fBnormal\fR, in which case the event will be run at startup if its
369time has past, or \fBjunk\fR in which case it will be discarded if it is found
370to be in the past at startup.
371The meaning of other values is not defined.
372.IP
373.I ACTION
374is the action to perform.
375The choice of action determines the meaning of the remaining arguments.
376Possible actions are:
377.RS
378.TP
379.B play
380Play a track.
381The next argument is the track name.
382Requires the \fBplay\fR right.
383.TP
384.B set-global
385Set a global preference.
386The next argument is the preference name and the final argument is the value to
387set it to (omit it to unset it).
388Requires the \fBglobal prefs\fR right.
389.RE
390.IP
391You need the right at the point you create the event.
392It is not possible to create scheduled events in expectation of a future change
393in rights.
394.TP
395.B schedule-del \fIEVENT\fR
396Deletes a scheduled event.
397Users can always delete their own scheduled events; with the \fBadmin\fR
398right you can delete any event.
399.TP
400.B schedule-get \fIEVENT\fR
401Sends the details of scheduled event \fIEVENT\fR in a response body.
402Each line is a pair of strings quoted in the usual way, the first being the key
403ane the second the value.
404No particular order is used.
405.IP
406Scheduled events are considered public information.
407Right \fBread\fR is sufficient to see details of all events.
408.TP
409.B schedule-list
410Sends the event IDs of all scheduled events in a response body, in no
411particular order.
412Use \fBschedule-get\fR to get the details of each event.
413.TP
414.B search \fITERMS\fR
415Search for tracks matching the search terms.
416The results are put in a response body, one to a line.
417.IP
418The search string is split in the usual way, with quoting supported, into a
419list of terms.
420Only tracks matching all terms are included in the results.
421.IP
422Any terms of the form \fBtag:\fITAG\fR limits the search to tracks with that
423tag.
424.IP
425All other terms are interpreted as individual words which must be present in
426the track name.
427.IP
428Spaces in terms don't currently make sense, but may one day be interpreted to
429allow searching for phrases.
430.TP
431.B \fBset\fR \fITRACK\fR \fIPREF\fR \fIVALUE\fR
432Set a preference.
433Requires the \fBprefs\fR right.
434.TP
435.B set\-global \fIKEY\fR \fIVALUE\fR
436Set a global preference.
437Requires the \fBglobal prefs\fR right.
438.TP
439.B stats
440Send server statistics in plain text in a response body.
441.TP
442.B \fBtags\fR
443Send the list of currently known tags in a response body.
444.TP
445.B \fBunset\fR \fITRACK\fR \fIPREF\fR
446Unset a preference.
447Requires the \fBprefs\fR right.
448.TP
449.B \fBunset\-global\fR \fIKEY\fR
450Unset a global preference.
451Requires the \fBglobal prefs\fR right.
452.TP
453.B user \fIUSERNAME\fR \fIRESPONSE\fR
454Authenticate as user \fIUSERNAME\fR.
455See
456.B AUTHENTICATION
457below.
458.TP
459.B userinfo \fIUSERNAME PROPERTY
460Get a user property.
461.TP
462.B users
463Send the list of currently known users in a response body.
464.TP
465.B version
466Send back a response with the server version as the second field.
467.TP
468.B volume \fR[\fILEFT\fR [\fIRIGHT\fR]]
469Get or set the volume.
470.IP
471With zero parameters just gets the volume and reports the left and right sides
472as the 2nd and 3rd fields of the response.
473.IP
474With one parameter sets both sides to the same value.
475With two parameters sets each side independently.
476Setting the volume requires the \fBvolume\fR right.
477.SH RESPONSES
478Responses are three-digit codes.
479The first digit distinguishes errors from succesful responses:
480.TP
481.B 2
482Operation succeeded.
483.TP
484.B 5
485Operation failed.
486.PP
487The second digit breaks down the origin of the response:
488.TP
489.B 0
490Generic responses not specific to the handling of the command.
491Mostly this is parse errors.
492.TP
493.B 1
49451x errors indicate that the user had insufficient rights for the command.
495.TP
496.B 3
497Authentication responses.
498.TP
499.B 5
500Responses specific to the handling of the command.
501.PP
502The third digit provides extra information about the response:
503.TP
504.B 0
505Text part is just commentary.
506.TP
507.B 1
508Text part is a constant result e.g. \fBversion\fR.
509.TP
510.B 2
511Text part is a potentially variable result.
512.TP
513.B 3
514Text part is just commentary; a dot-stuffed body follows.
515.TP
516.B 4
517Text part is just commentary; an indefinite dot-stuffed body follows.
518(Used for \fBlog\fR.)
519.TP
520.B 5
521Used with "normal" errors, for instance a preference not being found.
522The text part is commentary.
523.TP
524.B 9
525The text part is just commentary (but would normally be a response for this
526command) e.g. \fBplaying\fR.
527.PP
528Result strings (not bodies) intended for machine parsing (i.e. xx1 and xx2
529responses) are quoted.
530.SH AUTHENTICATION
531When a connection is made the server sends a \fB231\fR response before any
532command is received.
533This contains a protocol generation, an algorithm name and a
534challenge encoded in hex, all separated by whitespace.
535.PP
536The current protocol generation is \fB2\fR.
537.PP
538The possible algorithms are (currently) \fBsha1\fR, \fBsha256\fR, \fBsha384\fR
539and \fBsha512\fR.
540\fBSHA1\fR etc work as synonyms.
541.PP
542The \fBuser\fR response consists of the selected hash of the user's password
543concatenated with the challenge, encoded in hex.
544.SH "TRACK INFORMATION"
545Track information is encoded in a line (i.e. using the usual line syntax) as
546pairs of fields.
547The first is a name, the second a value.
548The names have the following meanings:
549.TP 12
550.B expected
551The time the track is expected to be played at.
552.TP
553.B id
554A string uniquely identifying this queue entry.
555.TP
556.B played
557The time the track was played at.
558.TP
559.B scratched
560The user that scratched the track.
561.TP
562.B origin
563The origin of the track. Valid origins are:
564.RS
565.TP 12
566.B adopted
567The track was originally randomly picked but has been adopted by a user.
568.TP
569.B picked
570The track was picked by a user.
571.TP
572.B random
573The track was randomly picked.
574.TP
575.B scheduled
576The track was played from a scheduled action.
577.TP
578.B scratch
579The track is a scratch sound.
580.RE
581.TP
582.B state
583The current track state.
584Valid states are:
585.RS
586.TP 12
587.B failed
588The player failed (exited with nonzero status but wasn't scratched).
589.TP
590.B ok
591The track was played without any problems.
592.TP
593.B scratched
594The track was scratched.
595.TP
596.B started
597The track is currently playing.
598.TP
599.B paused
600Track is playing but paused.
601.TP
602.B unplayed
603In the queue, hasn't been played yet.
604.TP
605.B quitting
606The track was terminated because the server is shutting down.
607.RE
608.TP
609.B submitter
610The user that submitted the track.
611.TP
612.B track
613The filename of the track.
614.TP
615.B when
616The time the track was added to the queue.
617.TP
618.B wstat
619The wait status of the player in decimal.
620.PP
621Note that \fBorigin\fR is new with DisOrder 4.3, and obsoletes some old
622\fBstate\fR values.
623.SH NOTES
624Times are decimal integers using the server's \fBtime_t\fR.
625.PP
626For file listings, the regexp applies to the basename of the returned file, not
627the whole filename, and letter case is ignored.
628\fBpcrepattern\fR(3) describes the regexp syntax.
629.PP
630Filenames are in UTF-8 even if the collection they come from uses some other
631encoding - if you want to access the real file (in such cases as the filenames
632actually correspond to a real file) you'll have to convert to whatever the
633right encoding is.
634.SH "EVENT LOG"
635The event log consists of lines starting with a hexadecimal timestamp and a
636keyword followed by (optionally) parameters.
637The parameters are quoted in the usual DisOrder way.
638Currently the following keywords are used:
639.TP
640.B adopted \fIID\fR \fIUSERNAME\fR
641\fIUSERNAME\fR adopted track \fIID\fR.
642.TP
643.B completed \fITRACK\fR
644Completed playing \fITRACK\fR
645.TP
646.B failed \fITRACK\fR \fIERROR\fR
647Completed playing \fITRACK\fR with an error status
648.TP
649.B moved \fIUSERNAME\fR
650User \fIUSERNAME\fR moved some track(s).
651Further details aren't included any more.
652.TP
653.B playing \fITRACK\fR [\fIUSERNAME\fR]
654Started playing \fITRACK\fR.
655.TP
656.B playlist_created \fIPLAYLIST\fR \fISHARING\fR
657Sent when a playlist is created.
658For private playlists this is intended to be sent only to the owner (but
659this is not currently implemented).
660.TP
661.B playlist_deleted \fIPLAYLIST\fR
662Sent when a playlist is deleted.
663For private playlists this is intended to be sent only to the owner (but
664this is not currently implemented).
665.TP
666.B playlist_modified \fIPLAYLIST\fR \fISHARING\fR
667Sent when a playlist is modified (either its contents or its sharing status).
668For private playlists this is intended to be sent only to the owner (but
669this is not currently implemented).
670.TP
671.B queue \fIQUEUE-ENTRY\fR...
672Added \fITRACK\fR to the queue.
673.TP
674.B recent_added \fIQUEUE-ENTRY\fR...
675Added \fIID\fR to the recently played list.
676.TP
677.B recent_removed \fIID\fR
678Removed \fIID\fR from the recently played list.
679.TP
680.B removed \fIID\fR [\fIUSERNAME\fR]
681Queue entry \fIID\fR was removed.
682This is used both for explicit removal (when \fIUSERNAME\fR is present)
683and when playing a track (when it is absent).
684.TP
685.B rescanned
686A rescan completed.
687.TP
688.B scratched \fITRACK\fR \fIUSERNAME\fR
689\fITRACK\fR was scratched by \fIUSERNAME\fR.
690.TP
691.B state \fIKEYWORD\fR
692Some state change occurred.
693The current set of keywords is:
694.RS
695.TP
696.B completed
697The current track completed successfully.
698.TP
699.B disable_play
700Playing was disabled.
701.TP
702.B disable_random
703Random play was disabled.
704.TP
705.B enable_play
706Playing was enabled.
707.TP
708.B enable_random
709Random play was enabled.
710.TP
711.B failed
712The current track failed.
713.TP
714.B pause
715The current track was paused.
716.TP
717.B playing
718A track started playing.
719.TP
720.B resume
721The current track was resumed.
722.TP
723.B rights_changed \fIRIGHTS\fR
724User's rights were changed.
725.TP
726.B scratched
727The current track was scratched.
728.PP
729To simplify client implementation, \fBstate\fR commands reflecting the current
730state are sent at the start of the log.
731.RE
732.TP
733.B user_add \fIUSERNAME\fR
734A user was created.
735.TP
736.B user_delete \fIUSERNAME\fR
737A user was deleted.
738.TP
739.B user_edit \fIUSERNAME\fR \fIPROPERTY\fR
740Some property of a user was edited.
741.TP
742.B user_confirm \fIUSERNAME\fR
743A user's login was confirmed (via the web interface).
744.TP
745.B volume \fILEFT\fR \fIRIGHT\fR
746The volume changed.
747.PP
748.IR QUEUE-ENTRY ...
749is as defined in
750.B "TRACK INFORMATION"
751above.
752.PP
753The \fBuser-*\fR messages are only sent to admin users, and are not sent over
754non-local connections unless \fBremote_userman\fR is enabled.
755.SH "CHARACTER ENCODING"
756All data sent by both server and client is encoded using UTF-8.
757Moreover it must be valid UTF-8, i.e. non-minimal sequences are not
758permitted, nor are surrogates, nor are code points outside the
759Unicode code space.
760.PP
761There are no particular normalization requirements on either side of the
762protocol.
763The server currently converts internally to NFC, the client must
764normalize the responses returned if it needs some normalized form for further
765processing.
766.PP
767The various characters which divide up lines may not be followed by combining
768characters.
769For instance all of the following are prohibited:
770.TP
771.B o
772LINE FEED followed by a combining character.
773For example the sequence LINE FEED, COMBINING GRAVE ACCENT is never permitted.
774.TP
775.B o
776APOSTROPHE or QUOTATION MARK followed by a combining character when used to
777delimit fields.
778For instance a line starting APOSTROPHE, COMBINING CEDILLA is prohibited.
779.IP
780Note that such sequences are not prohibited when the quote character cannot be
781interpreted as a field delimiter.
782For instance APOSTROPHE, REVERSE SOLIDUS, APOSTROPHE, COMBINING CEDILLA,
783APOSTROPHE would be permitted.
784.TP
785.B o
786REVERSE SOLIDUS (BACKSLASH) followed by a combining character in a quoted
787string when it is the first character of an escape sequence.
788For instance a line starting APOSTROPHE, REVERSE SOLIDUS, COMBINING TILDE
789is prohibited.
790.IP
791As above such sequences are not prohibited when the character is not being used
792to start an escape sequence.
793For instance APOSTROPHE, REVERSE SOLIDUS, REVERSE SOLIDS, COMBINING TILDE,
794APOSTROPHE is permitted.
795.TP
796.B o
797Any of the field-splitting whitespace characters followed by a combining
798character when not part of a quoted field.
799For instance a line starting COLON, SPACE, COMBINING CANDRABINDU is prohibited.
800.IP
801As above non-delimiter uses are fine.
802.TP
803.B o
804The FULL STOP characters used to quote or delimit a body.
805.PP
806Furthermore none of these characters are permitted to appear in the context of
807a canonical decomposition (i.e. they must still be present when converted to
808NFC).
809In practice however this is not an issue in Unicode 5.0.
810.PP
811These rules are consistent with the observation that the split() function is
812essentially a naive ASCII parser.
813The implication is not that these sequences never actually appear in
814the protocol, merely that the server is not required to honor them in
815any useful way nor be consistent between versions: in current
816versions the result will be lines and fields that start with combining
817characters and are not necessarily split where you expect, but future versions
818may remove them, reject them or ignore some or all of the delimiters that have
819following combining characters, and no notice will be given of any change.
820.SH "SEE ALSO"
821\fBdisorder\fR(1),
822\fBtime\fR(2),
823\fBdisorder\fR(3),
824\fBpcrepattern\fR(3)
825\fBdisorder_config\fR(5),
826\fBdisorderd\fR(8),
827\fButf8\fR(7)
828.\" Local Variables:
829.\" mode:nroff
830.\" fill-column:79
831.\" End: