[http] Avoid recursive call of bufferevent write callback when https is in use.

This commit is contained in:
Jiaqiang Xu 2013-02-19 11:30:56 +08:00
parent 788ada4b31
commit db015503e6

View File

@ -450,6 +450,10 @@ do_file(evhtp_request_t *req, SeafRepo *repo, const char *file_id,
*/
evhtp_request_pause (req);
/* Avoid recursive call of write_data_cb(). */
if (req->htp->ssl_cfg != NULL)
evbuffer_defer_callbacks (bev->output, bev->ev_base);
/* Kick start data transfer by sending out http headers. */
evhtp_send_reply_start(req, EVHTP_RES_OK);
@ -563,6 +567,10 @@ do_dir (evhtp_request_t *req, SeafRepo *repo, const char *dir_id,
*/
evhtp_request_pause (req);
/* Avoid recursive call of write_dir_data_cb(). */
if (req->htp->ssl_cfg != NULL)
evbuffer_defer_callbacks (bev->output, bev->ev_base);
/* Kick start data transfer by sending out http headers. */
evhtp_send_reply_start(req, EVHTP_RES_OK);