http-push.c: remove duplicated code