Browse Source

fix bug with initial writes to an open connection getting lost

David Rose 16 years ago
parent
commit
62f6e4dbe7
1 changed files with 2 additions and 2 deletions
  1. 2 2
      panda/src/downloader/bioStreamBuf.cxx

+ 2 - 2
panda/src/downloader/bioStreamBuf.cxx

@@ -142,7 +142,7 @@ sync() {
 
 
   size_t n = pptr() - pbase();
   size_t n = pptr() - pbase();
 
 
-  if (downloader_cat.is_spam()) {
+  if (downloader_cat.is_spam() && n != 0) {
     downloader_cat.spam()
     downloader_cat.spam()
       << "BioStreamBuf::sync, " << n << " bytes\n";
       << "BioStreamBuf::sync, " << n << " bytes\n";
   }
   }
@@ -262,7 +262,7 @@ write_chars(const char *start, size_t length) {
         // without a retry request
         // without a retry request
         //_write_open = BIO_should_retry(*_source);
         //_write_open = BIO_should_retry(*_source);
         //_write_open = !BIO_eof(*_source);
         //_write_open = !BIO_eof(*_source);
-        _write_open = (BIO_should_write(*_source) != 0);
+        _write_open = (BIO_should_write(*_source) != 0 || BIO_should_retry(*_source) != 0);
         if (!_write_open) {
         if (!_write_open) {
           return wrote_so_far;
           return wrote_so_far;
         }
         }