Send crash: (Two Balsas crash)



> Locking mailbox Sentbox
> Unlocking mailbox 
> recipientlistnotshown... User unknown
> Error sending message, child exited 67 (No such user.).
> 
> ** WARNING **: Error sending message.
> Locking mailbox Sentbox

I have an e-mail out to Hector about error-reporting/error-handling in
send.c.  Basically, it outlines the procedure for sending a message from
the sending thread to the main thread -- if someone wants to start
narrowing down these errors that are crashing balsa and have them report
to the main thread instead, feel free to use the information:


Send Error Handling
===================

>From dpickens@iaesthetic.com Wed Dec  8 13:22:07 1999
Date: Wed, 8 Dec 1999 11:01:30 -0500 (EST)
From: David Pickens <dpickens@iaesthetic.com>
To: Hector Garcia <hector@huron.scouts-es.org>
Subject: Re: SMTP bug


BTW, you metioned error-handling before, and I thought I'd give you the
specifics of the handling with the thread:

To send a message from the sending thread you'll need an empty/unused
pointer to struct SendThreadMessage;

SendThreadMessage *my_message;

Then call the macro MSGSENDTHREAD, which takes as its arguments the empty
pointer to SendThreadMessage, the message type (from threads.h), a string
to send, a HEADER pointer to msg, and a pointer to a mailbox.  You can
send NULL for most of these things.  Currently the message string can
be a max of 256 characters (including NULL), which are copied to the
SendThreadMessage struct.  So, for an error connecting the server, you
could do something like:

MSGSENDTHREAD( my_message, MSGSENDTHREADERROR, "Failure to Connect Host:
Your host", NULL, NULL);

You can re-use my_message.  Be sure NOT to free the data it points to --
this is handled by the main thread.

Of course, for now, these have to be surrounded with: 
#ifdef BALSA_USE_THREADS
/* threaded code */
#else 
/*non-threaded error code */ 
#endif


In the main-window.c code, messages are handled by
send_progress_notify_cb().  If you send a pointer to a HEADER msg struct,
you should free it here, etc.

After the switch( threadmessage->message_type ), you see the 'handlers'
for the different message types.  Right now error just dumps the string to
stderr, but you could have it do whatever you want, including creating a
dialog, etc..

Have fun,

David





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]