sync some code in xweb.c with xweb.h changed