mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-26 12:14:56 +00:00
Update packed fs
This commit is contained in:
1 parent
4fec149345
commit
a76ade9bb2
6 files changed
+34
-13
No files matched your search
+3
-2
@@ -22,8 +22,9 @@ const char *mg_unlist(size_t no) {
|
||||
#endif
|
||||
|
||||
static int is_dir_prefix(const char *prefix, size_t n, const char *path) {
|
||||
return n < strlen(path) && memcmp(prefix, path, n) == 0 && path[n] == '/';
|
||||
//(n == 0 || path[n] == MG_DIRSEP);
|
||||
// MG_INFO(("[%.*s] [%s] %c", (int) n, prefix, path, path[n]));
|
||||
return n < strlen(path) && strncmp(prefix, path, n) == 0 &&
|
||||
(n == 0 || path[n] == '/' || path[n - 1] == '/');
|
||||
}
|
||||
|
||||
static int packed_stat(const char *path, size_t *size, time_t *mtime) {
|
||||
|
||||
+1
-1
@@ -383,7 +383,7 @@ static void static_cb(struct mg_connection *c, int ev, void *ev_data,
|
||||
// Read to send IO buffer directly, avoid extra on-stack buffer
|
||||
size_t n, max = 2 * MG_IO_SIZE;
|
||||
if (c->send.size < max) mg_iobuf_resize(&c->send, max);
|
||||
if (c->send.len > 0) return; // Wait until drained: for some LWIP setups
|
||||
if (c->send.len >= c->send.size) return; // Rate limit
|
||||
n = fd->fs->rd(fd->fd, c->send.buf + c->send.len,
|
||||
c->send.size - c->send.len);
|
||||
c->send.len += n;
|
||||
|
||||
Reference in new issue
Block a user