Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
cfbc3c51
Commit
cfbc3c51
authored
Nov 26, 2019
by
Francesc Guasch
Browse files
refactor(ports); fixes when many created at once
parent
fd9f9694
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/Ravada.pm
View file @
cfbc3c51
...
...
@@ -2388,7 +2388,6 @@ sub _do_execute_command {
if
(
$err
)
{
my
$user
=
$request
->
defined_arg
('
user
');
if
(
$user
)
{
warn
"
sending message to
"
.
$user
->
id
.
"
"
.
$user
->
name
;
my
$subject
=
$err
;
my
$message
=
'';
if
(
length
(
$subject
)
>
40
)
{
...
...
lib/Ravada/Domain.pm
View file @
cfbc3c51
...
...
@@ -2290,14 +2290,21 @@ sub _add_expose($self, $internal_port, $name, $restricted) {
.
"
VALUES (?,?,?,?,?)
"
);
my
$public_port
=
$self
->
_vm
->
_new_free_port
();
$sth
->
execute
(
$self
->
id
,
$public_port
,
$internal_port
,
(
$name
or
undef
)
,
$restricted
);
$sth
->
finish
;
my
$public_port
;
for
(;;)
{
eval
{
$public_port
=
$self
->
_vm
->
_new_free_port
();
$sth
->
execute
(
$self
->
id
,
$public_port
,
$internal_port
,
(
$name
or
undef
)
,
$restricted
);
$sth
->
finish
;
};
last
if
!
$@
;
confess
$@
if
$@
&&
$@
!~
/Duplicate entry .*for key 'public/
;
}
$self
->
_open_exposed_port
(
$internal_port
,
$name
,
$restricted
)
if
$self
->
is_active
&&
$self
->
ip
;
...
...
Write
Preview
Supports
Markdown
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