Section 5. If the person complained of so recognizes, he shall be discharged, but if he refuses or neglects so to do, he shall be committed to the jail or house of correction during the period for which he was required to give security, or until within that time he so recognizes, stating in the warrant the cause of commitment and the sum and time for which security was required.