Protocal: more strict check the start/end of transfer

Check two points:
1. The start's Keyword
2. The end's kerword or condition

Signed-off-by: fjling <jialingfu@hotmail.com>