private int send_stream_within_locked_context(IFTPConnection conn, string remoteFileName, Stream stream) { if (_client == null) return 0; string[] tempMessageList = conn.SendCommand("STOR " + remoteFileName); string message = tempMessageList[0]; var returnValue = FTPUtilities.GetMessageReturnValue(message); if((returnValue == 150 || returnValue == 125)) { perform_background_upload(conn.Mode,stream); } else { return -1; } tempMessageList = conn.Read(); message = tempMessageList[0]; return FTPUtilities.GetMessageReturnValue(message); }