projects
/
project
/
ubus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
527d252
)
add request cancelled flag
author
Felix Fietkau
<nbd@openwrt.org>
Mon, 31 Jan 2011 01:52:12 +0000
(
02:52
+0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Mon, 31 Jan 2011 01:54:39 +0000
(
02:54
+0100)
libubus.c
patch
|
blob
|
history
libubus.h
patch
|
blob
|
history
diff --git
a/libubus.c
b/libubus.c
index
7bf67a7
..
b889e5a
100644
(file)
--- a/
libubus.c
+++ b/
libubus.c
@@
-178,7
+178,8
@@
static void ubus_process_req_data(struct ubus_request *req)
data = list_first_entry(&req->pending,
struct ubus_pending_data, list);
list_del(&data->list);
data = list_first_entry(&req->pending,
struct ubus_pending_data, list);
list_del(&data->list);
- req->data_cb(req, data->type, data->data);
+ if (!req->cancelled)
+ req->data_cb(req, data->type, data->data);
free(data);
}
}
free(data);
}
}
@@
-300,6
+301,8
@@
void ubus_abort_request(struct ubus_context *ctx, struct ubus_request *req)
if (!list_empty(&req->list))
return;
if (!list_empty(&req->list))
return;
+ req->cancelled = true;
+ ubus_process_req_data(req);
list_del(&req->list);
}
list_del(&req->list);
}
@@
-331,6
+334,9
@@
int ubus_complete_request(struct ubus_context *ctx, struct ubus_request *req)
if (req->status_msg)
return req->status_code;
if (req->status_msg)
return req->status_code;
+ if (req->cancelled)
+ return UBUS_STATUS_NO_DATA;
+
if (!get_next_msg(ctx, true))
return UBUS_STATUS_NO_DATA;
if (!get_next_msg(ctx, true))
return UBUS_STATUS_NO_DATA;
diff --git
a/libubus.h
b/libubus.h
index
bd3d736
..
9c07cae
100644
(file)
--- a/
libubus.h
+++ b/
libubus.h
@@
-88,6
+88,7
@@
struct ubus_request {
bool status_msg;
int status_code;
bool blocked;
bool status_msg;
int status_code;
bool blocked;
+ bool cancelled;
uint32_t peer;
uint32_t seq;
uint32_t peer;
uint32_t seq;