Author: rfm
Date: Thu Oct 30 10:55:40 2014
New Revision: 38140

URL: http://svn.gna.org/viewcvs/gnustep?rev=38140&view=rev
Log:
Fix for bug #43461 by Sergei Golovin

Modified:
    libs/base/trunk/ChangeLog
    libs/base/trunk/Source/NSURLProtocol.m

Modified: libs/base/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/ChangeLog?rev=38140&r1=38139&r2=38140&view=diff
==============================================================================
--- libs/base/trunk/ChangeLog   (original)
+++ libs/base/trunk/ChangeLog   Thu Oct 30 10:55:40 2014
@@ -1,3 +1,8 @@
+2014-10-30  Sergei Golovin <[email protected]>
+
+       * Source/NSURLProtocol.m: Fix memory leak and possible hang on retry
+       (bug #43461).
+
 2014-10-17  Richard Frith-Macdonald <[email protected]>
 
        * Documentation/news.texi:

Modified: libs/base/trunk/Source/NSURLProtocol.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSURLProtocol.m?rev=38140&r1=38139&r2=38140&view=diff
==============================================================================
--- libs/base/trunk/Source/NSURLProtocol.m      (original)
+++ libs/base/trunk/Source/NSURLProtocol.m      Thu Oct 30 10:55:40 2014
@@ -1579,6 +1579,17 @@
                                    buffer + written length: len];
                                  _writeOffset = 0;
                                }
+                             else if (len == 0 && ![_body hasBytesAvailable])
+                               {
+                                 /* all _body's bytes are read and written
+                                   * so we shouldn't wait for another
+                                   * opportunity to close _body and set
+                                  * the flag 'sent'.
+                                  */
+                                 [_body close];
+                                 DESTROY(_body);
+                                 sent = YES;
+                               }
                            }
                           else if ([this->output streamStatus]
                             == NSStreamStatusWriting)


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to