Cbhm_Glib_Info *info = data;
Cbhm_Data_Offer *cbhm_data_offer;
char *buf = NULL, *cur_buf;
- int ret, len_remained, size_ret, len_written = 0;
+ int ret, len_remained, size_ret, len_written = 0, retry_cnt = 0;
Cbhm_Received_Data *received_data;
if (!info) return;
ret = write(fd, cur_buf, len_remained);
if (ret == -1) {
if (errno == EINTR || errno == EAGAIN) {
+ retry_cnt++;
+ if (retry_cnt > PIPE_RETRY_MAX) {
+ ERR("[CBHM] write fail. retry_cnt over %d. break (%d) %m\n", PIPE_RETRY_MAX, errno);
+ break;
+ }
continue;
} else {
ERR("[CBHM]_data_source_send : write fail.(%d) %m\n", errno);
break;
}
}
+ else if (ret == 0) {
+ retry_cnt++;
+ if (retry_cnt > PIPE_RETRY_MAX) {
+ ERR("[CBHM] write 0. retry_cnt over %d. break\n", PIPE_RETRY_MAX);
+ break;
+ }
+ continue;
+ }
+
+ retry_cnt = 0;
cur_buf += ret;
len_written += ret;
len_remained -= ret;