代码拉取完成,页面将自动刷新
同步操作将从 skycrash/wangpan03 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "head.h"
int recvn(int sockfd, void *buf, int length){
int total = 0;
char *p = (char *)buf;
while(total < length){
ssize_t sret = recv(sockfd, p+total, length-total, 0);
total += sret;
}
return 0;
}
int insertSql(const char* filename, MYSQL* usrsql, userProcess_t *usr, char *md5){
int pre_id = 0;
char path[128] = {0};
char sqlCommand[1024] = {0};
sprintf(sqlCommand, "select preid , path from vfsystem where id = %d", usr->curid);
int ret = mysql_query(usrsql, sqlCommand);
if(ret != 0){
LOGRECORD(ERROR, "mysql_query");
return ret;
}
MYSQL_RES *result = mysql_store_result(usrsql);
MYSQL_ROW row = mysql_fetch_row(result);
int row0 = atoi(row[0]);
memcpy(&pre_id, &row0, sizeof(int));
strcpy(path,row[1]);
LOGRECORD(INFO,"get preid and path");
mysql_free_result(result);
//bzero(sqlCommand,sizeof(sqlCommand));
//sprintf(sqlCommand, "select id from vfsystem where path = '%s' and preid = %d and name = '%s'",
// path, pre_id,filename);
//printf("%s\n", sqlCommand);
//ret = mysql_query(usrsql, sqlCommand);
//printf("%d\n", ret);
//
//result = mysql_store_result(usrsql);
//row = mysql_fetch_row(result);
//printf("in tools.c :%s\n",row[0]);
//if(row != NULL){
// LOGRECORD(ERROR,"filename already exist in currpath");
// mysql_free_result(result);
// return -1;
//}
bzero(sqlCommand, sizeof(sqlCommand));
sprintf(sqlCommand, "insert into vfsystem (name,type,preid,path,user,tomb,md5)"
"values ('%s','f',%d,'%s','%s',0,'%s')", filename, pre_id, path, usr->username, md5);
ret = mysql_query(usrsql, sqlCommand);
if(ret != 0){
LOGRECORD(ERROR,"mysql_query failed !");
return -1;
}
LOGRECORD(INFO,"mysql_query success");
return 0;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。