]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua_server.c
Add heap stats to Dir and SD -- eliminate #ifdefs
[bacula/bacula] / bacula / src / dird / ua_server.c
index cd6a94ab70a1bd861ac14189bd6de1171f6ae6c7..415a60e1a63ce44714c93888bf34f66ba6ca7263 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -48,7 +48,8 @@ int quit_cmd_thread = 0;
 
 /* Forward referenced functions */
 
-static void *connect_thread(void *arg);
+extern "C" void *connect_thread(void *arg);
+
 static void *handle_UA_client_request(void *arg);
 
 
@@ -80,14 +81,15 @@ void start_UA_server(char *UA_addr, int UA_port)
    return;
 }
 
-static void *connect_thread(void *arg)
+extern "C" 
+void *connect_thread(void *arg)
 {
    struct s_addr_port *UA = (struct s_addr_port *)arg;
 
    pthread_detach(pthread_self());
 
-   /*  ****FIXME**** put # 5 on config parameter */
-   bnet_thread_server(UA->addr, UA->port, 5, &ua_workq, handle_UA_client_request);
+   /*  ****FIXME**** put # 10 on config parameter */
+   bnet_thread_server(UA->addr, UA->port, 10, &ua_workq, handle_UA_client_request);
    return NULL;
 }
 
@@ -95,7 +97,7 @@ static void *connect_thread(void *arg)
  * Create a Job Control Record for a control "job",
  *   filling in all the appropriate fields.
  */
-JCR *create_control_jcr(char *base_name, int job_type)
+JCR *new_control_jcr(const char *base_name, int job_type)
 {
    JCR *jcr;
    jcr = new_jcr(sizeof(JCR), dird_free_jcr);
@@ -103,9 +105,11 @@ JCR *create_control_jcr(char *base_name, int job_type)
    create_unique_job_name(jcr, base_name);
    jcr->sched_time = jcr->start_time;
    jcr->JobType = job_type;
-   jcr->JobLevel = L_FULL;
+   jcr->JobLevel = L_NONE;
    jcr->JobStatus = JS_Running;
-   /* None of these are really defined for control JCRs, so we
+   jcr->JobId = 0;
+   /*
+    * None of these are really defined for control JCRs, so we
     * simply take the first of each one. This ensures that there
     * will be no null pointer references.
     */
@@ -134,13 +138,13 @@ static void *handle_UA_client_request(void *arg)
 
    pthread_detach(pthread_self());
 
-   jcr = create_control_jcr("*Console*", JT_CONSOLE);
+   jcr = new_control_jcr("*Console*", JT_CONSOLE);
 
    ua = new_ua_context(jcr);
    ua->UA_sock = UA_sock;
 
    bnet_recv(ua->UA_sock);         /* Get first message */
-   if (!authenticate_user_agent(ua->UA_sock)) {
+   if (!authenticate_user_agent(ua)) {
       goto getout;
    }