src/server/daemon/sessionhandler.c

changeset 194
6345f50208d5
parent 193
aa8393527b1e
child 195
d367b687bc74
equal deleted inserted replaced
193:aa8393527b1e 194:6345f50208d5
258 * evt_enq_conn() --> event handler --> handle_request() 258 * evt_enq_conn() --> event handler --> handle_request()
259 */ 259 */
260 260
261 Event *event = malloc(sizeof(Event)); 261 Event *event = malloc(sizeof(Event));
262 ZERO(event, sizeof(Event)); 262 ZERO(event, sizeof(Event));
263 event->fn = conn->ssl ? evt_request_ssl_accept : evt_request_input; 263 event->fn = conn->ssl && !conn->ssl_accepted ? evt_request_ssl_accept : evt_request_input;
264 event->finish = evt_request_finish; 264 event->finish = evt_request_finish;
265 event->cookie = io; 265 event->cookie = io;
266 266
267 EventHandler *ev = ev_instance(((EventSessionHandler*)handler)->eventhandler); 267 EventHandler *ev = ev_instance(((EventSessionHandler*)handler)->eventhandler);
268 268
303 event->finish = evt_request_error; 303 event->finish = evt_request_error;
304 io->error = 1; 304 io->error = 1;
305 return 0; 305 return 0;
306 } 306 }
307 } 307 }
308 conn->ssl_accepted = WS_TRUE;
308 309
309 // SSL_accept successful, start request input now 310 // SSL_accept successful, start request input now
310 event->fn = evt_request_input; 311 event->fn = evt_request_input;
311 return evt_request_input(handler, event); 312 return evt_request_input(handler, event);
312 } 313 }

mercurial