Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
365b5e8f
Commit
365b5e8f
authored
Oct 01, 2012
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using long for file size in MG_OPEN_FILE ev_data
parent
47651766
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
mongoose.c
mongoose.c
+1
-1
mongoose.h
mongoose.h
+2
-2
No files found.
mongoose.c
View file @
365b5e8f
...
@@ -526,7 +526,7 @@ static int is_file_in_memory(struct mg_connection *conn, const char *path,
...
@@ -526,7 +526,7 @@ static int is_file_in_memory(struct mg_connection *conn, const char *path,
struct
file
*
filep
)
{
struct
file
*
filep
)
{
conn
->
request_info
.
ev_data
=
(
void
*
)
path
;
conn
->
request_info
.
ev_data
=
(
void
*
)
path
;
if
((
filep
->
membuf
=
call_user
(
conn
,
MG_OPEN_FILE
))
!=
NULL
)
{
if
((
filep
->
membuf
=
call_user
(
conn
,
MG_OPEN_FILE
))
!=
NULL
)
{
filep
->
size
=
(
int
)
(
long
)
conn
->
request_info
.
ev_data
;
filep
->
size
=
(
long
)
conn
->
request_info
.
ev_data
;
}
}
return
filep
->
membuf
!=
NULL
;
return
filep
->
membuf
!=
NULL
;
}
}
...
...
mongoose.h
View file @
365b5e8f
...
@@ -87,11 +87,11 @@ enum mg_event {
...
@@ -87,11 +87,11 @@ enum mg_event {
// will use the returned value as a pointer to the file data. This allows
// will use the returned value as a pointer to the file data. This allows
// for example to serve files from memory.
// for example to serve files from memory.
// ev_data contains file path, including document root path.
// ev_data contains file path, including document root path.
// Upon return, ev_data should return file size, which should be a
n
int.
// Upon return, ev_data should return file size, which should be a
long
int.
//
//
// const char *file_name = request_info->ev_data;
// const char *file_name = request_info->ev_data;
// if (strcmp(file_name, "foo.txt") == 0) {
// if (strcmp(file_name, "foo.txt") == 0) {
// request_info->ev_data = (void *) (
int
) 4;
// request_info->ev_data = (void *) (
long
) 4;
// return "data";
// return "data";
// }
// }
// return NULL;
// return NULL;
...
...
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