Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
d08a3bb4
Commit
d08a3bb4
authored
12 years ago
by
Lukas Reschke
Browse files
Options
Downloads
Plain Diff
Merge pull request #1590 from owncloud/fix_470
append .part to put files
parents
72a33e01
1263511a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/connector/sabre/file.php
+7
-1
7 additions, 1 deletion
lib/connector/sabre/file.php
lib/files/cache/scanner.php
+17
-1
17 additions, 1 deletion
lib/files/cache/scanner.php
with
24 additions
and
2 deletions
lib/connector/sabre/file.php
+
7
−
1
View file @
d08a3bb4
...
...
@@ -45,7 +45,13 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
*/
public
function
put
(
$data
)
{
\OC\Files\Filesystem
::
file_put_contents
(
$this
->
path
,
$data
);
// mark file as partial while uploading (ignored by the scanner)
$partpath
=
$this
->
path
.
'.part'
;
\OC\Files\Filesystem
::
file_put_contents
(
$partpath
,
$data
);
// rename to correct path
\OC\Files\Filesystem
::
rename
(
$partpath
,
$this
->
path
);
return
OC_Connector_Sabre_Node
::
getETagPropertyForPath
(
$this
->
path
);
}
...
...
This diff is collapsed.
Click to expand it.
lib/files/cache/scanner.php
+
17
−
1
View file @
d08a3bb4
...
...
@@ -97,7 +97,7 @@ class Scanner {
if
(
$this
->
storage
->
is_dir
(
$path
)
&&
(
$dh
=
$this
->
storage
->
opendir
(
$path
)))
{
\OC_DB
::
beginTransaction
();
while
(
$file
=
readdir
(
$dh
))
{
if
(
$file
!==
'.'
and
$file
!==
'..'
)
{
if
(
!
$this
->
isIgnoredFile
(
$file
)
)
{
$child
=
(
$path
)
?
$path
.
'/'
.
$file
:
$file
;
$data
=
$this
->
scanFile
(
$child
);
if
(
$data
)
{
...
...
@@ -133,6 +133,22 @@ class Scanner {
}
return
$size
;
}
/**
* @brief check if the file should be ignored when scanning
* NOTE: files with a '.part' extension are ignored as well!
* prevents unfinished put requests to be scanned
* @param String $file
* @return boolean
*/
private
function
isIgnoredFile
(
$file
)
{
if
(
$file
===
'.'
||
$file
===
'..'
||
pathinfo
(
$file
,
PATHINFO_EXTENSION
)
===
'part'
)
{
return
true
;
}
return
false
;
}
/**
* walk over any folders that are not fully scanned yet and scan them
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment