From 7554377f8ca3fb35153321f2893e9d99de92b71b Mon Sep 17 00:00:00 2001 From: Michal Novotny Date: Thu, 17 Oct 2019 20:02:47 +0000 Subject: [PATCH] Bug 1579507 - Fix non-working FTP telemetry probes, r=valentin We don't close the channel cleanly most of the time, so the probes need to be moved to a place where we have positive response from the server and the data transfer is about to start. Differential Revision: https://phabricator.services.mozilla.com/D49657 --HG-- extra : moz-landing-system : lando --- netwerk/protocol/ftp/nsFtpConnectionThread.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp index a13c0e49fa43..a88f445c0b33 100644 --- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp +++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp @@ -1062,6 +1062,9 @@ nsresult nsFtpState::S_list() { FTP_STATE nsFtpState::R_list() { if (mResponseCode / 100 == 1) { + Telemetry::ScalarAdd( + Telemetry::ScalarID::NETWORKING_FTP_OPENED_CHANNELS_LISTINGS, 1); + mRlist1xxReceived = true; // OK, time to start reading from the data connection. @@ -1072,9 +1075,6 @@ nsFtpState::R_list() { if (mResponseCode / 100 == 2 && mRlist1xxReceived) { //(DONE) - Telemetry::ScalarAdd( - Telemetry::ScalarID::NETWORKING_FTP_OPENED_CHANNELS_LISTINGS, 1); - mNextState = FTP_COMPLETE; mRlist1xxReceived = false; return FTP_COMPLETE; @@ -1096,14 +1096,14 @@ FTP_STATE nsFtpState::R_retr() { if (mResponseCode / 100 == 2) { //(DONE) - Telemetry::ScalarAdd( - Telemetry::ScalarID::NETWORKING_FTP_OPENED_CHANNELS_FILES, 1); - mNextState = FTP_COMPLETE; return FTP_COMPLETE; } if (mResponseCode / 100 == 1) { + Telemetry::ScalarAdd( + Telemetry::ScalarID::NETWORKING_FTP_OPENED_CHANNELS_FILES, 1); + if (mDataStream && HasPendingCallback()) mDataStream->AsyncWait(this, 0, 0, CallbackTarget()); return FTP_READ_BUF; @@ -1174,9 +1174,6 @@ FTP_STATE nsFtpState::R_stor() { if (mResponseCode / 100 == 2) { //(DONE) - Telemetry::ScalarAdd( - Telemetry::ScalarID::NETWORKING_FTP_OPENED_CHANNELS_FILES, 1); - mNextState = FTP_COMPLETE; mStorReplyReceived = true; @@ -1187,6 +1184,9 @@ nsFtpState::R_stor() { } if (mResponseCode / 100 == 1) { + Telemetry::ScalarAdd( + Telemetry::ScalarID::NETWORKING_FTP_OPENED_CHANNELS_FILES, 1); + LOG(("FTP:(%p) writing on DT\n", this)); return FTP_READ_BUF; }