Re: [dev] dmc news

From: pancake <pancake_AT_youterm.com>
Date: Tue, 10 Nov 2009 08:38:48 +0100

On Nov 10, 2009, at 6:08 AM, Anders Andersson <pipatron_AT_gmail.com>
wrote:

> Some comments:
>
>> Networking:
>> - ssl (no certificate check yet)
>
> Aren't there ssl-wrappers already? I'm thinking of stunnel, but maybe
> that doesn't work in this setting.
>
Yep. See the pipeline doc. Originally I was using a pipe to openssl
s_client using stdout and a back FIFO to comunicate with.

But this was resulting on a unnecesarily complicated design. So I
rewrote it in C (sock.c) and surprisingly. The resulting code was
cleaner and shorter.

This way I can start ssl in the middle of a plain connection and the
code managing the ciphering is 'under control'.

It's worth to say that OpenSSL sucks.

>
>> Addressbook support:
>> - dmc can read/edit a simple addressbook file
>
> Is this necessary?
> read:$ mail `grep "cool dude" ~/.addressbook` "hello cool dude"
> add :$ echo '"cool dude" <cooldude_AT_cooldude.is>' >>~/.addressbook
> edit:$ sed -i 's/cooldude.is/cooldude.com/' ~/.addressbook
> (Sorry if my sed skills are a little rusty)
>
That's exactly what's doing :)
>
>> Multiple account support:
>> - Multiple accounts can be configured
>
> Is this necessary? Can't you just run multiple instances?
>
I use 4 email accounts every day. For me is an important feature.

I should lock in some way or other the access to the fifos to avoid
racy conditions if multiple apps try to use the same channel.. But the
good thing of daemons is that they cn abstrct this complexity by
letting you work just with the local copy.

>
>> All those mail source applications understand unix-like commands from
>> stdin and throw status messages to stdout and command output body to
>> stderr. This way you can use them as shell applications or manage
>> them as daemons. (This is what 'dmc start' does)
>
> Shouldn't the status messages be on stderr and the actual data you
> might want to pipe on stdout?
>
You are not the first one to say that :) I will probably change it.
>
>> Some of those programs are written in C, and some other in
>> shellscript,
>> But the plan is to rewrite everything in C at some point.
>
> Why rewrite it in C? What will you gain with this? There's a lot of
> code in the shell interpreter, and everyone will have one (even in an
> embedded environment you'll have busybox ash or similar). Use the code
> that's already there. :)
>
I prefer C for coherence and speed, the shellscripts are posix, so you
cn use it with any posix shell out there. But when you code in
shellscript you feel that you are losing CPU cycles and I want to drop
those feelings from my head ;)

Anyway the rewrite is not prioritary

>
>> Let me know your wishes and ideas.
>>
>> --pancake
>>
>
> Sure. :)
>
> // pipe
>
Received on Tue Nov 10 2009 - 07:38:48 UTC

This archive was generated by hypermail 2.2.0 : Tue Nov 10 2009 - 07:48:02 UTC