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

[tor-commits] [meek/master] Change OPEN_BLOCKING|OPEN_UNBUFFERED to OPEN_BLOCKING.



commit 29eecdfae394f18ac0b631fca921f0a90d114623
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Mon Jun 9 21:05:48 2014 -0700

    Change OPEN_BLOCKING|OPEN_UNBUFFERED to OPEN_BLOCKING.
    
    Georg reports that Mozilla is doing so internally anyway. We were never
    really getting OPEN_UNBUFFERED.
    
    https://trac.torproject.org/projects/tor/ticket/11183#comment:27
    https://hg.mozilla.org/mozilla-central/file/fc70d6d9a9b0/netwerk/base/src/nsSocketTransport2.cpp#l1952
    
    All OPEN_UNBUFFERED is supposed to do is guarantee that the stream
    support ReadSegments/WriteSegments/WriteFrom. It doesn't hurt if it
    does, but we don't use them.
    
    https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITransport#openInputStream%28%29
    https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITransport#openOutputStream%28%29
---
 firefox/components/main.js |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/firefox/components/main.js b/firefox/components/main.js
index a84b2d7..4265f97 100644
--- a/firefox/components/main.js
+++ b/firefox/components/main.js
@@ -226,8 +226,7 @@ MeekHTTPHelper.LocalConnectionHandler.prototype = {
 
     returnResponse: function(resp) {
         // dump("returnResponse " + JSON.stringify(resp) + "\n");
-        outputStream = this.transport.openOutputStream(
-            Components.interfaces.nsITransport.OPEN_BLOCKING | Components.interfaces.nsITransport.OPEN_UNBUFFERED, 0, 0);
+        outputStream = this.transport.openOutputStream(Components.interfaces.nsITransport.OPEN_BLOCKING, 0, 0);
         var output = Components.classes["@mozilla.org/binaryoutputstream;1"]
             .createInstance(Components.interfaces.nsIBinaryOutputStream);
         output.setOutputStream(outputStream);
@@ -284,8 +283,7 @@ MeekHTTPHelper.RequestReader = function(transport, callback) {
     this.callback = callback;
 
     this.curThread = Components.classes["@mozilla.org/thread-manager;1"].getService().currentThread;
-    this.inputStream = this.transport.openInputStream(
-        Components.interfaces.nsITransport.OPEN_BLOCKING | Components.interfaces.nsITransport.OPEN_UNBUFFERED, 0, 0);
+    this.inputStream = this.transport.openInputStream(Components.interfaces.nsITransport.OPEN_BLOCKING, 0, 0);
 
     this.state = this.STATE_READING_LENGTH;
     // Initially size the buffer to read the 4-byte length.

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits