Cosmic-ray diffusive acceleration at shock waves with finite upstream and downstream escape boundaries