Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
8a3ba5c5
Commit
8a3ba5c5
authored
Sep 09, 2016
by
Dominik Hebeler
Browse files
Bug behoben bei dem versucht wurde einen nicht vorhandenen Stream zu schließen.
parent
3e2d81fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Jobs/Search.php
View file @
8a3ba5c5
...
...
@@ -73,7 +73,6 @@ class Search extends Job implements ShouldQueue
if
(
sizeof
((
$tmp
=
explode
(
": "
,
$data
)))
===
2
)
{
$headers
[
strtolower
(
trim
(
$tmp
[
0
]))]
=
trim
(
$tmp
[
1
]);
}
$c
++
;
}
while
(
true
);
...
...
@@ -230,7 +229,7 @@ class Search extends Job implements ShouldQueue
$timeElapsed
=
microtime
(
true
)
-
$time
;
if
(
$timeElapsed
>
0.5
)
{
# Irgendwas ist mit unserem Socket passiert. Wir brauchen einen neuen:
if
(
$this
->
fp
)
{
if
(
$this
->
fp
&&
is_resource
(
$this
->
fp
)
)
{
fclose
(
$this
->
fp
);
}
...
...
@@ -244,10 +243,8 @@ class Search extends Job implements ShouldQueue
$tmp
=
fwrite
(
$this
->
fp
,
$string
);
}
catch
(
\
ErrorException
$e
)
{
# Irgendwas ist mit unserem Socket passiert. Wir brauchen einen neuen:
try
{
if
(
$this
->
fp
&&
is_resource
(
$this
->
fp
))
{
fclose
(
$this
->
fp
);
}
catch
(
\
ErrorException
$e
)
{
}
Redis
::
del
(
$this
->
name
.
"."
.
$this
->
socketNumber
);
...
...
@@ -266,9 +263,11 @@ class Search extends Job implements ShouldQueue
}
}
if
(
$sent
===
strlen
(
$out
))
{
return
true
;
}
return
false
;
}
...
...
@@ -283,6 +282,7 @@ class Search extends Job implements ShouldQueue
# 1. Stelle fest, ob dieser Socket neu erstellt wurde, oder ob ein existierender geöffnet wurde.
$counter
=
0
;
$fp
=
null
;
$time
=
microtime
(
true
);
do
{
if
(
intval
(
Redis
::
exists
(
$this
->
host
.
".
$counter
"
))
===
0
)
{
...
...
@@ -300,7 +300,10 @@ class Search extends Job implements ShouldQueue
stream_set_blocking
(
$fp
,
0
);
$string
=
fgets
(
$fp
,
8192
);
if
(
$string
!==
false
||
feof
(
$fp
))
{
fclose
(
$fp
);
if
(
$this
->
fp
&&
is_resource
(
$this
->
fp
))
{
fclose
(
$fp
);
}
continue
;
}
break
;
...
...
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