cbhm_data_offer = info->cbhm_data_offer;
if (info->data_source != source) {
- WRN("[CBHM]_data_source_send: source changed\n");
- buf = strdup("CLIPBOARD_EMPTY");
+ WRN("[CBHM]_data_source_send: source changed (current:%p, request:%p)\n", info->data_source, source);
+ goto done;
} else if (LIST_IS_EMPTY(&info->received_data_list)) {
WRN("[CBHM]_data_source_send: no saved data\n");
- buf = strdup("CLIPBOARD_EMPTY");
+ goto done;
} else {
LIST_FOR_EACH_ENTRY(received_data, &info->received_data_list, item_link) {
if (!strcmp(received_data->mimetype, mime_type)) {
if (!buf) {
WRN("[CBHM]_data_source_send: type mismatch (%s)\n", mime_type);
- buf = strdup("CLIPBOARD_EMPTY");
+ goto done;
}
size_ret = strlen(buf) + 1;
if (size_ret <= 1) {
ERR("[CBHM]_data_source_send: size_ret is not correct\n");
free(buf);
- return;
+ goto done;
}
cur_buf = buf;
cur_buf = NULL;
free(buf);
buf = NULL;
-
+done:
close(fd);
}
ERR("[CBHM]_cbhm_set_selection: wl_data_device_manager_create_data_source fail\n");
return;
}
+ INF("[CBHM]_cbhm_set_selection create source(%p)\n", info->data_source);
LIST_FOR_EACH_ENTRY(mime, &cbhm_data_offer->offer_mimetype_list, item_link) {
t = wl_array_add(&info->types, sizeof(*t));
cbhm_data_offer = info->cbhm_data_offer;
if (info->data_received_count == cbhm_data_offer->type_count) {
- INF("[CBHM]_cbhm_offer_receive: already received all type data : %d", cbhm_data_offer->type_count);
+ INF("[CBHM]_cbhm_offer_receive: already received all type data : %d\n", cbhm_data_offer->type_count);
return;
}
info->temp_mime_type = strdup(mime->mimetype);
break;
}
- INF("[CBHM]_cbhm_offer_receive: selected mime type : %s", info->temp_mime_type);
+ INF("[CBHM]_cbhm_offer_receive: selected mime type : %s\n", info->temp_mime_type);
if (pipe2(pipe, O_CLOEXEC) == -1) {
ERR("[CBHM]_cbhm_offer_receive: pipe2 fail\n");