Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
3b62a276
Commit
3b62a276
authored
May 15, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(firmware) add session close for long running api action
parent
c2087c3b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
ApiControllerBase.php
...e/mvc/app/controllers/OPNsense/Base/ApiControllerBase.php
+9
-1
FirmwareController.php
.../app/controllers/OPNsense/Core/Api/FirmwareController.php
+1
-0
ServiceController.php
.../app/controllers/OPNsense/Proxy/Api/ServiceController.php
+1
-1
No files found.
src/opnsense/mvc/app/controllers/OPNsense/Base/ApiControllerBase.php
View file @
3b62a276
...
...
@@ -46,6 +46,14 @@ class ApiControllerBase extends Controller
$this
->
view
->
disable
();
}
/**
* Wrap close session, for long running operations.
*/
protected
function
sessionClose
()
{
session_write_close
();
}
/**
* before routing event
* @param Dispatcher $dispatcher
...
...
@@ -82,7 +90,7 @@ class ApiControllerBase extends Controller
}
/**
/**
* process API results, serialize return data to json.
* @param $dispatcher
* @return string json data
...
...
src/opnsense/mvc/app/controllers/OPNsense/Core/Api/FirmwareController.php
View file @
3b62a276
...
...
@@ -43,6 +43,7 @@ class FirmwareController extends ApiControllerBase
*/
public
function
statusAction
()
{
$this
->
sessionClose
();
// long running action, close session
$backend
=
new
Backend
();
$response
=
json_decode
(
trim
(
$backend
->
configdRun
(
"firmware pkgstatus"
)),
true
);
...
...
src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/ServiceController.php
View file @
3b62a276
...
...
@@ -106,7 +106,7 @@ class ServiceController extends ApiControllerBase
public
function
reconfigureAction
()
{
// close session for long running action
session_write_c
lose
();
$this
->
sessionC
lose
();
$mdlProxy
=
new
Proxy
();
$backend
=
new
Backend
();
...
...
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