Skip to content

Commit 2632a14

Browse files
committed
feature: add ngx.fs API for async file operation by nginx worker_thread
1 parent 32d3f58 commit 2632a14

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/ngx_http_lua_async_fs.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@ typedef struct {
5050
typedef struct {
5151
ngx_uint_t op;
5252

53-
u_char *path; /* malloc'd copy */
53+
/* open params */
54+
u_char *path;
5455
int flags;
5556
int create_mode;
5657

58+
/* read/write params */
5759
ngx_fd_t fd;
58-
u_char *buf; /* malloc'd */
60+
u_char *buf;
5961
size_t size;
6062
off_t offset;
6163

@@ -939,6 +941,7 @@ ngx_http_lua_fs_file_tostring(lua_State *L)
939941

940942
if (file->ref == NULL || file->ref->closed) {
941943
lua_pushliteral(L, "file (closed)");
944+
942945
} else {
943946
lua_pushfstring(L, "file (fd=%d)", file->ref->fd);
944947
}

0 commit comments

Comments
 (0)