Changeset 441 for EcnlProtoTool/trunk/ntshell/webserver/httpd-fs.c
- Timestamp:
- Jul 10, 2020, 9:09:25 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/ntshell/webserver/httpd-fs.c
r436 r441 63 63 #endif /* NULL */ 64 64 65 extern ntstdio_t ntstdio;65 extern ntstdio_t *ntstdio; 66 66 67 67 /*-----------------------------------------------------------------------------------*/ … … 89 89 } 90 90 else { 91 ntstdio_printf( &ntstdio, "%s/%s\n", path, fn);91 ntstdio_printf(ntstdio, "%s/%s\n", path, fn); 92 92 } 93 93 } … … 114 114 if ((res = f_open(fd, name, FA_OPEN_EXISTING | FA_READ)) != FR_OK) { 115 115 if ((res = f_opendir(&dir, name)) != FR_OK) { 116 ntstdio_printf( &ntstdio, "f_opendir(%s) => %d\n", name, res);116 ntstdio_printf(ntstdio, "f_opendir(%s) => %d\n", name, res); 117 117 return 0; 118 118 } 119 119 120 120 if ((res = f_readdir(&dir, &fno)) != FR_OK) { 121 ntstdio_printf( &ntstdio, "f_readdir(%s) => %d\n", name, res);121 ntstdio_printf(ntstdio, "f_readdir(%s) => %d\n", name, res); 122 122 return 0; 123 123 } … … 132 132 133 133 if (res != FR_OK) { 134 ntstdio_printf( &ntstdio, "f_open(%s) => %d %x\n", name, res, fno.fattrib);134 ntstdio_printf(ntstdio, "f_open(%s) => %d %x\n", name, res, fno.fattrib); 135 135 return 0; 136 136 } … … 139 139 file->len = fd->fsize; 140 140 141 //ntstdio_printf( &ntstdio, "httpd_fs_open(%s) %d\n", name, file->len);141 //ntstdio_printf(ntstdio, "httpd_fs_open(%s) %d\n", name, file->len); 142 142 143 143 return 1; … … 158 158 159 159 if ((res = f_open(fd, name, FA_CREATE_ALWAYS | FA_WRITE)) != FR_OK) { 160 ntstdio_printf( &ntstdio, "f_open(%s) => %d\n", name, res);160 ntstdio_printf(ntstdio, "f_open(%s) => %d\n", name, res); 161 161 return 0; 162 162 } … … 165 165 file->len = 0; 166 166 167 //ntstdio_printf( &ntstdio, "httpd_fs_create(%s) %d\n", file->name, file->len);167 //ntstdio_printf(ntstdio, "httpd_fs_create(%s) %d\n", file->name, file->len); 168 168 169 169 return 1; … … 179 179 180 180 if ((ret = f_lseek(fd, file->pos)) != FR_OK) { 181 ntstdio_printf( &ntstdio, "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); 182 182 return 0; 183 183 } 184 184 185 185 if (file->pos != fd->fptr) { 186 ntstdio_printf( &ntstdio, "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); 187 187 } 188 188 189 189 if ((ret = f_read(fd, dst, len, &rlen)) != FR_OK) { 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);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); 195 195 196 196 return rlen; … … 206 206 207 207 if ((ret = f_lseek(fd, file->pos)) != FR_OK) { 208 ntstdio_printf( &ntstdio, "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); 209 209 return 0; 210 210 } 211 211 212 212 if (file->pos != fd->fptr) { 213 ntstdio_printf( &ntstdio, "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); 214 214 } 215 215 216 216 if ((ret = f_write(fd, src, len, &rlen)) != FR_OK) { 217 ntstdio_printf( &ntstdio, "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); 218 218 return 0; 219 219 } … … 222 222 file->len += rlen; 223 223 224 //ntstdio_printf( &ntstdio, "httpd_fs_write(%s, %d, %d) => %d\n", file->name, file->pos, len, rlen);224 //ntstdio_printf(ntstdio, "httpd_fs_write(%s, %d, %d) => %d\n", file->name, file->pos, len, rlen); 225 225 226 226 return rlen; … … 234 234 235 235 if ((ret = f_close(fd)) != FR_OK) { 236 ntstdio_printf( &ntstdio, "f_close(%s) => %d\n", file->name, ret);236 ntstdio_printf(ntstdio, "f_close(%s) => %d\n", file->name, ret); 237 237 return 0; 238 238 }
Note:
See TracChangeset
for help on using the changeset viewer.