Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
mongoose
Commits
b015e33e
Commit
b015e33e
authored
Feb 14, 2020
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate
https://github.com/cesanta/mongoose/pull/1096
- dir listing nits
PUBLISHED_FROM=a343bd61f98cbcc0f8cab02a62b912e494c27601
parent
96e762d4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
26 deletions
+28
-26
mongoose.c
mongoose.c
+14
-13
mg_http.c
src/mg_http.c
+14
-13
No files found.
mongoose.c
View file @
b015e33e
...
...
@@ -7731,7 +7731,7 @@ static void mg_print_dir_entry(struct mg_connection *nc, const char *file_name,
href
=
mg_url_encode
(
mg_mk_str
(
file_name
));
mg_printf_http_chunk
(
nc
,
"<tr><td><a href=
\"
%s%s
\"
>%s%s</a></td>"
"<td>%s</td><td name=
%"
INT64_FMT
">%s</td></tr>
\n
"
,
"<td>%s</td><td name=
\"
%"
INT64_FMT
"
\"
>%s</td></tr>
"
,
href
.
p
,
slash
,
path
,
slash
,
mod
,
is_dir
?
-
1
:
fsize
,
size
);
free
((
void
*
)
href
.
p
);
...
...
@@ -7797,23 +7797,24 @@ static void mg_send_directory_listing(struct mg_connection *nc, const char *dir,
mg_printf_http_chunk
(
nc
,
"<html><head><title>Index of %.*s</title>%s%s"
"<
!DOCTYPE html><
html><head><title>Index of %.*s</title>%s%s"
"<style>th,td {text-align: left; padding-right: 1em; "
"font-family: monospace; }</style></head>
\n
"
"<body><h1>Index of %.*s</h1>
\n
<table cellpadding=0
><thead>"
"<tr><th><a href=
# rel=0
>Name</a></th><th>"
"<a href=
# rel=1>Modified</a
</th>"
"<th><a href=
# rel=2
>Size</a></th></tr>"
"<tr><td colspan=
3><hr></td></tr>
\n
"
"</thead>
\n
"
"<tbody id=
tb
>"
,
"font-family: monospace; }</style></head>"
"<body><h1>Index of %.*s</h1>
<table cellpadding=
\"
0
\"
><thead>"
"<tr><th><a href=
\"
#
\"
rel=
\"
0
\"
>Name</a></th><th>"
"<a href=
\"
#
\"
rel=
\"
1
\"
>Modified</a>
</th>"
"<th><a href=
\"
#
\"
rel=
\"
2
\"
>Size</a></th></tr>"
"<tr><td colspan=
\"
3
\"
><hr></td></tr>
"
"</thead>"
"<tbody id=
\"
tb
\"
>"
,
(
int
)
hm
->
uri
.
len
,
hm
->
uri
.
p
,
sort_js_code
,
sort_js_code2
,
(
int
)
hm
->
uri
.
len
,
hm
->
uri
.
p
);
mg_scan_directory
(
nc
,
dir
,
opts
,
mg_print_dir_entry
);
mg_printf_http_chunk
(
nc
,
"</tbody><tr><td colspan=3><hr></td></tr>
\n
"
"</table>
\n
"
"<address>%s</address>
\n
"
"</tbody>"
"<tfoot><tr><td colspan=
\"
3
\"
><hr></td></tr></tfoot>"
"</table>"
"<address>%s</address>"
"</body></html>"
,
mg_version_header
);
mg_send_http_chunk
(
nc
,
""
,
0
);
...
...
src/mg_http.c
View file @
b015e33e
...
...
@@ -2102,7 +2102,7 @@ static void mg_print_dir_entry(struct mg_connection *nc, const char *file_name,
href
=
mg_url_encode
(
mg_mk_str
(
file_name
));
mg_printf_http_chunk
(
nc
,
"<tr><td><a href=
\"
%s%s
\"
>%s%s</a></td>"
"<td>%s</td><td name=
%"
INT64_FMT
">%s</td></tr>
\n
"
,
"<td>%s</td><td name=
\"
%"
INT64_FMT
"
\"
>%s</td></tr>
"
,
href
.
p
,
slash
,
path
,
slash
,
mod
,
is_dir
?
-
1
:
fsize
,
size
);
free
((
void
*
)
href
.
p
);
...
...
@@ -2168,23 +2168,24 @@ static void mg_send_directory_listing(struct mg_connection *nc, const char *dir,
mg_printf_http_chunk
(
nc
,
"<html><head><title>Index of %.*s</title>%s%s"
"<
!DOCTYPE html><
html><head><title>Index of %.*s</title>%s%s"
"<style>th,td {text-align: left; padding-right: 1em; "
"font-family: monospace; }</style></head>
\n
"
"<body><h1>Index of %.*s</h1>
\n
<table cellpadding=0
><thead>"
"<tr><th><a href=
# rel=0
>Name</a></th><th>"
"<a href=
# rel=1>Modified</a
</th>"
"<th><a href=
# rel=2
>Size</a></th></tr>"
"<tr><td colspan=
3><hr></td></tr>
\n
"
"</thead>
\n
"
"<tbody id=
tb
>"
,
"font-family: monospace; }</style></head>"
"<body><h1>Index of %.*s</h1>
<table cellpadding=
\"
0
\"
><thead>"
"<tr><th><a href=
\"
#
\"
rel=
\"
0
\"
>Name</a></th><th>"
"<a href=
\"
#
\"
rel=
\"
1
\"
>Modified</a>
</th>"
"<th><a href=
\"
#
\"
rel=
\"
2
\"
>Size</a></th></tr>"
"<tr><td colspan=
\"
3
\"
><hr></td></tr>
"
"</thead>"
"<tbody id=
\"
tb
\"
>"
,
(
int
)
hm
->
uri
.
len
,
hm
->
uri
.
p
,
sort_js_code
,
sort_js_code2
,
(
int
)
hm
->
uri
.
len
,
hm
->
uri
.
p
);
mg_scan_directory
(
nc
,
dir
,
opts
,
mg_print_dir_entry
);
mg_printf_http_chunk
(
nc
,
"</tbody><tr><td colspan=3><hr></td></tr>
\n
"
"</table>
\n
"
"<address>%s</address>
\n
"
"</tbody>"
"<tfoot><tr><td colspan=
\"
3
\"
><hr></td></tr></tfoot>"
"</table>"
"<address>%s</address>"
"</body></html>"
,
mg_version_header
);
mg_send_http_chunk
(
nc
,
""
,
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment