You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.8 KiB

  1. Author: Alexandre Rossi <alexandre.rossi@gmail.com>
  2. Description: Fix download stalling on recent libevhtp
  3. A while ago[1], evhtp_request_pause() behavior changed: it now disables
  4. both read and write events. seafile-server would then stall.
  5. .
  6. [1] https://github.com/criticalstack/libevhtp/commit/6cd89466fd6bd76c5b8624be65af5893afe3e40c
  7. [2] https://github.com/haiwen/seafile/issues/1119
  8. Forwarded: no
  9. Index: seafile-server/server/access-file.c
  10. ===================================================================
  11. --- seafile-server.orig/server/access-file.c 2018-02-01 12:23:53.209308343 +0100
  12. +++ seafile-server/server/access-file.c 2018-02-01 12:23:53.205308288 +0100
  13. @@ -618,7 +618,7 @@
  14. /* Block any new request from this connection before finish
  15. * handling this request.
  16. */
  17. - evhtp_request_pause (req);
  18. + bufferevent_disable(bev, EV_READ);
  19. /* Kick start data transfer by sending out http headers. */
  20. evhtp_send_reply_start(req, EVHTP_RES_OK);
  21. @@ -967,7 +967,7 @@
  22. /* Block any new request from this connection before finish
  23. * handling this request.
  24. */
  25. - evhtp_request_pause (req);
  26. + bufferevent_disable(bev, EV_READ);
  27. /* Kick start data transfer by sending out http headers. */
  28. evhtp_send_reply_start(req, EVHTP_RES_PARTIAL);
  29. @@ -1032,7 +1032,7 @@
  30. /* Block any new request from this connection before finish
  31. * handling this request.
  32. */
  33. - evhtp_request_pause (req);
  34. + bufferevent_disable(bev, EV_READ);
  35. /* Kick start data transfer by sending out http headers. */
  36. evhtp_send_reply_start(req, EVHTP_RES_OK);
  37. @@ -1365,7 +1365,7 @@
  38. /* Block any new request from this connection before finish
  39. * handling this request.
  40. */
  41. - evhtp_request_pause (req);
  42. + bufferevent_disable(bev, EV_READ);
  43. /* Kick start data transfer by sending out http headers. */
  44. evhtp_send_reply_start(req, EVHTP_RES_OK);
  45. Index: seafile-server/server/upload-file.c
  46. ===================================================================
  47. --- seafile-server.orig/server/upload-file.c 2018-02-01 12:23:53.209308343 +0100
  48. +++ seafile-server/server/upload-file.c 2018-02-01 12:25:14.542400155 +0100
  49. @@ -2054,6 +2054,7 @@
  50. if (res != EVHTP_RES_OK) {
  51. /* Don't receive any data before the connection is closed. */
  52. //evhtp_request_pause (req);
  53. + // or for later evhtp bufferevent_disable(evhtp_request_get_bev(req), EV_READ);
  54. /* Set keepalive to 0. This will cause evhtp to close the
  55. * connection after sending the reply.
  56. @@ -2271,6 +2272,7 @@
  57. err:
  58. /* Don't receive any data before the connection is closed. */
  59. //evhtp_request_pause (req);
  60. + // or for later evhtp bufferevent_disable(evhtp_request_get_bev(req), EV_READ);
  61. /* Set keepalive to 0. This will cause evhtp to close the
  62. * connection after sending the reply.