Commits

Andy Green authored 0caf9c5acb0
handle http union transition properly There's no proper transition to http union state until now. It only becomes apparant there's a problem when you try to return -1 from the HTTP callback, during the close action it will try to close() a nonsense, nonzero fd pointer in the uninitialized u.http union member. This patch takes a copy of the allocated headers struct from the u.hdr union state, transitions to u.http clearing down u and then calls the HTTP callback with URI args pointing to the still-in-scope ah allocation. After the call, the copy ah is freed. That makes sure we are in the correct union state while still giving the HTTP callback access to the URI without having to copy it around. Reported-by: Edwin can den Oetelaar <oetelaar.automatisering@gmail.com> Signed-off-by: Andy Green <andy.green@linaro.org>