Section 20. A jailer or officer who, through negligence, suffers a prisoner in his custody upon conviction or upon a charge of crime to escape, or wilfully refuses to receive into his custody a prisoner lawfully directed to be committed thereto upon conviction, upon a charge of crime, or upon a lawful process, shall be punished by a fine of not more than five hundred dollars or by imprisonment for not more than two years.