ObjFW  Diff

Differences From Artifact [4e36f61b7a]:

To Artifact [bea7b309df]:


584
585
586
587
588
589
590




591
592
593
594
595
596
597
598
599
600
601
602
603
	 */

	@try {
		OFString *requestString = constructRequestString(_request);
		const char *UTF8String = [requestString UTF8String];
		size_t UTF8StringLength = [requestString UTF8StringLength];





		[socket asyncWriteBuffer: UTF8String
				  length: UTF8StringLength
				  target: self
				selector: @selector(socket:didWriteRequest:
					      length:context:exception:)
				 context: nil];
	} @catch (id e) {
		[_client->_delegate client: _client
		     didEncounterException: e
				forRequest: _request];
		return;
	}
}







>
>
>
>





|







584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
	 */

	@try {
		OFString *requestString = constructRequestString(_request);
		const char *UTF8String = [requestString UTF8String];
		size_t UTF8StringLength = [requestString UTF8StringLength];

		/*
		 * Pass requestString as context to retain it so that the
		 * underlying buffer lives long enough.
		 */
		[socket asyncWriteBuffer: UTF8String
				  length: UTF8StringLength
				  target: self
				selector: @selector(socket:didWriteRequest:
					      length:context:exception:)
				 context: requestString];
	} @catch (id e) {
		[_client->_delegate client: _client
		     didEncounterException: e
				forRequest: _request];
		return;
	}
}