Lines Matching refs:ftp

57  * @ftp: pointer to FTP command specification
60 * in content cache (for the file/cmd specified in @ftp)
62 static ssize_t hmcdrv_cache_get(const struct hmcdrv_ftp_cmdspec *ftp)
67 if ((ftp->id != hmcdrv_cache_file.id) ||
68 strcmp(hmcdrv_cache_file.fname, ftp->fname))
71 if (ftp->ofs >= hmcdrv_cache_file.fsize) /* EOF ? */
81 len = hmcdrv_cache_file.fsize - ftp->ofs;
83 if (len > ftp->len)
84 len = ftp->len;
89 pos = ftp->ofs - hmcdrv_cache_file.ofs;
94 memcpy(ftp->buf,
109 * @ftp: pointer to FTP command specification
114 static ssize_t hmcdrv_cache_do(const struct hmcdrv_ftp_cmdspec *ftp,
121 * request (hmcdrv_cache_file.len >= ftp->len) and there is a need
122 * to do so (ftp->len > 0)
124 if ((ftp->len > 0) && (hmcdrv_cache_file.len >= ftp->len)) {
126 /* because the cache is not located at ftp->buf, we have to
130 struct hmcdrv_ftp_cmdspec cftp = *ftp; /* make a copy */
138 len, ftp->fname);
140 if (len > ftp->len)
141 len = ftp->len;
143 hmcdrv_cache_file.ofs = ftp->ofs;
146 memcpy(ftp->buf, hmcdrv_cache_file.content, len);
149 len = func(ftp, &hmcdrv_cache_file.fsize);
157 strscpy(hmcdrv_cache_file.fname, ftp->fname,
159 hmcdrv_cache_file.id = ftp->id;
161 ftp->id, hmcdrv_cache_file.fsize, ftp->fname);
169 * @ftp: pointer to FTP command specification
177 ssize_t hmcdrv_cache_cmd(const struct hmcdrv_ftp_cmdspec *ftp,
182 if ((ftp->id == HMCDRV_FTP_DIR) || /* read cache */
183 (ftp->id == HMCDRV_FTP_NLIST) ||
184 (ftp->id == HMCDRV_FTP_GET)) {
186 len = hmcdrv_cache_get(ftp);
191 len = hmcdrv_cache_do(ftp, func);
197 len = func(ftp, NULL); /* simply do original command */