From 18257b786a7a57941bff09284c2f8f00e01c944a Mon Sep 17 00:00:00 2001 From: payton Date: Thu, 25 Jan 2024 15:23:47 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=8F=91=E9=80=81=E9=94=99=E8=AF=AF=E6=97=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E6=AC=A1=E9=87=8D=E8=AF=95=E6=9C=BA?= =?UTF-8?q?=E5=88=B6=EF=BC=8C=E6=8F=90=E9=AB=98=E5=8F=91=E9=80=81=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/sf_app/code/source/4gMng/sf_ftp.c | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/code/application/source/sf_app/code/source/4gMng/sf_ftp.c b/code/application/source/sf_app/code/source/4gMng/sf_ftp.c index 728598a3b..1942325e3 100755 --- a/code/application/source/sf_app/code/source/4gMng/sf_ftp.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_ftp.c @@ -892,6 +892,7 @@ SINT32 sf_pic_send_ftp(void) //SINT64 sendStartTime = 0; UINT8 sendAlreadyFlag = 0; UINT8 timeoutCnt = 0; + int sendcnt = 0; SF_SRCFILE_ATTR_S *pThumbFileCfg = sf_file_thumb_cfg_get(); MLOGD("start\n"); @@ -964,10 +965,20 @@ SINT32 sf_pic_send_ftp(void) if(SF_SUCCESS == ret) { - ret = sf_ftp_send(ftpFileName[pic], filePath[pic], timeout); pSifarPara->TotalPicsSent++; + + SF_SEND_RE: + ret = sf_ftp_send(ftpFileName[pic], filePath[pic], timeout); + if(SF_SUCCESS != ret) { + if(!sendcnt) + { + sendcnt++; + MLOGE(" Send an error and retry. ret:[0x%08X]\n", ret); + sleep(1); + goto SF_SEND_RE; + } pSifarPara->picSendFailCount++; pSifarPara->sendThumbnailFailCount++; //TIMEOUT @@ -981,6 +992,7 @@ SINT32 sf_pic_send_ftp(void) sf_log_error_code(logStr); } else { + sendcnt = 0; if(!sf_get_mode_flag()){ pSifarPara->picSendMax++; if(!sf_get_pic()) @@ -1065,6 +1077,7 @@ SINT32 sf_video_send_ftp(void) int timeout = 120000; UINT8 fileIndex = 0; UINT8 csqlevel = 0; + int sendcnt = 0; SF_SRCFILE_ATTR_S *pThumbFileCfg = sf_file_thumb_cfg_get(); MLOGD("start\n"); @@ -1096,10 +1109,18 @@ SINT32 sf_video_send_ftp(void) } else { + SF_SEND_RE: ret = sf_ftp_send(ftpFileName, filePath, timeout); if(SF_SUCCESS != ret) { + if(!sendcnt) + { + sendcnt++; + MLOGE(" Send an error and retry. ret:[0x%08X]\n", ret); + sleep(1); + goto SF_SEND_RE; + } printf("%s:%d err ret: [0x%08X] ftpFileName:%s filePath:%s\n", __FUNCTION__, __LINE__, ret, ftpFileName, filePath); SF_SPRINTF(logStr, "%x,", SF_ERR_ID(SF_MOD_FTP, ret)); sf_log_error_code(logStr); @@ -1118,6 +1139,8 @@ SINT32 sf_ftp_lpa_log_send(void) UINT8 lpaFile[64] = { 0 }; UINT8 filePath[64] = { 0 }; int timeout = 60000; + int sendcnt = 0; + MLOGD("start\n"); printf("%s:%d filePath:%s\n", __FUNCTION__, __LINE__, filePath); @@ -1132,10 +1155,18 @@ SINT32 sf_ftp_lpa_log_send(void) } else { + SF_SEND_RE: ret = sf_ftp_send(lpaFile, filePath, timeout); if(SF_SUCCESS != ret) { + if(!sendcnt) + { + sendcnt++; + MLOGE(" Send an error and retry. ret:[0x%08X]\n", ret); + sleep(1); + goto SF_SEND_RE; + } printf("%s:%d err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath); } } @@ -1153,6 +1184,7 @@ SINT32 sf_ftp_dailyreport_send(void) UINT8 customStr[64] = { 0 }; UINT8 filePath[64] = { 0 }; int timeout = 60000; + int sendcnt = 0; UIMenuStoreInfo *pPara = sf_app_ui_para_get(); SF_PDT_PARAM_STATISTICS_S *pSifarPara = sf_statistics_param_get(); @@ -1179,10 +1211,18 @@ SINT32 sf_ftp_dailyreport_send(void) } else { + SF_SEND_RE: ret = sf_ftp_send(uploadFname, filePath, timeout); if(SF_SUCCESS != ret) { + if(!sendcnt) + { + sendcnt++; + MLOGE(" Send an error and retry. ret:[0x%08X]\n", ret); + sleep(1); + goto SF_SEND_RE; + } printf("%s:%d err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath); SF_SPRINTF(logStr, "%x,", SF_ERR_ID(SF_MOD_FTP, ret)); sf_log_error_code(logStr);