Changeset 658 for trunk/sx/io.c
- Timestamp:
- 09/08/08 23:12:09 (5 months ago)
- Files:
-
- 1 modified
-
trunk/sx/io.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/sx/io.c
r657 r658 126 126 _sx_state(s, state_CLOSING); 127 127 } 128 128 129 129 if(errstring != NULL) free(errstring); 130 130 131 131 nad_free(nad); 132 132 133 133 break; 134 134 } 135 135 136 136 /* run it by the plugins */ 137 137 if(_sx_chain_nad_read(s, nad) == 0) 138 138 return; 139 139 140 140 /* now let the plugins process the completed nad */ 141 141 plugin_error = 0; … … 150 150 } 151 151 } 152 152 153 153 /* hand it to the app */ 154 154 if ((plugin_error == 0) && (s->state < state_CLOSING)) … … 159 159 if(s->fail) { 160 160 _sx_close(s); 161 161 162 162 return; 163 163 } … … 209 209 _sx_buffer_free(in); 210 210 _sx_state(s, state_CLOSING); 211 211 212 212 } else { 213 213 _sx_debug(ZONE, "passed %d read bytes", in->len); … … 316 316 sx_buf_t out; 317 317 int ret, written; 318 318 319 319 assert((int) (s != NULL)); 320 320 … … 346 346 _sx_debug(ZONE, "handing app %d bytes to write", out->len); 347 347 written = _sx_event(s, event_WRITE, (void *) out); 348 348 349 349 if(written < 0) { 350 350 /* bail if something went wrong */ … … 468 468 /* close the stream if necessary */ 469 469 if(s->state >= state_STREAM_SENT) { 470 _sx_debug(ZONE, "sending closing </stream:stream>");471 470 jqueue_push(s->wbufq, _sx_buffer_new("</stream:stream>", 16, NULL, NULL), 0); 472 471 s->want_write = 1; 473 _sx_state(s, state_CLOSING); 474 _sx_event(s, event_WANT_WRITE, NULL); 475 } else 476 _sx_state(s, state_CLOSING); 472 } 473 474 _sx_state(s, state_CLOSING); 477 475 } 478 476
