help command
variable system:
  set NAME
    nick	text
    description	text
    email	text
    sharedir	text
    downloaddir	text
    listingdir	text
    active	0/1
    slots	0-n
    speed	text
    tag		text
    listenaddr	null/ip		somewhat messy
    listenport	null/port	MESSY
  show [NAME]

fix: Unterminated $SR in UDP packet, discarding.
  why is this even happening?
  how come we receive too small packets - we should be able to receive 8K in each packet!
    dump the bad packet along with sender address, and try to figure out version of client
    of those who sent the packet
  improve parsing:
    see http://dcplusplus.sourceforge.net/wiki/index.php/SR%20command
    we need only ' ' after first \x05 (for filesize). the rest is not interesting.
there's resizing window weirdness!
better searching (file types, etc)
alias support
! shell command
better ls sorting (order?)
better who sorting (order?)
'get' wildcards, file completion wildcards (wow)
multiple share directories

======

Rafa Prasa
> Slot checking Algorithm:
> hub sends an active search for a file called fakesearch.txt and for a '.'
> 
> the client must respond via UDP to a hubport which is specified in active
> search command.
> 
> as i've noticed that your client does not respond for a search command

bind to specific interface/IP
get from search results: "get <search> <result>"

color scheme for regular output!
"clear" command (implement by shell)
Ctrl+X hub switching
who shows us sharing 0gb!?

======

in search, use locale to determine what's a-z (not to replace with $). See vlad mail

> Also currently I have a problem with charset support, I speak Russian
> so all local filenames are in WIN-1251 encoding while my linux console
> is UTF-8; what should patch in your microdc code to make convert incoming
> text from WIN-1251 (or any) to UTF-8?

variables:
  global
    incoming user connection port (NU)
    incoming search reply port (NU)
    current user port
    current search port
  ui
    display messages - set
  hub
    name (RO)
    user nick
completion v2:
  CompletionInput
    char *line;
    char *word;
    uint32_t start;
    uint32_t end;	// start + strlen(word)

  int state delivered via argument
  CompletionEntry
     char *input;
     char *display;
     char *input_full; // if non-NULL
     input to use on full, single match
     input_char_single:
       if (state == 1 && there_are_no_more_results && strcmp(input, completeword) == 0)
         append_char_to_input

  new rl_display_match_list
    calculate by screen_width
    just print it all (dunno what printable_part and print_filename is for)
run valgrind
debug print IPC? debug levels for IPC?
download only to partial directory name?
what happens if we download and local file already exists?
can change active while connected! this shouldn't affect user states.
  improve {set,enable,disable}_{active,search} to perfection!
  test thorougly
    initial passive : we_initiate => active
    initial passive : we_initiate => passive
    initial passive : they_initiate (active) => us (passive)
    initial passive : they_initiate (passive) => us (passive)
    initial active : we_initiate => active
    initial active : we_initiate => passive
    initial active : they_initiate (active) => us (active)
    initial active : they_initiate (passive) => us (active)
improve verbosity once again...
add "get user:/" support
handle files with # in names better? in regard to completion
on request to download, must check the download file versus our file list first?
  not 100% necessary - but would decrease the number of weird local file stats.
unsure if keeping connections in UserInfo is good? esp code in user_info_new
sending user status too often. call time to check? at 10 MB per second we would repeat approx 160 times per second.
clean up error messages a bit?
clean up cmd_browse and cmd_get... everything in cmd!
move over to gnu99 standard?
DC++ 0.401 doesn't seem to send search results to passive clients! what's wrong?
some search results to passive clients are discarded. must be the hub.
search like DC++ does: return hit on file if directory name matches?
put listen_port into local_addr? name it listen_addr instead?
cleanup after forking child?
get rid of hub_last_* -- know implicitly in read function!
get rid of my_share_size in favour of our_filelist? must make sure our_filelist is not NULL!
better mark up sections of the home page! (README)
debug more with valgrind --tool=memcheck --log-socket=127.0.0.1 --show-reachable=yes --leak-check=no --suppressions=/home/usel/supr microdc
fix Cannot send to hub - Connection reset by peer known problem
fix ctrl+c known problem
translation of bad local filenames!
rethink reporting, must happen with *no* latency!
eventually move into thread model
clean up listen-port mess
print transfer rate when finished upload/download
forced ip to send in listen?
more flexible IPC. put file_size into TRANSFER_STARTING, remove from DCUserConnStatus
if extreme, we could get rid of user_running and use returns of bool instead
remember IP-address for users?
"Disconnected from user [process]" is printed twice (first from user, then main)
used_slots management:
  decrease when remote downloading finishes.
  increase when remote downloading starts.
  decrease when user disconnects, iff remote was downloading
