Skip to content
Browse files

o There was a report of a 2.7.1 ICE, apparently on a generated move

  constructor. Let's add an explicit copy constructor and see what
  happens.
  • Loading branch information...
1 parent 11c2493 commit e2c7d54e61ae2b5e02acb1008bb1dd5e731bd2eb @hzeller committed Sep 28, 2012
Showing with 22 additions and 6 deletions.
  1. +19 −3 file-handler.h
  2. +3 −3 folve-filesystem.cc
View
22 file-handler.h
@@ -2,7 +2,7 @@
// Folve - A fuse filesystem that convolves audio files on-the-fly.
//
// Copyright (C) 2012 Henner Zeller <h.zeller@acm.org>
-//
+//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
@@ -22,10 +22,26 @@
#include <string>
// Status about some handler, filled in by various subsystem.
-struct HandlerStats {
+// This is mostly used to be displayed in the HTTP server. And to survive
+// after the FileHandler is long gone, to show 'retired' elements in the
+// status server.
+class HandlerStats {
+public:
HandlerStats()
: duration_seconds(-1), progress(-1), status(OPEN), last_access(0),
max_output_value(0), in_gapless(false), out_gapless(false) {}
+
+ // Copy constructor: test to work around some gcc 2.7.1 seen in the field.
+ // To be removed after test.
+ HandlerStats(const HandlerStats &other)
+ : filename(other.filename), format(other.format), message(other.message),
+ duration_seconds(other.duration_seconds), progress(other.progress),
+ status(other.status), last_access(other.last_access),
+ max_output_value(other.max_output_value),
+ in_gapless(other.in_gapless), out_gapless(other.out_gapless),
+ filter_id(other.filter_id) {
+ }
+
std::string filename; // filesystem name.
std::string format; // File format info if recognized.
std::string message; // Per file (error) message if any.
@@ -59,7 +75,7 @@ class FileHandler {
virtual int Stat(struct stat *st) = 0;
// Get handler status.
- virtual void GetHandlerStatus(struct HandlerStats *s) = 0;
+ virtual void GetHandlerStatus(HandlerStats *s) = 0;
virtual bool AcceptProcessor(SoundProcessor *s) { return false; }
private:
View
6 folve-filesystem.cc
@@ -75,13 +75,13 @@ class PassThroughHandler : public FileHandler {
virtual int Stat(struct stat *st) {
return fstat(filedes_, st);
}
- virtual void GetHandlerStatus(struct HandlerStats *stats) {
+ virtual void GetHandlerStatus(HandlerStats *stats) {
*stats = info_stats_;
if (file_size_ > 0) {
stats->progress = 1.0 * max_accessed_ / file_size_;
}
}
-
+
private:
const int filedes_;
size_t file_size_;
@@ -203,7 +203,7 @@ class SndFileHandler :
return output_buffer_->Read(buf, size, offset);
}
- virtual void GetHandlerStatus(struct HandlerStats *stats) {
+ virtual void GetHandlerStatus(HandlerStats *stats) {
boost::lock_guard<boost::mutex> l(stats_mutex_);
if (processor_ != NULL) {
base_stats_.max_output_value = processor_->max_output_value();

0 comments on commit e2c7d54

Please sign in to comment.
Something went wrong with that request. Please try again.