mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-18 19:31:02 +00:00
Let mongoose binary change CWD to document_root
This commit is contained in:
1 parent
dfdfcc060d
commit
675b83a3ef
2 files changed
+4
-1
No files matched your search
@@ -449,6 +449,10 @@ static void start_mongoose(int argc, char *argv[]) {
|
|||||||
free(options[i + 1]);
|
free(options[i + 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Change current working directory to document root. This way,
|
||||||
|
// scripts can use relative paths.
|
||||||
|
chdir(mg_get_option(server, "document_root"));
|
||||||
|
|
||||||
// Add an ability to pass listening socket to mongoose
|
// Add an ability to pass listening socket to mongoose
|
||||||
{
|
{
|
||||||
const char *env = getenv("MONGOOSE_LISTENING_SOCKET");
|
const char *env = getenv("MONGOOSE_LISTENING_SOCKET");
|
||||||
|
|||||||
@@ -2048,7 +2048,6 @@ static int mg_write_chunked(struct connection *conn, const char *buf, int len) {
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void print_dir_entry(const struct dir_entry *de) {
|
static void print_dir_entry(const struct dir_entry *de) {
|
||||||
char size[64], mod[64], href[MAX_PATH_SIZE * 3], chunk[MAX_PATH_SIZE * 4];
|
char size[64], mod[64], href[MAX_PATH_SIZE * 3], chunk[MAX_PATH_SIZE * 4];
|
||||||
int64_t fsize = de->st.st_size;
|
int64_t fsize = de->st.st_size;
|
||||||
|
|||||||
Reference in new issue
Block a user