Hello together,

im new to this forum and have a question regarding a strange UBUS Timeout we have currently.

We are developing a small C application for OpenWRT 12.09 AA. The UBUS build is from 2013/18/08.
Im using the C librarys (Ubus.h, blobmsg_json.h, libubus.h ) to build the msg and send it to the UBUS.

Scenario:
Send a ubus msg from application A  to application B. Get the ret value of ubus_invoke to check if the msg was received successfully.
Sometimes the ret value is 7 (timeout), sometimes it is 0 (Success).
The strange thing is the recipent did recive the msg everytime independent from the returning value from the ubus_invoke! So i cant trust the return value of ubus_invoke at all. Is there a problem with my code or is this a bug? I need a meaningful answer from ubus the decide if i need send the msg again...

Ubus Code app A broadcaster:

  int ubus_send(struct ubus_context *ctx, struct blob_buf *buf, uint32_t *id) {
  int ret;

  ret = ubus_invoke(ctx, id, "interface", buf->head, NULL, 0, 1000);

  if (ret)
      //doin checkin ... send again etc.

return 0;
}

Ubus code app B recipent:

static int ubus_receive (struct ubus_context *ctx, struct ubus_object *obj,
  struct ubus_request_data *req, const char *method, struct blob_attr *msg){
  struct blob_attr * tb[__RM_MAX];
  struct blob_attr * cur, *curt;
  int rem, n, type;

  blobmsg_parse( ubus_receive_policy, __RM_MAX, tb, blob_data(msg), blob_len(msg));
  if(tb[INTERFACELIST]==NULL){
    return 1;
  }

  //doin more work ...
 
  return 0;
}

Thank you very much!
kind regards,
Tom

PS: sorry for my bad english

(Last edited by Traker on 22 Jan 2015, 14:05)