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
9ce84860
Commit
9ce84860
authored
9 years ago
by
Dmitry Frank
Committed by
rojer
9 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename v7_create_ -> v7_mk_
PUBLISHED_FROM=58f7275b4b250b5bfccaf6539a2915c2c253e95c
parent
04a32115
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
mongoose.c
mongoose.c
+10
-11
No files found.
mongoose.c
View file @
9ce84860
...
@@ -2055,7 +2055,7 @@ static enum v7_err mg_send_js(struct v7 *v7, v7_val_t *res) {
...
@@ -2055,7 +2055,7 @@ static enum v7_err mg_send_js(struct v7 *v7, v7_val_t *res) {
mg_send
(
c
,
data
,
len
);
mg_send
(
c
,
data
,
len
);
}
}
*
res
=
v7_
create
_number
(
len
);
*
res
=
v7_
mk
_number
(
len
);
return
V7_OK
;
return
V7_OK
;
}
}
...
@@ -4596,29 +4596,28 @@ void http_handler(struct mg_connection *nc, int ev, void *ev_data) {
...
@@ -4596,29 +4596,28 @@ void http_handler(struct mg_connection *nc, int ev, void *ev_data) {
v2
=
v7_get
(
v7
,
v1
,
ev_name
,
~
0
);
v2
=
v7_get
(
v7
,
v1
,
ev_name
,
~
0
);
/* Create callback params. TODO(lsm): own/disown those */
/* Create callback params. TODO(lsm): own/disown those */
args
=
v7_
create
_array
(
v7
);
args
=
v7_
mk
_array
(
v7
);
req
=
v7_
create
_object
(
v7
);
req
=
v7_
mk
_object
(
v7
);
headers
=
v7_
create
_object
(
v7
);
headers
=
v7_
mk
_object
(
v7
);
/* Populate request object */
/* Populate request object */
v7_set
(
v7
,
req
,
"method"
,
~
0
,
v7_set
(
v7
,
req
,
"method"
,
~
0
,
v7_create_string
(
v7
,
hm
->
method
.
p
,
hm
->
method
.
len
,
1
));
v7_mk_string
(
v7
,
hm
->
method
.
p
,
hm
->
method
.
len
,
1
));
v7_set
(
v7
,
req
,
"uri"
,
~
0
,
v7_set
(
v7
,
req
,
"uri"
,
~
0
,
v7_mk_string
(
v7
,
hm
->
uri
.
p
,
hm
->
uri
.
len
,
1
));
v7_create_string
(
v7
,
hm
->
uri
.
p
,
hm
->
uri
.
len
,
1
));
v7_set
(
v7
,
req
,
"body"
,
~
0
,
v7_set
(
v7
,
req
,
"body"
,
~
0
,
v7_
create
_string
(
v7
,
hm
->
body
.
p
,
hm
->
body
.
len
,
1
));
v7_
mk
_string
(
v7
,
hm
->
body
.
p
,
hm
->
body
.
len
,
1
));
v7_set
(
v7
,
req
,
"headers"
,
~
0
,
headers
);
v7_set
(
v7
,
req
,
"headers"
,
~
0
,
headers
);
for
(
i
=
0
;
hm
->
header_names
[
i
].
len
>
0
;
i
++
)
{
for
(
i
=
0
;
hm
->
header_names
[
i
].
len
>
0
;
i
++
)
{
const
struct
mg_str
*
name
=
&
hm
->
header_names
[
i
];
const
struct
mg_str
*
name
=
&
hm
->
header_names
[
i
];
const
struct
mg_str
*
value
=
&
hm
->
header_values
[
i
];
const
struct
mg_str
*
value
=
&
hm
->
header_values
[
i
];
v7_set
(
v7
,
headers
,
name
->
p
,
name
->
len
,
v7_set
(
v7
,
headers
,
name
->
p
,
name
->
len
,
v7_
create
_string
(
v7
,
value
->
p
,
value
->
len
,
1
));
v7_
mk
_string
(
v7
,
value
->
p
,
value
->
len
,
1
));
}
}
/* Invoke callback. TODO(lsm): report errors */
/* Invoke callback. TODO(lsm): report errors */
v7_array_push
(
v7
,
args
,
v7_
create
_foreign
(
nc
));
v7_array_push
(
v7
,
args
,
v7_
mk
_foreign
(
nc
));
v7_array_push
(
v7
,
args
,
req
);
v7_array_push
(
v7
,
args
,
req
);
if
(
v7_apply
(
v7
,
v2
,
v7_
create
_undefined
(),
args
,
&
res
)
==
V7_OK
&&
if
(
v7_apply
(
v7
,
v2
,
v7_
mk
_undefined
(),
args
,
&
res
)
==
V7_OK
&&
v7_is_true
(
v7
,
res
))
{
v7_is_true
(
v7
,
res
))
{
js_callback_handled_request
++
;
js_callback_handled_request
++
;
}
}
...
...
This diff is collapsed.
Click to expand it.
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