Lines Matching refs:cctx

48     struct custom_ctx *cctx = (struct custom_ctx *)ctx;  in _rym_recv_begin()  local
52 ret = strchr(cctx->fpath,insert_0); in _rym_recv_begin()
63 cctx->fd = open(cctx->fpath, O_CREAT | O_WRONLY | O_TRUNC, 0); in _rym_recv_begin()
64 if (cctx->fd < 0) in _rym_recv_begin()
70 cctx->flen = atoi(1 + (const char *)buf + rt_strnlen((const char *)buf, len - 1)); in _rym_recv_begin()
71 if (cctx->flen == 0) in _rym_recv_begin()
72 cctx->flen = -1; in _rym_recv_begin()
82 struct custom_ctx *cctx = (struct custom_ctx *)ctx; in _rym_recv_data() local
84 RT_ASSERT(cctx->fd >= 0); in _rym_recv_data()
85 if (cctx->flen == -1) in _rym_recv_data()
87 write(cctx->fd, buf, len); in _rym_recv_data()
91 int wlen = len > cctx->flen ? cctx->flen : len; in _rym_recv_data()
92 write(cctx->fd, buf, wlen); in _rym_recv_data()
93 cctx->flen -= wlen; in _rym_recv_data()
104 struct custom_ctx *cctx = (struct custom_ctx *)ctx; in _rym_recv_end() local
106 RT_ASSERT(cctx->fd >= 0); in _rym_recv_end()
107 close(cctx->fd); in _rym_recv_end()
108 cctx->fd = -1; in _rym_recv_end()
118 struct custom_ctx *cctx = (struct custom_ctx *)ctx; in _rym_send_begin() local
123 cctx->fd = open(cctx->fpath, O_RDONLY); in _rym_send_begin()
124 if (cctx->fd < 0) in _rym_send_begin()
131 err = stat(cctx->fpath, &file_buf); in _rym_send_begin()
138 const char *fdst = _get_path_lastname(cctx->fpath); in _rym_send_begin()
139 if(fdst != cctx->fpath) in _rym_send_begin()
158 struct custom_ctx *cctx = (struct custom_ctx *)ctx; in _rym_send_data() local
165 read_size += read(cctx->fd, buf + read_size, len - read_size); in _rym_send_data()
188 struct custom_ctx *cctx = (struct custom_ctx *)ctx; in _rym_send_end() local
190 close(cctx->fd); in _rym_send_end()
191 cctx->fd = -1; in _rym_send_end()