[pan2/testing: 74/279] NOTE: uploading now works, as it seems. no SIGPIPE or anything. let's see....



commit 674eafa67bdf1f75dc3facccc71673b17da646fe
Author: Heinrich Mueller <sphemuel stud informatik uni-erlangen de>
Date:   Wed Jun 1 03:51:24 2011 +0200

    NOTE: uploading now works, as it seems. no SIGPIPE or anything. let's see....

 pan/data-impl/data-impl.cc |   16 ++++++++--------
 pan/data-impl/data-impl.h  |    1 -
 pan/data/Makefile.am       |    2 --
 pan/gui/gui.h              |    1 -
 pan/gui/post-ui.cc         |   18 ++++++++++--------
 pan/gui/post-ui.h          |    8 ++++----
 pan/tasks/nzb.cc           |    2 +-
 pan/tasks/task-upload.cc   |   28 +++++++++++++++-------------
 pan/tasks/task-upload.h    |    6 +++---
 9 files changed, 41 insertions(+), 41 deletions(-)
---
diff --git a/pan/data-impl/data-impl.cc b/pan/data-impl/data-impl.cc
index 80a1442..8cc8acc 100644
--- a/pan/data-impl/data-impl.cc
+++ b/pan/data-impl/data-impl.cc
@@ -50,14 +50,14 @@ namespace
     return path;
   }
 
-  std::string get_encode_cache_path ()
-  {
-    char * pch (g_build_filename (file::get_pan_home().c_str(), "encode-cache", NULL));
-    file :: ensure_dir_exists (pch);
-    std::string path (pch);
-    g_free (pch);
-    return path;
-  }
+//  std::string get_encode_cache_path ()
+//  {
+//    char * pch (g_build_filename (file::get_pan_home().c_str(), "encode-cache", NULL));
+//    file :: ensure_dir_exists (pch);
+//    std::string path (pch);
+//    g_free (pch);
+//    return path;
+//  }
 }
 
 DataImpl :: DataImpl (bool unit_test, int cache_megs, DataIO * io):
diff --git a/pan/data-impl/data-impl.h b/pan/data-impl/data-impl.h
index 24f1dbc..cdb9b51 100644
--- a/pan/data-impl/data-impl.h
+++ b/pan/data-impl/data-impl.h
@@ -35,7 +35,6 @@
 #include <pan/usenet-utils/scorefile.h>
 #include <pan/data/article.h>
 #include <pan/data/article-cache.h>
-#include <pan/data/encode-cache.h>
 #include <pan/data/data.h>
 #include <pan/tasks/queue.h>
 #include <pan/data-impl/data-io.h>
diff --git a/pan/data/Makefile.am b/pan/data/Makefile.am
index 0c7e0f6..7c0f654 100644
--- a/pan/data/Makefile.am
+++ b/pan/data/Makefile.am
@@ -6,7 +6,6 @@ noinst_LIBRARIES = libdata.a
 
 libdata_a_SOURCES = \
  article.cc \
- encode-cache.cc \
  article-cache.cc \
  data.cc \
  parts.cc \
@@ -14,7 +13,6 @@ libdata_a_SOURCES = \
 
 noinst_HEADERS = \
  article.h \
- encode-cache.h \
  article-cache.h \
  data.h \
  defgroup.h \
diff --git a/pan/gui/gui.h b/pan/gui/gui.h
index 598e91f..b3ab564 100644
--- a/pan/gui/gui.h
+++ b/pan/gui/gui.h
@@ -22,7 +22,6 @@
 #include <pan/general/log.h>
 #include <pan/general/progress.h>
 #include <pan/data/article-cache.h>
-#include <pan/data/encode-cache.h>
 #include <pan/tasks/queue.h>
 
 #include <pan/gui/action-manager.h>
diff --git a/pan/gui/post-ui.cc b/pan/gui/post-ui.cc
index bc06f4c..3ea8ec6 100644
--- a/pan/gui/post-ui.cc
+++ b/pan/gui/post-ui.cc
@@ -2314,7 +2314,6 @@ PostUI :: remove_files (void)
     _file_queue_tasks.remove(*nit);
     delete (ptr);
   }
