I'd like to abort uclient connection after getting HTTP error code in a
response header.

Example:
static void foo_header_done_cb(struct uclient *cl)
{
        if (cl->status_code != 200) {
                uclient_disconnect(cl);
                uclient_free(cl);
        }
}

The problem is that uclient_http_headers_complete() [1] after calling
"header_done" callback still uses the uclient struct. Freeing it results
in a crash. On the other hand calling uclient_disconnect() without
uclient_free() will result in memory leak.

Any hint, please?

[1] https://lxr.openwrt.org/source/uclient/uclient-http.c#L635

--
Rafał

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to