* Documented all of the 'TODO: document me.' commands in file_ops.c
authorArt Cancro <ajc@citadel.org>
Tue, 18 May 2010 18:51:49 +0000 (18:51 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 18 May 2010 18:51:49 +0000 (18:51 +0000)
* Set up a new directory ./network/spooltmp, this will be part of the solution to allow the processing of network spool files to occur independently of the transfer of network spool files.

citadel/file_ops.c
citadel/include/citadel_dirs.h
citadel/modules/network/serv_network.c
citadel/utillib/citadel_dirs.c

index 96e00a0fd00d7cb44a2207b7722a9dfdad3c1fe1..0a790832aeb931069a9929f3f8824decff45699a 100644 (file)
@@ -761,7 +761,7 @@ void cmd_nuop(char *cmdbuf)
 
        snprintf(CC->upl_path, sizeof CC->upl_path,
                         "%s/%s.%04lx.%04x",
-                        ctdl_netin_dir,
+                        ctdl_nettmp_dir,
                         CC->net_node, 
                         (long)getpid(), 
                         ++seq);
@@ -794,18 +794,18 @@ void cmd_nuop(char *cmdbuf)
 CTDL_MODULE_INIT(file_ops)
 {
        if (!threading) {
-               CtdlRegisterProtoHook(cmd_delf, "DELF", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_movf, "MOVF", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_open, "OPEN", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_clos, "CLOS", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_uopn, "UOPN", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_ucls, "UCLS", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_read, "READ", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_writ, "WRIT", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_oimg, "OIMG", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_ndop, "NDOP", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_nuop, "NUOP", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_uimg, "UIMG", "Autoconverted. TODO: document me.");
+               CtdlRegisterProtoHook(cmd_delf, "DELF", "Delete a file");
+               CtdlRegisterProtoHook(cmd_movf, "MOVF", "Move a file");
+               CtdlRegisterProtoHook(cmd_open, "OPEN", "Open a download file transfer");
+               CtdlRegisterProtoHook(cmd_clos, "CLOS", "Close a download file transfer");
+               CtdlRegisterProtoHook(cmd_uopn, "UOPN", "Open an upload file transfer");
+               CtdlRegisterProtoHook(cmd_ucls, "UCLS", "Close an upload file transfer");
+               CtdlRegisterProtoHook(cmd_read, "READ", "File transfer read operation");
+               CtdlRegisterProtoHook(cmd_writ, "WRIT", "File transfer write operation");
+               CtdlRegisterProtoHook(cmd_ndop, "NDOP", "Open a network spool file for download");
+               CtdlRegisterProtoHook(cmd_nuop, "NUOP", "Open a network spool file for upload");
+               CtdlRegisterProtoHook(cmd_oimg, "OIMG", "Open an image file for download");
+               CtdlRegisterProtoHook(cmd_uimg, "UIMG", "Upload an image file");
        }
         /* return our Subversion id for the Log */
        return "$Id$";
index 1586ba6ecd0af95a6399a399f111a3a8346e42e3..19856270a91d532b980823d0293920c0f8118818 100644 (file)
@@ -26,6 +26,7 @@ extern char ctdl_run_dir[PATH_MAX];
 extern char ctdl_spool_dir[PATH_MAX];
 extern char ctdl_netout_dir[PATH_MAX];
 extern char ctdl_netin_dir[PATH_MAX];
+extern char ctdl_nettmp_dir[PATH_MAX];
 extern char ctdl_netcfg_dir[PATH_MAX];
 extern char ctdl_bbsbase_dir[PATH_MAX];
 extern char ctdl_sbin_dir[PATH_MAX];
index 4a6dac4c56eadba8616ac901451bbd184ee005ce..fa50506609dfe7839fdf83cb707ae5ed89c81c62 100644 (file)
@@ -2131,6 +2131,10 @@ void create_spool_dirs(void) {
                CtdlLogPrintf(CTDL_EMERG, "unable to create directory [%s]: %s", ctdl_netin_dir, strerror(errno));
        if (chown(ctdl_netin_dir, CTDLUID, (-1)) != 0)
                CtdlLogPrintf(CTDL_EMERG, "unable to set the access rights for [%s]: %s", ctdl_netin_dir, strerror(errno));
+       if ((mkdir(ctdl_nettmp_dir, 0700) != 0) && (errno != EEXIST))
+               CtdlLogPrintf(CTDL_EMERG, "unable to create directory [%s]: %s", ctdl_nettmp_dir, strerror(errno));
+       if (chown(ctdl_nettmp_dir, CTDLUID, (-1)) != 0)
+               CtdlLogPrintf(CTDL_EMERG, "unable to set the access rights for [%s]: %s", ctdl_nettmp_dir, strerror(errno));
        if ((mkdir(ctdl_netout_dir, 0700) != 0) && (errno != EEXIST))
                CtdlLogPrintf(CTDL_EMERG, "unable to create directory [%s]: %s", ctdl_netout_dir, strerror(errno));
        if (chown(ctdl_netout_dir, CTDLUID, (-1)) != 0)
index 9bc46c8e917cc4f9fc7e4dd3dfb254c4bfe093c3..1aecdcded837b4ed4046fed42ba496169aab899c 100644 (file)
@@ -64,6 +64,7 @@ char ctdl_run_dir[PATH_MAX]="";
 char ctdl_spool_dir[PATH_MAX]="network";
 char ctdl_netout_dir[PATH_MAX]="network/spoolout";
 char ctdl_netin_dir[PATH_MAX]="network/spoolin";
+char ctdl_nettmp_dir[PATH_MAX]="network/spooltmp";
 char ctdl_netcfg_dir[PATH_MAX]="netconfigs";
 char ctdl_utilbin_dir[PATH_MAX]="";
 char ctdl_sbin_dir[PATH_MAX]="";
@@ -212,10 +213,12 @@ void calc_dirs_n_files(int relh, int home, const char *relhome, char  *ctdldir,
        COMPUTE_DIRECTORY(ctdl_spool_dir);
        COMPUTE_DIRECTORY(ctdl_netout_dir);
        COMPUTE_DIRECTORY(ctdl_netin_dir);
+       COMPUTE_DIRECTORY(ctdl_nettmp_dir);
 
        StripSlashes(ctdl_spool_dir, 1);
        StripSlashes(ctdl_netout_dir, 1);
        StripSlashes(ctdl_netin_dir, 1);
+       StripSlashes(ctdl_nettmp_dir, 1);
 
        /* ok, now we know the dirs, calc some commonly used files */
 
@@ -341,6 +344,7 @@ void calc_dirs_n_files(int relh, int home, const char *relhome, char  *ctdldir,
        DBG_PRINT(ctdl_spool_dir);
        DBG_PRINT(ctdl_netout_dir);
        DBG_PRINT(ctdl_netin_dir);
+       DBG_PRINT(ctdl_nettmp_dir);
        DBG_PRINT(ctdl_netcfg_dir);
        DBG_PRINT(ctdl_bbsbase_dir);
        DBG_PRINT(ctdl_sbin_dir);