[pan2: 128/268] removed rng.*



commit 27a97bedd1588bc3e2e212c1532b437186f33ada
Author: Heinrich MÃller <sphemuel stud informatik uni-erlangen de>
Date:   Tue Jul 12 21:08:27 2011 +0200

    removed rng.*

 pan/gui/post-ui.cc           |    6 ++----
 pan/tasks/encoder.cc         |   15 ---------------
 pan/tasks/task-upload.cc     |    6 +++---
 pan/tasks/task-xover.cc      |    2 +-
 pan/usenet-utils/Makefile.am |    6 ++----
 uulib/uuencode.c             |   11 ++++++-----
 6 files changed, 14 insertions(+), 32 deletions(-)
---
diff --git a/pan/gui/post-ui.cc b/pan/gui/post-ui.cc
index 8d4953f..5405cd2 100644
--- a/pan/gui/post-ui.cc
+++ b/pan/gui/post-ui.cc
@@ -2729,8 +2729,7 @@ PostUI :: get_total_parts(const char* file, TaskUpload* it)
 {
     struct stat sb;
     stat (file,&sb);
-    int bpf = _prefs.get_int("upload-option-bpf",1024*512);
-    return std::max(1,(int)std::ceil(sb.st_size / bpf));
+    return std::max(1,(int)std::ceil((double)sb.st_size / (double)_prefs.get_int("upload-option-bpf",1024*512)));
 }
 
 void
