0.1.7 fixes #2

This commit is contained in:
SJ 2011-11-23 14:37:17 +01:00
parent 072caae0c9
commit 0f5ae4fb2d

View File

@ -18,7 +18,7 @@
int store_attachments(struct session_data *sdata, struct _state *state, struct __config *cfg){
uint64 id=0;
int i, found;
int i, found, affected_rows;
char s[SMALLBUFSIZE];
MYSQL_RES *res;
MYSQL_ROW row;
@ -117,6 +117,12 @@ int store_attachments(struct session_data *sdata, struct _state *state, struct _
return 1;
}
affected_rows = mysql_stmt_affected_rows(stmt);
if(affected_rows != 1){
syslog(LOG_PRIORITY, "%s attachment sql error: affected rows: %d", sdata->ttmpfile, affected_rows);
return 1;
}
}
else {
syslog(LOG_PRIORITY, "%s: skipping attachment (serial: %d, size: %d, digest: %s)", sdata->ttmpfile, i, state->attachments[i].size, state->attachments[i].digest);