Changeset 168 for Mulberry

Show
Ignore:
Timestamp:
07/04/08 14:38:02 (5 months ago)
Author:
cyrusdaboo
Message:

Don't allow ios exceptions to propagate out. This was preventing connection auto-recovery
from working properly. Also clean out some cruft.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Mulberry/branches/v4.1d1/Sources_Common/Mail/Network/CTCPStream.cp

    r19 r168  
    7676        { 
    7777                iostate err = goodbit; 
    78                 #ifndef _MSL_NO_EXCEPTIONS 
    7978                try 
    8079                { 
    81                 #endif 
    8280                        while (true) 
    8381                        { 
     
    109107                        } 
    110108                        *s = CTCPStreamBuf::char_type(); 
    111                 #ifndef _MSL_NO_EXCEPTIONS 
    112109                } 
    113110                catch (...) 
     
    115112                        CLOG_LOGCATCH(...); 
    116113 
    117 #ifdef __SGI_STL_PORT 
    118                         _M_setstate_nothrow(badbit); 
    119 #elif __dest_os == __linux_os 
    120                         setstate(badbit); 
     114                        // Important - do not let this failure throw an exception!!! 
     115                        // Any exception here is not handled properly by caller 
     116                        try 
     117                        { 
     118#ifdef __GNUC__ 
     119                                setstate(badbit); 
    121120#else 
    122 #ifdef __GNUC__ 
    123                         setstate(badbit); 
    124 #else 
    125                         state() |= badbit; 
     121                                state() |= badbit; 
    126122#endif 
    127 #endif 
     123                        } 
     124                        catch(...) 
     125                        { 
     126                                // Ignore 
     127                        } 
    128128                        // Always throw up 
    129129                        CLOG_LOGRETHROW; 
    130130                        throw; 
    131131                } 
    132                 #endif 
    133132 
    134133                // Important - do not let this failure throw an exception!!! 
    135134                // Any exception here is not handled 
    136 #ifdef __SGI_STL_PORT 
    137                 _M_clear_nothrow(err); 
    138 #elif __dest_os == __linux_os 
    139                 setstate(err); 
     135                try 
     136                { 
     137#ifdef __GNUC__ 
     138                        setstate(err); 
    140139#else 
    141 #ifdef __GNUC__ 
    142                 try 
    143                 { 
    144                         setstate(err); 
     140                        state() = err; 
     141#endif 
    145142                } 
    146143                catch(...) 
     
    148145                        // Ignore stream exception 
    149146                } 
    150 #else 
    151                 state() = err; 
    152 #endif 
    153 #endif 
    154147 
    155148        }