Changeset 657 for trunk/sx/ssl.c

Show
Ignore:
Timestamp:
09/08/08 22:01:49 (5 months ago)
Author:
smoku
Message:

Writing stream error to the wire before closing stream

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/sx/ssl.c

    r644 r657  
    103103        if(NAD_ENAME_L(nad, 0) == 8 && strncmp(NAD_ENAME(nad, 0), "starttls", 8) == 0) { 
    104104            nad_free(nad); 
    105      
     105 
    106106            /* can't go on if we've been here before */ 
    107107            if(s->ssf > 0) { 
     
    255255                _sx_close(s); 
    256256 
    257                 /* !!! drop queue */ 
    258  
    259257                return -1; 
    260258            } 
     
    272270    sx_error_t sxe; 
    273271 
    274     /* sanity */ 
     272    /* do not encrypt when error */ 
    275273    if(sc->last_state == SX_SSL_STATE_ERROR) 
    276         return -2; 
     274        return 1; 
    277275 
    278276    _sx_debug(ZONE, "in _sx_ssl_wio"); 
     
    485483    if(sc->last_state == SX_SSL_STATE_WANT_READ || sc->last_state == SX_SSL_STATE_NONE) 
    486484        s->want_read = 1; 
    487      
     485 
    488486    if(buf->len == 0) 
    489487        return 0; 
     
    655653 
    656654    free(sc); 
    657      
     655 
    658656    s->plugin_data[p->index] = NULL; 
    659657} 
     
    748746        return 1; 
    749747    } 
    750      
     748 
    751749    /* Load the CA chain, if configured */ 
    752750    if (cachain != NULL) {