Detect empty etags coming from server side.

This commit is contained in:
Klaas Freitag 2013-09-16 16:15:15 +02:00
parent c54a3ab7cc
commit de074804eb
4 changed files with 8 additions and 0 deletions

View file

@ -1,2 +1,3 @@
Andreas Schneider <asn@cryptomilk.org>
Klaas Freitag <freitag@owncloud.com>
Olivier Goffart <olivier>

0
doc/makeguide.sh Executable file → Normal file
View file

0
doc/makeman.sh Executable file → Normal file
View file

View file

@ -1099,6 +1099,13 @@ static const char* owncloud_file_id( const char *path )
cbuf = c_strdup(header);
}
}
/* fix server problem: If we end up with an empty string, set something strange... */
if( c_streq(cbuf, "") || c_streq(cbuf, "\"\"") ) {
SAFE_FREE(cbuf);
cbuf = c_strdup("empty_etag");
}
DEBUG_WEBDAV("Get file ID for %s: %s", path, cbuf ? cbuf:"<null>");
if( fs ) csync_vio_file_stat_destroy(fs);
if( req ) ne_request_destroy(req);