for best compatibility, don't attempt to download
  empty dirs (naturally - can't)
  empty files (check!)
fix tag x/y/z line (H:?)
total number of users calculation
who -l and who normal
better error messages (reasons) in debug 0 mode
support reusing idle download connections
transfer rate calculation
support user|1 user|2 in nick validate, prior to user|UL user|DL
iconv talk support - different settings for different hubs
download to X.part first, then rename to X. on TERM, remove .part
create state overview in user and hub. what states translates to other states? what global variables are valid in a state?
better characters in filename ends (@=symlink etc) for local completion
add optional argument to transfers
improve status messages and status management
when there's an error on a user in main.c, prefix error message with uc->name?
exec or ! for subshell support
get_node_type_char in fs.c
allow user argument to be passed along completors in command.c, merging {remote,local}_*_completion_generators
quoting in completion+dequoting by backslash in command input
when to redownload user list? option to browse to force it (-f)?
who: parsing of tag, to show active/passive, slots etc
who: sortable who
human readable sizes everywhere - in who etc
wildcard download with get, cd with cd etc
filename completion (always needs completion for \n and such)
hub aliases just like lftp
remoting interface (unix socket, ...)
put close download file code in separate function
retink handling of file_name/*DL*/ in user.c. when to free? on all fatal errors too?
download queue remembering
document all functions
figure out what in MyINFO we can change besides sharesize. tag details? support level?
  if active/passive is changed of remote user, then every time we receive a
  MyINFO for such a user we need reset active_state to DC_ACTIVE_UNKNOWN.
improve queuing: QueueItem
  NORMAL					NORMAL
  RESUME					? automaticly resume?
  USER_LIST					USER_LIST
  	BROWSED (browse)			?
ZLIST (.bz2 compressed)		BZLIST
  	    XML_BZLIST				XML_BZLIST
  DIRECTORY_DOWNLOAD (recursive)		expand on get? EMPTY_DIRECTORY?
  	CLIENT_VIEW (viewed in GUI)		?
  SOURCE_UTF8 (filename in UTF-8)		?
  FLAG_EXISTS (insert in front of queue because file exists on HDD)
  FLAG_MATCH_QUEUE
look into other DC++ features to implement
bz2 support from ground up
look into DC++ blocking, $Sending, $GetBlock etc
better prompt 
improve huffman error messages - check dctc
datatype clean up: use LList for user_conns instead of PtrV?
fs.c: filelist_scan_dir return failure?
user.c: in open_upload_file, use file_name instead of filename. to remember. make sure to free!
whenever printing user nicks, quote them propertly! look for %s
child death must be managed. no exit(0) before talking to main. Don't just exit anywhere, set user_running=false. waitpid?
send MyINFO on our update?
recursive download. download to closes name, do not include all parent directories.
improved completion: users, local files, remote files
verbosity management
uc->main_socket should be non-blocking?
sort listing with ls
make sure child processes die when main does!
timers in DC++: ConnectionManager, DownloadManager, QueueManager
timers in microdc:
  time out pending_userinfo,
  time out idle=dead connections
  when user is MaxedOut, timer for reconnects
  time out searches (when last viewed results and last received results)
clean up:
  don't use active_read_fds, force setting prior instead.
  separate main and user global data into structures
  unified ipc: read_msg_packet, user_communication_put, _read etc
  move main.c stuff to util.c: catfiles, getenv_default, fd_set_nonblock_flag
  data type fix up: determine datatype for each PtrV
better user termination detection in main
transfer management, cancelling
hub: support GetInfo/MyInfo or whatever, for more info on users
unify communication routines. add support for bool
move to 64bit (stat => stat64)
remove files in listing_dir on end
use non-blocking transfer_file in user.c?
command line arguments:
  -c CONFIG		-- read config file other than ~/.microdc
  -d                  -- dummy console/daemon mode (no readline, better command output)
log FILE command
improved search command
  -m minsize
  -M maxsize
  -t type (n or any|audio|compressed|documents|executables|pictures|video|folders)
TTH support: http://www.open-content.net/specs/draft-jchapweske-thex-02.html
Queuing errors and retry intervals:
  a  was downloading but lost connection due to TCP error
  b  was downloading but lost connection due to EOF (remote could have closed in purpose)
  b  was connected but remote is maxed out
  c  was connected but lost connection due to communication logic error
  c  failed to connect to remote $ConnectToMe
  c  remote ignored my $ConnectToMe
  c  remote ignored my $RevConnectToMe
  c  remote is also passive (RECEIVED_PASSIVE)
  c  was downloading but lost connection due to file I/O error (bad/full disk?)

  a=retry immediately or 5 sec (temporary error)
  b=retry in 5-15 mins (remote terminated OR MaxedOut)
  c=retry never (FATAL)

  Retry count for same user: max 20 with exception of fatal errors
verbosity/debug levels
  verbosity:
    user messaging
      private			MESSAGE_PRIVATE privmsg
      public			MESSAGE_PUBLIC pubmsg
      KiCK FIXME
    searching
      my searches
        requests		SEARCH_REQUESTS_OUT srchreqsout
        results			SEARCH_RESULTS_IN srchresin		search_results_in_threshold (# results or time?)
      remote searches
        requests		SEARCH_REQUESTS_IN srchreqsin
        results			SEARCH_RESULTS_OUT srchresout
    transfers
      uploads
        completed		UPLOAD_COMPLETE uldone
        progress		UPLOAD_PROGRESS	ulprog	upload_progress_threshold
        failed/abandoned	UPLOAD_FAILED ulfail
      downloads 
        completed		DOWNLOAD_COMPLETE dldone
        progress		DOWNLOAD_PROGRESS dlprog	download_progress_threshold
        failed/abandoned	DOWNLOAD_FAILED dlfail
    user connections
      connection		USER_CONNECTED ucconn
      	incoming
      	outgoing
      direction validation	USER_DIRECTION_VALIDATED ucdir
      nick validated		USER_NICK_VALIDATED ucnick
      closed			USER_CLOSED ucclose
      errors			USER_ERROR ucerror
    hub user activity
      join			HUB_ACTIVITY_JOIN join
      part			HUB_ACTIVITY_PART part
      errors			HUB_ERROR huberror
      connected			HUB_CONNECTED hcnew
      closed			HUB_CLOSED hcclose
  debug: user-hub ipc i/o	IPC_IO ipcio
  debug: user i/o		USER_IO userio
  debug: hub i/o		HUB_IO hubio
