]> code.citadel.org Git - citadel.git/blobdiff - citadel/event_client.c
Minor cleanup of rss parser in preparation for some upcoming changes.
[citadel.git] / citadel / event_client.c
index c745c52c824acdfd03e1d86a42d1ba10fb8205d9..999c9e4546c1b989efc6fb93c6f6ab8df8394b8f 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "ctdl_module.h"
 #include "event_client.h"
+#include "citserver.h"
 
 ConstStr IOStates[] = {
        {HKEY("DB Queue")},
@@ -562,6 +563,11 @@ IO_send_callback(struct ev_loop *loop, ev_io *watcher, int revents)
                         IO->SendBuf.fd);
 
                fd = fopen(fn, "a+");
+               if (fd == NULL) {
+                       syslog(LOG_EMERG, "failed to open file %s: %s", fn, strerror(errno));
+                       cit_backtrace();
+                       exit(1);
+               }
                fprintf(fd, "Send: BufSize: %ld BufContent: [",
                        nbytes);
                rv = fwrite(pchh, nbytes, 1, fd);
@@ -885,6 +891,11 @@ IO_recv_callback(struct ev_loop *loop, ev_io *watcher, int revents)
                         IO->SendBuf.fd);
 
                fd = fopen(fn, "a+");
+               if (fd == NULL) {
+                       syslog(LOG_EMERG, "failed to open file %s: %s", fn, strerror(errno));
+                       cit_backtrace();
+                       exit(1);
+               }
                fprintf(fd, "Read: BufSize: %ld BufContent: [",
                        nbytes);
                rv = fwrite(pchh, nbytes, 1, fd);
@@ -933,9 +944,18 @@ IO_postdns_callback(struct ev_loop *loop, ev_idle *watcher, int revents)
                case eAbort:
 ////                   StopClientWatchers(IO);
                        ShutDownCLient(IO);
+                       break;
+               case eDBQuery:
+                       StopClientWatchers(IO, 0);
+                       QueueAnDBOperation(IO);
+                       break;
                default:
                        break;
                }
+       case eDBQuery:
+               StopClientWatchers(IO, 0);
+               QueueAnDBOperation(IO);
+               break;
        default:
                break;
        }