The Server:
* The server's command implementations must not block. Waiting for a little
- disk IO is OK but blocking on long-lasting transactions or external
- resources is not acceptable. Long-running subprocesses should use
- subprograms (rather than forking but not execing) if reasonably possible;
- see c_stats() for an example. c_reminder() is probably in the grey area.
+ disk IO is OK but blocking for extended periods on long-lasting
+ transactions or external resources is not acceptable; it will wedge the
+ server for all other users.
+
+ Long-running subprocesses should use subprograms (rather than forking but
+ not execing) if reasonably possible; see c_stats() for an example.
+ c_reminder() is probably in the grey area.
* The server process does not use threads and I would like to keep it that
way.
Web Interface:
* The web interface does not use Javascript or Flash and I would like to
- keep it that way.
+ keep it that way. Clever use of CSS is OK provided it works well on the
+ mainstream browsers.
* I know that the web template syntax is rather nasty. Perhaps it will be
improved in a future version.
* Update doc/disobedience.1.in for any changes you make.
+New Platforms:
+
+ * It is not mandatory to have an entry in configure's 'case $host' section,
+ but may well be convenient.
+
+ * Complete support for a new platform implies updating scripts/setup.in and
+ scripts/teardown.in as well as getting the software to build and work (but
+ this doesn't mean that patches that don't achieve this will be rejected).
+
Code And Patches:
* Please follow the existing layout conventions.
* Please try to write doc comments for new functions, types, etc using the
same syntax as the existing ones. Doxygen can be used to turn this into
- reference documentation.
+ reference documentation (see http://www.stack.nl/~dimitri/doxygen/) but
+ really the point is to have good inline code documentation, not the
+ Doxygen output as such.
* More importantly, new configuration directives, protocol commands,
interface features etc should be documented in the relevant places.
}
}
+/** @brief Return nonzero if @p sin4 is an IPv4 multicast address */
static inline int multicast4(const struct sockaddr_in *sin4) {
return IN_MULTICAST(ntohl(sin4->sin_addr.s_addr));
}
+/** @brief Return nonzero if @p sin6 is an IPv6 multicast address */
static inline int multicast6(const struct sockaddr_in6 *sin6) {
return IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr);
}
}
}
+/** @brief Format an IPv4 address */
static inline char *format_sockaddr4(const struct sockaddr_in *sin4) {
char buffer[1024], *r;
return r;
}
+/** @brief Format an IPv6 address */
static inline char *format_sockaddr6(const struct sockaddr_in6 *sin6) {
char buffer[1024], *r;
return r;
}
+/** @brief Format a UNIX socket address */
static inline char *format_sockaddrun(const struct sockaddr_un *sun) {
return xstrdup(sun->sun_path);
}
-/** @brief Construct a text description a sockaddr */
+/** @brief Construct a text description a sockaddr
+ * @param sa Socket address
+ * @return Human-readable form of address
+ */
char *format_sockaddr(const struct sockaddr *sa) {
switch(sa->sa_family) {
case AF_INET:
/** @brief Convert MIME base64
* @param s base64 data
* @param nsp Where to store length of converted data
- * @param table Table of characters to use
* @return Decoded data
*
* See <a href="http://tools.ietf.org/html/rfc2045#section-6.8">RFC
/** @brief Convert base64
* @param s base64 data
* @param nsp Where to store length of converted data
+ * @param table Table of characters to use
* @return Decoded data
*
* @p table should consist of 65 characters. The first 64 will be used to
#include "rights.h"
#include "trackdb.h"
+/** @brief Client handle contents */
struct disorder_client {
- FILE *fpin, *fpout;
+ /** @brief Stream to read from */
+ FILE *fpin;
+ /** @brief Stream to write to */
+ FILE *fpout;
+ /** @brief Peer description */
char *ident;
+ /** @brief Username */
char *user;
+ /** @brief Report errors to @c stderr */
int verbose;
- char *last; /* last error string */
+ /** @brief Last error string */
+ char *last;
};
/** @brief Create a new client
return 0;
}
+/** @brief Fetch the queue, recent list, etc */
static int disorder_somequeue(disorder_client *c,
const char *cmd, struct queue_entry **qp) {
struct queue_entry *qh, **qt = &qh, *q;
* @param text Underlying UTF-8 text
* @param charsetp Where to store charset string
* @param encodingp Where to store encoding string
- * @return Encoded text (might be @ref text)
+ * @return Encoded text (might be @p text)
*/
const char *mime_encode_text(const char *text,
const char **charsetp,
* @param recipient Recipient address
* @param subject Subject string
* @param encoding Body encoding
- * @param body_type Content-type of body
+ * @param content_type Content-type of body
* @param body Text of body (encoded, but \n for newline)
* @return 0 on success, non-0 on error
*/
/** @brief Initiate a rescan
* @param ev Event loop or 0 to block
- * @param check 1 to recheck lengths, 0 to suppress check
+ * @param recheck 1 to recheck lengths, 0 to suppress check
*/
void trackdb_rescan(ev_source *ev, int recheck) {
int w;
/*
* This file is part of DisOrder.
- * Copyright (C) 2004, 2005 Richard Kettlewell
+ * Copyright (C) 2004, 2005, 2008 Richard Kettlewell
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
+/** @file server/daemonize.c
+ * @brief Go into background
+ */
#include <config.h>
#include "syscalls.h"
#include "log.h"
+/** @brief Go into background
+ * @param tag Message tag, or NULL
+ * @param fac Logging facility
+ * @param pidfile Where to store PID, or NULL
+ *
+ * Become a daemon. stdout/stderr are lost and DisOrder's logging is
+ * redirected to syslog. It is assumed that there are no FDs beyond 2
+ * that need closing.
+ */
void daemonize(const char *tag, int fac, const char *pidfile) {
pid_t pid, r;
int w, dn;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
+/** @file server/daemonize.h
+ * @brief Go into background
+ */
#ifndef DAEMONIZE_H
#define DAEMONIZE_H