Back to index

courier  0.68.2
Functions | Variables
comsubmitclient.h File Reference
#include "courier.h"
#include <stdio.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int submit_fork (char **, char **, void(*)(const char *))
void submit_print_stdout (const char *)
void submit_write_message (const char *)
int submit_readrc ()
int submit_readrcprint ()
int submit_readrcprinterr ()
int submit_readrcprintcrlf ()
void submit_log_error_prefix (void(*)(void))
int submit_wait ()
void submit_cancel ()
void submit_cancel_async ()
void submit_set_teergrube (void(*)(void))

Variables

FILE * submit_to
FILE * fromsubmit

Function Documentation

void submit_cancel ( )

Definition at line 497 of file comsubmitclient.c.

{
       submit_cancel_async();
       fclose(submit_to);
       fclose(fromsubmit);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 481 of file comsubmitclient.c.

{
char   buf[256];

       kill(submit_pid, SIGTERM);
       alarmflag=0;
       signal(SIGALRM, sigtrap);
       alarm(10);
       while (read(fileno(fromsubmit), buf, sizeof(buf)) > 0)
              ;
       alarm(0);
       signal(SIGALRM, SIG_DFL);
       if (alarmflag)       kill(submit_pid, SIGKILL);
       (void)submit_wait_noreset();
}

Here is the call graph for this function:

Here is the caller graph for this function:

int submit_fork ( char **  ,
char **  ,
void(*)(const char *)   
)

Definition at line 196 of file comsubmitclient.c.

{
       size_t i, j;
       const char *p=config_get_local_vhost();
       char **newargs;
       int rc;
       char *q=0;

       if (!p || !*p)
              return submit_fork_virtual(args, env, func);

       for (i=0; args[i]; ++i)
              ;

       newargs=malloc((i+2)*sizeof(char *));

       for (i=j=0; (newargs[j]=args[i]) != 0; ++i, ++j)
       {
              if (i == 0)
              {
                     ++j;
                     strcat(strcpy((q=newargs[j]=
                                   malloc(strlen(p)+10)),
                                  "-vhost="), p);
              }
       }
       rc=submit_fork_virtual(newargs, env, func);

       free(newargs);
       if (q) free(q);
       return rc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void submit_log_error_prefix ( void(*)(void)  )

Definition at line 191 of file comsubmitclient.c.

Here is the caller graph for this function:

void submit_print_stdout ( const char *  )

Definition at line 10 of file comsubmitclient2.c.

{
       if (p)
       {
              if (fwrite(p, strlen(p), 1, stdout) != 1)
                     ; /* muzzle gcc warning */
       }
       else   fflush(stdout);
}

Here is the caller graph for this function:

int submit_readrc ( )

Definition at line 438 of file comsubmitclient.c.

{
       return (readresponse(0));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 443 of file comsubmitclient.c.

Here is the call graph for this function:

Definition at line 453 of file comsubmitclient.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 448 of file comsubmitclient.c.

{
       return (readresponse(PRINT_ERRORS));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void submit_set_teergrube ( void(*)(void)  )

Definition at line 49 of file comsubmitclient.c.

{
       teergrubefunc=funcarg;
}

Here is the caller graph for this function:

int submit_wait ( )

Definition at line 74 of file comsubmitclient.c.

{
int    rc=submit_wait_noreset();

       signal(SIGINT, SIG_DFL);
       signal(SIGHUP, SIG_DFL);
       signal(SIGTERM, SIG_DFL);
       return (rc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void submit_write_message ( const char *  )

Definition at line 458 of file comsubmitclient.c.

{
       if (submit_error)    return;
       for ( ; *msg; msg++)
              if (*msg != '\r' && *msg != '\n')
                     putc(*msg, submit_to);
       putc('\n', submit_to);
       fflush(submit_to);
       if (ferror(submit_to))      submit_error=1;
}

Here is the caller graph for this function:


Variable Documentation

FILE* fromsubmit

Definition at line 30 of file comsubmitclient.c.

FILE* submit_to

Definition at line 29 of file comsubmitclient.c.