Changeset 657 for trunk/sx/io.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/io.c

    r620 r657  
    468468    /* close the stream if necessary */ 
    469469    if(s->state >= state_STREAM_SENT) { 
     470        _sx_debug(ZONE, "sending closing </stream:stream>"); 
    470471        jqueue_push(s->wbufq, _sx_buffer_new("</stream:stream>", 16, NULL, NULL), 0); 
    471472        s->want_write = 1; 
    472     } 
    473  
    474     _sx_state(s, state_CLOSING); 
     473        _sx_state(s, state_CLOSING); 
     474        _sx_event(s, event_WANT_WRITE, NULL); 
     475    } else 
     476        _sx_state(s, state_CLOSING); 
    475477} 
    476478