discover: Add reference to url in load_url_result
authorJeremy Kerr <jk@ozlabs.org>
Tue, 13 Dec 2016 01:13:50 +0000 (09:13 +0800)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Tue, 20 Dec 2016 05:40:21 +0000 (16:40 +1100)
We may want to access the loaded URL in a async handler.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover/paths.c
discover/paths.h
test/parser/utils.c

index 7fcff9e0eaf3d8cc1ceb2e66cb68bbc279fd647f..8d856192b15a1acb0635bcf1c5db792c8a275898 100644 (file)
@@ -383,6 +383,7 @@ struct load_url_result *load_url_async(void *ctx, struct pb_url *url,
        task->async = async_cb != NULL;
        task->result = talloc_zero(ctx, struct load_url_result);
        task->result->task = task;
        task->async = async_cb != NULL;
        task->result = talloc_zero(ctx, struct load_url_result);
        task->result->task = task;
+       task->result->url = url;
        task->process = process_create(task);
        if (task->async) {
                task->async_cb = async_cb;
        task->process = process_create(task);
        if (task->async) {
                task->async_cb = async_cb;
index ed0e153f88a63c169c66308811db10e8d1c6793b..191b8dc84c6a5debcfeb3333362898f1b0d31f5a 100644 (file)
@@ -30,6 +30,7 @@ struct load_url_result {
 
                LOAD_CANCELLED,
        } status;
 
                LOAD_CANCELLED,
        } status;
+       struct pb_url           *url;
        const char              *local;
        bool                    cleanup_local;
        struct load_task        *task;
        const char              *local;
        bool                    cleanup_local;
        struct load_task        *task;
index 6bc7cc5e021ff4ea8d421dbe6a4507c52d521eb0..9d40d2b1e17bf123326e263c0307e60e92206fc6 100644 (file)
@@ -353,6 +353,7 @@ struct load_url_result *load_url_async(void *ctx, struct pb_url *url,
                return NULL;
 
        result->local = talloc_strdup(result, tmp);
                return NULL;
 
        result->local = talloc_strdup(result, tmp);
+       result->url = url;
        if (rc < 0)
                result->status = LOAD_ERROR;
        else
        if (rc < 0)
                result->status = LOAD_ERROR;
        else