Skip to content

Commit

Permalink
Add RangeTransform::m_write_vio state checks (apache#8980)
Browse files Browse the repository at this point in the history
  • Loading branch information
masaori335 committed Aug 2, 2022
1 parent 7bcfcf9 commit e912ece
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion proxy/Transform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,9 @@ RangeTransform::handle_event(int event, void *edata)
} else {
switch (event) {
case VC_EVENT_ERROR:
m_write_vio.cont->handleEvent(VC_EVENT_ERROR, &m_write_vio);
if (m_write_vio.cont) {
m_write_vio.cont->handleEvent(VC_EVENT_ERROR, &m_write_vio);
}
break;
case VC_EVENT_WRITE_COMPLETE:
ink_assert(m_output_vio == (VIO *)edata);
Expand All @@ -814,6 +816,10 @@ RangeTransform::handle_event(int event, void *edata)
}
}

if (!m_write_vio.mutex) {
return 0;
}

MUTEX_TRY_LOCK(trylock, m_write_vio.mutex, this_ethread());
if (!trylock.is_locked()) {
retry(10);
Expand Down

0 comments on commit e912ece

Please sign in to comment.