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
238b43af
Commit
238b43af
authored
Jan 08, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Squashed warnings for gcc 4.6.3
parent
12c8e99b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
mongoose.c
mongoose.c
+6
-8
No files found.
mongoose.c
View file @
238b43af
...
@@ -2899,12 +2899,10 @@ static int lsp_sock_send(lua_State *L) {
...
@@ -2899,12 +2899,10 @@ static int lsp_sock_send(lua_State *L) {
lua_getfield
(
L
,
-
2
,
"sock"
);
lua_getfield
(
L
,
-
2
,
"sock"
);
sock
=
(
int
)
lua_tonumber
(
L
,
-
1
);
sock
=
(
int
)
lua_tonumber
(
L
,
-
1
);
while
(
sent
<
len
)
{
while
(
sent
<
len
)
{
if
((
n
=
send
(
sock
,
buf
+
sent
,
len
-
sent
,
0
))
<=
0
)
{
if
((
n
=
send
(
sock
,
buf
+
sent
,
len
-
sent
,
0
))
<=
0
)
break
;
break
;
}
sent
+=
n
;
sent
+=
n
;
}
}
lua_pushnumber
(
L
,
n
);
lua_pushnumber
(
L
,
sent
);
}
else
{
}
else
{
return
luaL_error
(
L
,
"invalid :close() call"
);
return
luaL_error
(
L
,
"invalid :close() call"
);
}
}
...
@@ -3001,8 +2999,8 @@ static void prepare_lua_environment(struct mg_connection *ri, lua_State *L) {
...
@@ -3001,8 +2999,8 @@ static void prepare_lua_environment(struct mg_connection *ri, lua_State *L) {
lua_setglobal
(
L
,
"mg"
);
lua_setglobal
(
L
,
"mg"
);
// Register default mg.onerror function
// Register default mg.onerror function
luaL_dostring
(
L
,
"mg.onerror = function(e) mg.write('
\\
nLua error:
\\
n',
"
(
void
)
luaL_dostring
(
L
,
"mg.onerror = function(e) mg.write('
\\
nLua
"
"
debug.traceback(e, 1)) end"
);
"error:
\\
n',
debug.traceback(e, 1)) end"
);
}
}
static
int
lua_error_handler
(
lua_State
*
L
)
{
static
int
lua_error_handler
(
lua_State
*
L
)
{
...
@@ -3014,10 +3012,10 @@ static int lua_error_handler(lua_State *L) {
...
@@ -3014,10 +3012,10 @@ static int lua_error_handler(lua_State *L) {
lua_pushstring
(
L
,
error_msg
);
lua_pushstring
(
L
,
error_msg
);
lua_pushliteral
(
L
,
"
\n
"
);
lua_pushliteral
(
L
,
"
\n
"
);
lua_call
(
L
,
2
,
0
);
lua_call
(
L
,
2
,
0
);
luaL_dostring
(
L
,
"mg.write(debug.traceback(), '
\\
n')"
);
(
void
)
luaL_dostring
(
L
,
"mg.write(debug.traceback(), '
\\
n')"
);
}
else
{
}
else
{
printf
(
"Lua error: [%s]
\n
"
,
error_msg
);
printf
(
"Lua error: [%s]
\n
"
,
error_msg
);
luaL_dostring
(
L
,
"print(debug.traceback(), '
\\
n')"
);
(
void
)
luaL_dostring
(
L
,
"print(debug.traceback(), '
\\
n')"
);
}
}
// TODO(lsm): leave the stack balanced
// TODO(lsm): leave the stack balanced
...
...
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