Commits (3)
  • Rob Swindell's avatar
    Log the current Git branch and hash along with every error · 3d1e05e5
    Rob Swindell authored
    This eliminates any ambiguity about what exact version was in use when each error is logged.
  • Rob Swindell's avatar
    Don't attempt to remove files that have already been removed · be0c953e
    Rob Swindell authored
    This is the likely cause of Phil's reported errors when removing files:
    access=-110 info=smb_removefile name not found
    The only way I was able to reproduce these errors was to attempt to remove the same file multiple times in the same file listing. In other worse, use 'R', remove a file, then 'P'revious back to the first file and try to remove it again. Or to remove it a file from the batch flag prompt and then attempt to remove it again. <shrug>
  • Rob Swindell's avatar
    Log local address in passthru connection failure · 4a705a46
    Rob Swindell authored
    Altere reported via IRC:
    !ERROR -1 (113) connecting to passthru socket
    It might be helpful to know the address the passthru socket is bound to and the connection is being attempted on, so log that with the error.
......@@ -676,7 +676,7 @@ int sbbs_t::batchflagprompt(smb_t* smb, file_t** bf, ulong* row, uint total
if(!p) p=strchr(str+c,',');
if(p) *p=0;
for(i=0;i<total;i++) {
if(filematch(bf[i]->name, str+c)) {
if(!(bf[i]->hdr.attr & MSG_DELETE) && filematch(bf[i]->name, str+c)) {
if(ch=='R') {
if(removefile(smb, bf[i])) {
if(remfile) {
......@@ -696,6 +696,7 @@ int sbbs_t::batchflagprompt(smb_t* smb, file_t** bf, ulong* row, uint total
else if(str[c]<'A'+(char)total && str[c]>='A') {
file_t* f = bf[str[c]-'A'];
if(!(f->hdr.attr & MSG_DELETE)) {
if(ch=='R') {
if(removefile(smb, f)) {
if(remfile) {
......@@ -710,6 +711,7 @@ int sbbs_t::batchflagprompt(smb_t* smb, file_t** bf, ulong* row, uint total
movefile(smb, f, usrdir[ml][md]);
......@@ -769,6 +771,8 @@ int sbbs_t::listfileinfo(uint dirnum, const char *filespec, long mode)
if(f->hdr.attr & MSG_DELETE)
if(mode==FI_OLD && f->hdr.last_downloaded > ns_time)
if((mode==FI_OLDUL || mode==FI_OLD) && f->hdr.when_written.time > ns_time)
......@@ -20,6 +20,8 @@
#include "sbbs.h"
#include "git_branch.h"
#include "git_hash.h"
const char* log_line_ending = "\r\n";
......@@ -113,8 +115,10 @@ extern "C" int errorlog(scfg_t* cfg, int level, const char* host, const char* te
SAFEPRINTF(path, "%serror.log", cfg->logs_dir);
if((fp = fnopen(NULL,path,O_WRONLY|O_CREAT|O_APPEND))==NULL)
return -1;
fprintf(fp,"%.24s %s%s%s%s%s"
fprintf(fp,"%.24s %s/%s %s%s%s%s%s"
,ctime_r(&now, buf)
,host==NULL ? "":host
......@@ -5641,6 +5641,7 @@ NO_SSH:
SOCKET tmp_sock;
SOCKADDR_IN tmp_addr={0};
socklen_t tmp_addr_len;
char addr_str[INET6_ADDRSTRLEN] = "";
/* open a socket and connect to yourself */
......@@ -5705,8 +5706,9 @@ NO_SSH:
result = connect(new_node->passthru_socket, (struct sockaddr *)&tmp_addr, tmp_addr_len);
if(result != 0) {
lprintf(LOG_ERR,"Node %d !ERROR %d (%d) connecting to passthru socket"
,new_node->cfg.node_num, result, ERROR_VALUE);
inet_ntop(tmp_addr.sin_family, &tmp_addr.sin_addr, addr_str, sizeof(addr_str));
lprintf(LOG_ERR,"Node %d !ERROR %d (%d) connecting to passthru socket: %s port %u"
,new_node->cfg.node_num, result, ERROR_VALUE, addr_str, addr_str, htons(tmp_addr.sin_port));