-  std::cerr<<"tasks size: "<<_file_queue_tasks.size()<<std::endl;
   update_filequeue_tab();
 }
 
@@ -2473,15 +2472,17 @@ PostUI :: PostUI (GtkWindow    * parent,
                   Profiles     & profiles,
                   GMimeMessage * message,
                   Prefs        & prefs,
-                  GroupPrefs   & group_prefs,
-                  ArticleCache & cache):
+                  GroupPrefs   & group_prefs
+//                  ,
+//                  ArticleCache & cache):
+                  ):
   _data (data),
   _queue (queue),
   _gs (gs),
   _profiles (profiles),
   _prefs (prefs),
   _group_prefs (group_prefs),
-  _cache (cache),
+//  _cache (cache),
   _root (0),
   _from_combo (0),
   _subject_entry (0),
@@ -2551,8 +2552,9 @@ PostUI :: create_window (GtkWindow    * parent,
                          Profiles     & profiles,
                          GMimeMessage * message,
                          Prefs        & prefs,
-                         GroupPrefs   & group_prefs,
-                         ArticleCache & cache)
+                         GroupPrefs   & group_prefs)
+//                         ,
+//                         ArticleCache & cache)
 {
   // can't post without a profile...
   if (!profiles.has_profiles())
@@ -2573,7 +2575,7 @@ PostUI :: create_window (GtkWindow    * parent,
       return 0;
   }
 
-  return new PostUI (0, data, queue, gs, profiles, message, prefs, group_prefs, cache);
+  return new PostUI (0, data, queue, gs, profiles, message, prefs, group_prefs);//, cache);
 }
 
 void
@@ -2628,7 +2630,7 @@ PostUI :: prompt_user_for_queueable_files (tasks_v& queue, GtkWindow * parent, c
     for (; cur; cur = cur->next, ++i)
 		{
 		  TaskUpload* tmp = new TaskUpload(std::string((const char*)cur->data),
-                               profile.posting_server,  _cache,
+                               profile.posting_server,  //_cache,
                                groups, subject, author, 0, 0,
                                TaskUpload::YENC);
 		  _file_queue_tasks.push_back(tmp);
diff --git a/pan/gui/post-ui.h b/pan/gui/post-ui.h
index d219e92..b064951 100644
--- a/pan/gui/post-ui.h
+++ b/pan/gui/post-ui.h
@@ -46,13 +46,13 @@ namespace pan
   {
     public:
       static PostUI* create_window (GtkWindow*, Data&, Queue&, GroupServer&, Profiles&,
-                                    GMimeMessage*, Prefs&, GroupPrefs&, ArticleCache&);
+                                    GMimeMessage*, Prefs&, GroupPrefs&);//, ArticleCache&);
 
       void prompt_user_for_queueable_files (tasks_v& queue, GtkWindow * parent, const Prefs& prefs);
 
     protected:
       PostUI (GtkWindow*, Data&, Queue&, GroupServer&, Profiles&,
-              GMimeMessage*, Prefs&, GroupPrefs&, ArticleCache&);
+              GMimeMessage*, Prefs&, GroupPrefs&);//, ArticleCache&);
     public:
       ~PostUI ();
 
@@ -186,8 +186,8 @@ namespace pan
       static gboolean group_entry_changed_idle (gpointer);
       static void group_entry_changed_cb (GtkEditable*, gpointer);
 
-    protected:
-      ArticleCache& _cache;
+//    protected:
+//      ArticleCache& _cache;
 
     public:
       void set_spellcheck_enabled (bool);
diff --git a/pan/tasks/nzb.cc b/pan/tasks/nzb.cc
index fcb5428..d4ac6dd 100644
--- a/pan/tasks/nzb.cc
+++ b/pan/tasks/nzb.cc
@@ -183,7 +183,7 @@ namespace
       TaskUpload::needed_t tmp2;
       foreach (TaskUpload::needed_t, mc.needed_parts, it)
         tmp2.insert(*it);
-      TaskUpload* tmp = new TaskUpload (mc.path, const_cast<const Quark&>(mc.posting_server), mc.cache,
+      TaskUpload* tmp = new TaskUpload (mc.path, const_cast<const Quark&>(mc.posting_server), //mc.cache,
                           mc.groups, mc.a.subject.to_string(), mc.a.author.to_string(), &tmp2, 0, TaskUpload::YENC);
       mc.tasks.push_back (tmp);
     }
diff --git a/pan/tasks/task-upload.cc b/pan/tasks/task-upload.cc
index 5107025..6db5f48 100644
--- a/pan/tasks/task-upload.cc
+++ b/pan/tasks/task-upload.cc
@@ -64,13 +64,13 @@ namespace
 }
 
 
