@@ -323,18 +323,9 @@ public <T> void writeRequest(NettyResponseFuture<T> future, Channel channel) {
323323 if (handler instanceof TransferCompletionHandler )
324324 configureTransferAdapter (handler , httpRequest );
325325
326- if (!future .isHeadersAlreadyWrittenOnContinue ()) {
327- try {
328- if (future .getAsyncHandler () instanceof AsyncHandlerExtensions )
329- AsyncHandlerExtensions .class .cast (future .getAsyncHandler ()).onSendRequest (nettyRequest );
330- channel .write (httpRequest ).addListener (new ProgressListener (config , future .getAsyncHandler (), future , true ));
331- } catch (Throwable cause ) {
332- // FIXME why not notify?
333- LOGGER .debug (cause .getMessage (), cause );
334- // FIXME what about the attribute? how could this fail?
335- Channels .silentlyCloseChannel (channel );
336- return ;
337- }
326+ if (!future .isHeadersAlreadyWrittenOnContinue () &&future .getAsyncHandler () instanceof AsyncHandlerExtensions ) {
327+ AsyncHandlerExtensions .class .cast (future .getAsyncHandler ()).onSendRequest (nettyRequest );
328+ channel .write (httpRequest ).addListener (new ProgressListener (config , future .getAsyncHandler (), future , true ));
338329 }
339330
340331 // FIXME what happens to this second write if the first one failed? Should it be done in the ProgressListener?
@@ -346,7 +337,8 @@ public <T> void writeRequest(NettyResponseFuture<T> future, Channel channel) {
346337 if (Channels .isChannelValid (channel ))
347338 scheduleTimeouts (future );
348339
349- } catch (Throwable ioe ) {
340+ } catch (Throwable t ) {
341+ LOGGER .error ("Can't write request" , t );
350342 Channels .silentlyCloseChannel (channel );
351343 }
352344 }
0 commit comments