Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed crash when the server already had to overwrite a resource

commit f164bb27fb756d20fc9436b88f396e5208b1045e 1 parent d676afd
@valentinradu authored
Showing with 6 additions and 4 deletions.
  1. BIN  .DS_Store
  2. +2 −2 WhiteRaccoon.h
  3. +4 −2 WhiteRaccoon.m
View
BIN  .DS_Store
Binary file not shown
View
4 WhiteRaccoon.h
@@ -60,7 +60,7 @@ typedef enum {
typedef enum {
- kWRDefaultTimeout = 10
+ kWRDefaultTimeout = 30
} WRTimeouts;
@@ -168,7 +168,7 @@ typedef struct WRStreamInfo {
@property (nonatomic, retain) WRRequest * prevRequest;
@property (nonatomic, readonly) WRRequestTypes type;
@property (nonatomic, retain) id<WRRequestDelegate> delegate;
-@property (nonatomic, assign) WRStreamInfo * streamInfo;
+@property (nonatomic, readonly) WRStreamInfo * streamInfo;
@property (nonatomic, assign) BOOL didManagedToOpenStream;
View
6 WhiteRaccoon.m
@@ -347,7 +347,9 @@ @implementation WRRequest
- (id)init {
self = [super init];
if (self) {
- self.streamInfo = (struct WRStreamInfo *) malloc(sizeof(struct WRStreamInfo));
+ streamInfo = (struct WRStreamInfo *) malloc(sizeof(struct WRStreamInfo));
+ self.streamInfo->readStream = nil;
+ self.streamInfo->writeStream = nil;
self.streamInfo->bytesConsumedThisIteration = 0;
self.streamInfo->bytesConsumedInTotal = 0;
}
@@ -760,8 +762,8 @@ - (void)stream:(NSStream *)theStream handleEvent:(NSStreamEvent)streamEvent {
-(void) destroy{
-
if (self.streamInfo->writeStream) {
+
[self.streamInfo->writeStream close];
[self.streamInfo->writeStream removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
[self.streamInfo->writeStream release];
Please sign in to comment.
Something went wrong with that request. Please try again.