BLIP/BLIPWriter.m
changeset 40 423c134d3205
parent 11 29e8b03c05d4
     1.1 --- a/BLIP/BLIPWriter.m	Tue Jun 03 16:56:33 2008 -0700
     1.2 +++ b/BLIP/BLIPWriter.m	Tue May 05 15:27:20 2009 -0700
     1.3 @@ -79,10 +79,6 @@
     1.4  
     1.5  - (BOOL) sendMessage: (BLIPMessage*)message
     1.6  {
     1.7 -    if( _shouldClose ) {
     1.8 -        Warn(@"%@: Attempt to send a message after the connection has started closing",self);
     1.9 -        return NO;
    1.10 -    }
    1.11      Assert(!message.sent,@"message has already been sent");
    1.12      [self _queueMessage: message isNew: YES];
    1.13      return YES;
    1.14 @@ -91,12 +87,14 @@
    1.15  
    1.16  - (BOOL) sendRequest: (BLIPRequest*)q response: (BLIPResponse*)response
    1.17  {
    1.18 -    if( !_shouldClose ) {
    1.19 -        [q _assignedNumber: ++_numRequestsSent];
    1.20 -        if( response ) {
    1.21 -            [response _assignedNumber: _numRequestsSent];
    1.22 -            [(BLIPReader*)self.reader _addPendingResponse: response];
    1.23 -        }
    1.24 +    if( _shouldClose ) {
    1.25 +        Warn(@"%@: Attempt to send a request after the connection has started closing: %@",self,q);
    1.26 +        return NO;
    1.27 +    }
    1.28 +    [q _assignedNumber: ++_numRequestsSent];
    1.29 +    if( response ) {
    1.30 +        [response _assignedNumber: _numRequestsSent];
    1.31 +        [(BLIPReader*)self.reader _addPendingResponse: response];
    1.32      }
    1.33      return [self sendMessage: q];
    1.34  }