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
dccc524a
Commit
dccc524a
authored
Aug 02, 2012
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed fseek() on large files on windows, using _lseeki64() and not casting to off_t
parent
b42d25ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
mongoose.c
mongoose.c
+3
-3
No files found.
mongoose.c
View file @
dccc524a
...
...
@@ -122,7 +122,7 @@ typedef long off_t;
#define close(x) _close(x)
#define dlsym(x,y) GetProcAddress((HINSTANCE) (x), (y))
#define RTLD_LAZY 0
#define fseeko(x, y, z)
fseek(
(x), (y), (z))
#define fseeko(x, y, z)
_lseeki64(_fileno
(x), (y), (z))
#define fdopen(x, y) _fdopen((x), (y))
#define write(x, y, z) _write((x), (y), (unsigned) z)
#define read(x, y, z) _read((x), (y), (unsigned) z)
...
...
@@ -2554,7 +2554,7 @@ static void handle_file_request(struct mg_connection *conn, const char *path,
hdr
=
mg_get_header
(
conn
,
"Range"
);
if
(
hdr
!=
NULL
&&
(
n
=
parse_range_header
(
hdr
,
&
r1
,
&
r2
))
>
0
)
{
conn
->
request_info
.
status_code
=
206
;
(
void
)
fseeko
(
fp
,
(
off_t
)
r1
,
SEEK_SET
);
(
void
)
fseeko
(
fp
,
r1
,
SEEK_SET
);
cl
=
n
==
2
?
r2
-
r1
+
1
:
cl
-
r1
;
(
void
)
mg_snprintf
(
conn
,
range
,
sizeof
(
range
),
"Content-Range: bytes "
...
...
@@ -3138,7 +3138,7 @@ static void put_file(struct mg_connection *conn, const char *path) {
if
(
range
!=
NULL
&&
parse_range_header
(
range
,
&
r1
,
&
r2
)
>
0
)
{
conn
->
request_info
.
status_code
=
206
;
// TODO(lsm): handle seek error
(
void
)
fseeko
(
fp
,
(
off_t
)
r1
,
SEEK_SET
);
(
void
)
fseeko
(
fp
,
r1
,
SEEK_SET
);
}
if
(
forward_body_data
(
conn
,
fp
,
INVALID_SOCKET
,
NULL
))
(
void
)
mg_printf
(
conn
,
"HTTP/1.1 %d OK
\r\n\r\n
"
,
...
...
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