Cleanup the RetryTimeoutCallback().

When canceling a request or destroying the LibcurlHttpFetcher, a
RetryTimeoutCallback callback could be leaked if the fetcher was
waiting on a network retry.

This patch keeps track of the retry callback and cancels it on CleanUp,
making sure the callback is not leaked.

Bug: 34178297
Test: Added unittest to trigger this case.
Change-Id: I7016641a7f31429933779e55c77cbabb6289c3dd
3 files changed
tree: e789654764a8f2fc3a1093137ea01e7d285601ed
  1. binder_bindings/
  2. client_library/
  3. common/
  4. dbus_bindings/
  5. include/
  6. init/
  7. payload_consumer/
  8. payload_generator/
  9. sample_images/
  10. scripts/
  11. update_manager/
  12. update_payload_key/
  13. weaved/
  14. .gitignore
  15. Android.mk
  16. binder_service_android.cc
  17. binder_service_android.h
  18. binder_service_brillo.cc
  19. binder_service_brillo.h
  20. boot_control_android.cc
  21. boot_control_android.h
  22. boot_control_chromeos.cc
  23. boot_control_chromeos.h
  24. boot_control_chromeos_unittest.cc
  25. boot_control_recovery.cc
  26. boot_control_recovery.h
  27. boot_control_recovery_stub.cc
  28. certificate_checker.cc
  29. certificate_checker.h
  30. certificate_checker_unittest.cc
  31. chrome_browser_proxy_resolver.cc
  32. chrome_browser_proxy_resolver.h
  33. chrome_browser_proxy_resolver_unittest.cc
  34. common_service.cc
  35. common_service.h
  36. common_service_unittest.cc
  37. connection_manager.cc
  38. connection_manager.h
  39. connection_manager_android.cc
  40. connection_manager_android.h
  41. connection_manager_interface.h
  42. connection_manager_unittest.cc
  43. connection_utils.cc
  44. connection_utils.h
  45. daemon.cc
  46. daemon.h
  47. daemon_state_android.cc
  48. daemon_state_android.h
  49. daemon_state_interface.h
  50. dbus_connection.cc
  51. dbus_connection.h
  52. dbus_service.cc
  53. dbus_service.h
  54. dbus_test_utils.h
  55. fake_file_writer.h
  56. fake_p2p_manager.h
  57. fake_p2p_manager_configuration.h
  58. fake_shill_proxy.cc
  59. fake_shill_proxy.h
  60. fake_system_state.cc
  61. fake_system_state.h
  62. generate_pc_file.sh
  63. hardware_android.cc
  64. hardware_android.h
  65. hardware_chromeos.cc
  66. hardware_chromeos.h
  67. hardware_chromeos_unittest.cc
  68. image_properties.h
  69. image_properties_android.cc
  70. image_properties_chromeos.cc
  71. image_properties_chromeos_unittest.cc
  72. libcros_proxy.cc
  73. libcros_proxy.h
  74. libcurl_http_fetcher.cc
  75. libcurl_http_fetcher.h
  76. libupdate_engine-client-test.pc.in
  77. libupdate_engine-client.pc.in
  78. local_coverage_rate
  79. main.cc
  80. metrics.cc
  81. metrics.h
  82. metrics_utils.cc
  83. metrics_utils.h
  84. metrics_utils_unittest.cc
  85. mock_certificate_checker.h
  86. mock_connection_manager.h
  87. mock_file_writer.h
  88. mock_omaha_request_params.h
  89. mock_p2p_manager.h
  90. mock_payload_state.h
  91. mock_power_manager.h
  92. mock_proxy_resolver.h
  93. mock_update_attempter.h
  94. MODULE_LICENSE_APACHE2
  95. network_selector.h
  96. network_selector_android.cc
  97. network_selector_android.h
  98. network_selector_interface.h
  99. network_selector_stub.cc
  100. network_selector_stub.h
  101. NOTICE
  102. omaha_request_action.cc
  103. omaha_request_action.h
  104. omaha_request_action_unittest.cc
  105. omaha_request_params.cc
  106. omaha_request_params.h
  107. omaha_request_params_unittest.cc
  108. omaha_response.h
  109. omaha_response_handler_action.cc
  110. omaha_response_handler_action.h
  111. omaha_response_handler_action_unittest.cc
  112. omaha_utils.cc
  113. omaha_utils.h
  114. omaha_utils_unittest.cc
  115. OWNERS
  116. p2p_manager.cc
  117. p2p_manager.h
  118. p2p_manager_unittest.cc
  119. parcelable_update_engine_status.cc
  120. parcelable_update_engine_status.h
  121. payload_state.cc
  122. payload_state.h
  123. payload_state_interface.h
  124. payload_state_unittest.cc
  125. power_manager_android.cc
  126. power_manager_android.h
  127. power_manager_chromeos.cc
  128. power_manager_chromeos.h
  129. power_manager_interface.h
  130. PRESUBMIT.cfg
  131. PREUPLOAD.cfg
  132. proxy_resolver.cc
  133. proxy_resolver.h
  134. proxy_resolver_unittest.cc
  135. real_system_state.cc
  136. real_system_state.h
  137. run_unittests
  138. sample_omaha_v3_response.xml
  139. service_delegate_android_interface.h
  140. service_observer_interface.h
  141. shill_proxy.cc
  142. shill_proxy.h
  143. shill_proxy_interface.h
  144. sideload_main.cc
  145. system_state.h
  146. tar_bunzip2.gypi
  147. test_http_server.cc
  148. test_subprocess.cc
  149. testrunner.cc
  150. unittest_key.pem
  151. unittest_key2.pem
  152. update_attempter.cc
  153. update_attempter.h
  154. update_attempter_android.cc
  155. update_attempter_android.h
  156. update_attempter_unittest.cc
  157. update_engine-client.gyp
  158. update_engine.conf
  159. update_engine.gyp
  160. update_engine.rc
  161. update_engine_client.cc
  162. update_engine_client_android.cc
  163. update_metadata.proto
  164. update_status_utils.cc
  165. update_status_utils.h
  166. UpdateEngine.conf
  167. utils_android.cc
  168. utils_android.h
  169. WATCHLISTS
  170. weave_service.cc
  171. weave_service.h
  172. weave_service_factory.cc
  173. weave_service_factory.h
  174. weave_service_interface.h