Changeset 436 for EcnlProtoTool/trunk/ntshell/webserver/httpd-fs.c
- Timestamp:
- Jul 6, 2020, 9:22:43 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/ntshell/webserver/httpd-fs.c
r434 r436 1 1 /* 2 * TOPPERS ECHONET Lite Communication Middleware3 * 4 * Copyright (C) 2017 Cores Co., Ltd. Japan2 * TOPPERS PROJECT Home Network Working Group Software 3 * 4 * Copyright (C) 2017-2019 Cores Co., Ltd. Japan 5 5 * 6 6 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ … … 63 63 #endif /* NULL */ 64 64 65 extern ntstdio_t ntstdio; 66 65 67 /*-----------------------------------------------------------------------------------*/ 66 68 #ifdef FILE_DUMP … … 87 89 } 88 90 else { 89 syslog(LOG_ERROR, "%s/%s\n", path, fn);91 ntstdio_printf(&ntstdio, "%s/%s\n", path, fn); 90 92 } 91 93 } … … 112 114 if ((res = f_open(fd, name, FA_OPEN_EXISTING | FA_READ)) != FR_OK) { 113 115 if ((res = f_opendir(&dir, name)) != FR_OK) { 114 syslog(LOG_ERROR, "f_opendir(%s) => %d\n", name, res);116 ntstdio_printf(&ntstdio, "f_opendir(%s) => %d\n", name, res); 115 117 return 0; 116 118 } 117 119 118 120 if ((res = f_readdir(&dir, &fno)) != FR_OK) { 119 syslog(LOG_ERROR, "f_readdir(%s) => %d\n", name, res);121 ntstdio_printf(&ntstdio, "f_readdir(%s) => %d\n", name, res); 120 122 return 0; 121 123 } … … 130 132 131 133 if (res != FR_OK) { 132 syslog(LOG_ERROR, "f_open(%s) => %d %x\n", name, res, fno.fattrib);134 ntstdio_printf(&ntstdio, "f_open(%s) => %d %x\n", name, res, fno.fattrib); 133 135 return 0; 134 136 } … … 137 139 file->len = fd->fsize; 138 140 139 // syslog(LOG_ERROR, "httpd_fs_open(%d:%s) %d\n", drv, name, file->len);141 //ntstdio_printf(&ntstdio, "httpd_fs_open(%s) %d\n", name, file->len); 140 142 141 143 return 1; … … 156 158 157 159 if ((res = f_open(fd, name, FA_CREATE_ALWAYS | FA_WRITE)) != FR_OK) { 158 syslog(LOG_ERROR, "f_open(%s) => %d\n", name, res);160 ntstdio_printf(&ntstdio, "f_open(%s) => %d\n", name, res); 159 161 return 0; 160 162 } … … 163 165 file->len = 0; 164 166 165 // syslog(LOG_ERROR, "httpd_fs_create(%d:%s) %d\n", drv,name, file->len);167 //ntstdio_printf(&ntstdio, "httpd_fs_create(%s) %d\n", file->name, file->len); 166 168 167 169 return 1; … … 177 179 178 180 if ((ret = f_lseek(fd, file->pos)) != FR_OK) { 179 syslog(LOG_ERROR, "f_lseek(%s, %d) => %d\n", file->name, file->pos, ret);181 ntstdio_printf(&ntstdio, "f_lseek(%s, %d) => %d\n", file->name, file->pos, ret); 180 182 return 0; 181 183 } 182 184 183 185 if (file->pos != fd->fptr) { 184 syslog(LOG_ERROR, "f_lseek(%s, %d) != %d\n", file->name, file->pos, fd->fptr);186 ntstdio_printf(&ntstdio, "f_lseek(%s, %d) != %d\n", file->name, file->pos, fd->fptr); 185 187 } 186 188 187 189 if ((ret = f_read(fd, dst, len, &rlen)) != FR_OK) { 188 syslog(LOG_ERROR, "f_read(%s, 0x%p, %d) => %d\n", file->name, dst, len, ret);189 return 0; 190 } 191 192 // syslog(LOG_ERROR, "httpd_fs_read(%d:%s, %d, %d) => %d\n", file->drv, file->name, file->pos, len, rlen);190 ntstdio_printf(&ntstdio, "f_read(%s, 0x%p, %d) => %d\n", file->name, dst, len, ret); 191 return 0; 192 } 193 194 //ntstdio_printf(&ntstdio, "httpd_fs_read(%s, %d, %d) => %d\n", file->name, file->pos, len, rlen); 193 195 194 196 return rlen; … … 204 206 205 207 if ((ret = f_lseek(fd, file->pos)) != FR_OK) { 206 syslog(LOG_ERROR, "f_lseek(%s, %d) => %d\n", file->name, file->pos, ret);208 ntstdio_printf(&ntstdio, "f_lseek(%s, %d) => %d\n", file->name, file->pos, ret); 207 209 return 0; 208 210 } 209 211 210 212 if (file->pos != fd->fptr) { 211 syslog(LOG_ERROR, "f_lseek(%s, %d) != %d\n", file->name, file->pos, fd->fptr);213 ntstdio_printf(&ntstdio, "f_lseek(%s, %d) != %d\n", file->name, file->pos, fd->fptr); 212 214 } 213 215 214 216 if ((ret = f_write(fd, src, len, &rlen)) != FR_OK) { 215 syslog(LOG_ERROR, "f_write(%s, 0x%p, %d) => %d\n", file->name, src, len, ret);217 ntstdio_printf(&ntstdio, "f_write(%s, 0x%p, %d) => %d\n", file->name, src, len, ret); 216 218 return 0; 217 219 } … … 220 222 file->len += rlen; 221 223 222 // syslog(LOG_ERROR, "httpd_fs_write(%d:%s, %d, %d) => %d\n", file->drv, file->name, file->pos, len, rlen);224 //ntstdio_printf(&ntstdio, "httpd_fs_write(%s, %d, %d) => %d\n", file->name, file->pos, len, rlen); 223 225 224 226 return rlen; … … 232 234 233 235 if ((ret = f_close(fd)) != FR_OK) { 234 syslog(LOG_ERROR, "f_close(%s) => %d\n", file->name, ret);236 ntstdio_printf(&ntstdio, "f_close(%s) => %d\n", file->name, ret); 235 237 return 0; 236 238 }
Note:
See TracChangeset
for help on using the changeset viewer.