From 1735f96a871f7d4c5f54ef14f8dc7390c601db7f Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Wed, 8 Feb 2006 20:45:15 +0100 Subject: [PATCH] FTP, NNTP: Normalize the cache entry before setting the connection state ... so it is normalized when the download callbacks are called. --- src/protocol/ftp/ftp.c | 5 ++--- src/protocol/nntp/connection.c | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/protocol/ftp/ftp.c b/src/protocol/ftp/ftp.c index 38a1aa5ca..c46c21ecb 100644 --- a/src/protocol/ftp/ftp.c +++ b/src/protocol/ftp/ftp.c @@ -1347,11 +1347,10 @@ out_of_mem: static void ftp_end_request(struct connection *conn, enum connection_state state) { - set_connection_state(conn, state); - - if (conn->state == S_OK && conn->cached) { + if (state == S_OK && conn->cached) { normalize_cache_entry(conn->cached, conn->from); } + set_connection_state(conn, state); add_keepalive_connection(conn, FTP_KEEPALIVE_TIMEOUT, NULL); } diff --git a/src/protocol/nntp/connection.c b/src/protocol/nntp/connection.c index 7a297cf66..2b95169cd 100644 --- a/src/protocol/nntp/connection.c +++ b/src/protocol/nntp/connection.c @@ -217,8 +217,6 @@ nntp_end_request(struct connection *conn, enum connection_state state) return; } - set_connection_state(conn, state); - if (conn->state == S_OK) { if (conn->cached) { normalize_cache_entry(conn->cached, conn->from); @@ -228,6 +226,7 @@ nntp_end_request(struct connection *conn, enum connection_state state) * grabing the keepalive connection will be able to go on. */ } + set_connection_state(conn, state); add_keepalive_connection(conn, NNTP_KEEPALIVE_TIMEOUT, nntp_quit); }