@@ -3059,8 +3058,7 @@ PostUI :: prompt_user_for_queueable_files (GtkWindow * parent, const Prefs& pref
           struct stat sb;
           // yEnc encoding is the default, user can change that with popup-menu
           stat ((const char*)cur->data,&sb);
-          ui.total = std::max(1,(int)std::ceil(sb.st_size / (double)_prefs.get_int("upload-option-bpf",1024*512)));
-
+          ui.total = std::max(1,(int)std::ceil((double)sb.st_size / (double)_prefs.get_int("upload-option-bpf",1024*512)));
           TaskUpload* tmp = new TaskUpload(std::string((const char*)cur->data),
                             profile.posting_server, _cache,
                             a, ui, msg ,0, TaskUpload::YENC);
diff --git a/pan/tasks/encoder.cc b/pan/tasks/encoder.cc
index c39c340..bedfac1 100644
--- a/pan/tasks/encoder.cc
+++ b/pan/tasks/encoder.cc
@@ -132,21 +132,6 @@ Encoder :: do_work()
               enc = YENC_ENCODED;
               break;
           case TaskUpload::PLAIN:
-//              in.open(filename.c_str(), std::ios::in);
-//              char buf[4096];
-//              cache->get_filename(cachename, it->second.message_id);
-//              out.open(cachename, std::ios::out);
-//
-//              out<<"MIME-Version: 1.0\n";
-////              out << "Content-Type: text/plain\n";
-//              out << "Content-Transfer-Encoding: 8bit\n";
-//              out << "Content-Disposition: attachment; filename=\""<<basename<<"\"\n";
-//
-//              while (in.good()) out << (char)in.get();
-//              out.close();
-//              in.close();
-//              res = UURET_OK;
-//              goto _no_encode;
               enc = PT_ENCODED;
               break;
           case TaskUpload::BASE64:
diff --git a/pan/tasks/task-upload.cc b/pan/tasks/task-upload.cc
index 099f5b5..fcb94a9 100644
--- a/pan/tasks/task-upload.cc
+++ b/pan/tasks/task-upload.cc
@@ -149,9 +149,9 @@ TaskUpload :: update_work (NNTP* checkin_pending)
   }
   else if ((_encoder_has_run && !_needed.empty()))
   {
-//    _state.set_completed();
-//    set_finished(_queue_pos);
-    _state.set_need_nntp(_server);
+    _state.set_completed();
+    set_finished(_queue_pos);
+//    _state.set_need_nntp(_server);
   }
   else if (_needed.empty())
   {
diff --git a/pan/tasks/task-xover.cc b/pan/tasks/task-xover.cc
index 77fd955..8b48c7c 100644
--- a/pan/tasks/task-xover.cc
+++ b/pan/tasks/task-xover.cc
@@ -414,7 +414,7 @@ TaskXOver :: on_nntp_done (NNTP              * nntp,
                            Health              health,
                            const StringView  & response UNUSED)
 {
-  if (_running_minitasks == 0) process_headers(nntp);
+  if (_running_minitasks == 0 && _xzver) process_headers(nntp);
 
   update_work (true);
   check_in (nntp, health);
diff --git a/pan/usenet-utils/Makefile.am b/pan/usenet-utils/Makefile.am
index 5df4edb..73e833a 100644
--- a/pan/usenet-utils/Makefile.am
+++ b/pan/usenet-utils/Makefile.am
@@ -10,8 +10,7 @@ libusenetutils_a_SOURCES = \
  numbers.cc \
  scorefile.cc \
  text-massager.cc \
- url-find.cc \
- rng.cc
+ url-find.cc 
 
 noinst_HEADERS = \
  defgroup.h \
@@ -22,8 +21,7 @@ noinst_HEADERS = \
  numbers.h \
  scorefile.h \
  text-massager.h \
- url-find.h \
- rng.h
+ url-find.h 
 
 noinst_PROGRAMS = \
  gnksa-test \
diff --git a/uulib/uuencode.c b/uulib/uuencode.c
index 0f74ae1..47117ab 100644
--- a/uulib/uuencode.c
+++ b/uulib/uuencode.c
@@ -701,7 +701,7 @@ UUEncodeStream_byFSize (FILE *outfile, FILE *infile, int encoding, long bpf, crc
 
   if (encoding == PT_ENCODED || encoding == QP_ENCODED)
     {
-      while (rest > 0 )
+      while (!feof (infile) && rest > 0 )
       {
         current = rest > 255 ? 255 : rest;
 
@@ -733,7 +733,6 @@ UUEncodeStream_byFSize (FILE *outfile, FILE *infile, int encoding, long bpf, crc
           {
 //            UUMessage (uuencode_id, __LINE__, UUMSG_NOTE,
 //                       uustring (S_ENCODE_CANCEL));
-            printf("cancel\n");
             return UURET_CANCEL;
           }
 
@@ -750,7 +749,6 @@ UUEncodeStream_byFSize (FILE *outfile, FILE *infile, int encoding, long bpf, crc
                     fwrite ((char *) eolstring, sizeof(unsigned char),
                             strlen(eolstring), outfile) != strlen (eolstring))
                   {
-                    printf("error count>0 \n");
                     return UURET_IOERR;
                   }
               }
@@ -759,7 +757,6 @@ UUEncodeStream_byFSize (FILE *outfile, FILE *infile, int encoding, long bpf, crc
                 size_t res;
                 if ((res=fwrite (itemp, sizeof(unsigned char), count, outfile)) != count)
                   {
-                    printf("error count %d %u %lu\n",count, res,llen);
                     return UURET_IOERR;
                   }
               }
@@ -887,7 +884,7 @@ UUEncodeStream_byFSize (FILE *outfile, FILE *infile, int encoding, long bpf, crc
     long rest = bpf;
     long current = 0;
 
-    while (rest > 0)
+    while (!feof (infile) && rest > 0)
     {
       current = rest > 128 ? 128 : rest;
 
@@ -1710,6 +1707,7 @@ UUEncodePartial_byFSize (FILE *outfile, FILE *infile,
           mimetype = "text/plain";
         }
 
+
       /*
        * print sub-header
        */
@@ -1739,6 +1737,9 @@ UUEncodePartial_byFSize (FILE *outfile, FILE *infile,
                    UUFNameFilter ((outfname)?outfname:infname), eolstring);
         }
     }
+
+
+
   if (encoding == YENC_ENCODED)
     {
       pcrc = crc32(0L, Z_NULL, 0);



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