SourceNode: don't leak eventChannelState.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
SourceNode.cpp: fix and refactor timerCallBack().

- We'll need this functionality exposed to fix other bugs elsewhere,
  so add new SourceNode::tryEnablingEditor().

- Use isReady() instead of dereferencing dataThread directly, since it
  may be NULL.

- Tweak console output to more accurately describe what's happening.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
SourceNode.cpp: cosmetics.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
SourceNode.h: delete trailing whitespace.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
SourceNode.h: remove unused member.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
FileReaderThread.h: fix misleading comment.

There's no such thing (type, variable, or otherwise) as a FileReader.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
FileReaderThread.cpp: whitespace fixups.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
FileReaderThread.h: remove unused fields.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
FileReaderThread: fix up input handling.

We still hardcode paths, but this is better.

- Initialize lengthOfInputFile and bufferSize to 0 in case input isn't
  found.

- Pull call to fopen out of ifdefs, so a future patch can just rip out
  the hardcoded path parts.

- If input _is_ found, then don't leak the file descriptor when the
  FileReaderThread gets deleted.

- If input isn't found, emit a sensible error message and bail in the
  constructor when the file isn't found. Have subsequent calls that
  try to use the FileReaderThread fail instead of crash.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>