-//namespace
-//{
-//  void delete_cache(const TaskUpload::Needed& n)
-//  {
-//    unlink(n.filename.c_str());
-//  }
-//}
+namespace
+{
+  void delete_cache(const TaskUpload::Needed& n)
+  {
+    unlink(n.filename.c_str());
+  }
+}
 
 /***
 ****
@@ -78,7 +78,7 @@ namespace
 
 TaskUpload :: TaskUpload ( const std::string         & filename,
                            const Quark               & server,
-                           ArticleCache              & cache,
+//                           ArticleCache              & cache,
                            quarks_t                  & groups,
                            std::string                 subject,
                            std::string                 author,
@@ -89,7 +89,7 @@ TaskUpload :: TaskUpload ( const std::string         & filename,
   _filename(filename),
   _basename (g_path_get_basename(filename.c_str())),
   _server(server),
-  _cache(cache),
+//  _cache(cache),
   _groups(groups),
   _subject (subject),
   _author(author),
@@ -146,7 +146,7 @@ TaskUpload :: build_needed_tasks(bool imported)
   _needed_parts = cnt;
 
   // reserve cache
-  _cache.reserve (names);
+//  _cache.reserve (names);
 }
 
 void
@@ -249,9 +249,11 @@ TaskUpload :: on_nntp_done (NNTP * nntp,
       increment_step(1);
       break;
     case ERR_NETWORK:
-      _state.set_need_nntp(nntp->_server);
-      break;
+//      update_work();
+//      check_in (nntp, health);
+      goto _end;
     case ERR_COMMAND:
+      delete_cache(it->second);
       _needed.erase (it);
       break;
   }
@@ -276,7 +278,7 @@ TaskUpload :: on_nntp_done (NNTP * nntp,
       break;
   }
 
-
+  _end:
   update_work(nntp);
   check_in (nntp, health);
 
diff --git a/pan/tasks/task-upload.h b/pan/tasks/task-upload.h
index 95d899e..188f83d 100644
--- a/pan/tasks/task-upload.h
+++ b/pan/tasks/task-upload.h
@@ -27,7 +27,7 @@
 #include <pan/general/worker-pool.h>
 #include <pan/general/locking.h>
 #include <pan/data/article.h>
-#include <pan/data/article-cache.h>
+//#include <pan/data/article-cache.h>
 #include <pan/data/data.h>
 #include <pan/data/xref.h>
 #include <pan/tasks/nntp.h>
@@ -72,7 +72,7 @@ namespace pan
       // life cycle
       TaskUpload ( const std::string         & filename,
                    const Quark               & server,
-                   ArticleCache              & cache,
+//                   ArticleCache              & cache,
                    quarks_t                  & groups,
                    std::string                 subject,
                    std::string                 author,
@@ -125,7 +125,7 @@ namespace pan
       int _total_parts, _needed_parts;
       unsigned long _bytes;
       Mutex mut;
-      ArticleCache& _cache;
+//      ArticleCache& _cache;
 
       void build_needed_tasks(bool);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]