/*
- * Copyright (C) 1997-2011 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 1997-2012 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
#include <sys/time.h>
#include <sys/types.h>
#include <osl.h>
-#include <stdbool.h>
#include "para.h"
#include "error.h"
#include "server.h"
#include "list.h"
#include "send.h"
+#include "sched.h"
#include "vss.h"
#include "net.h"
#include "daemon.h"
#include "user_list.h"
#include "server_command_list.h"
#include "afs_command_list.h"
-#include "sched.h"
#include "signal.h"
#include "version.h"
{
char mtime[30] = "";
char *status, *flags; /* vss status info */
- char *ut = uptime_str();
+ /* nobody updates our version of "now" */
+ char *ut = get_server_uptime_str(NULL);
long offset = (nmmd->offset + 500) / 1000;
struct timeval current_time;
struct tm mtime_tm;
* The calls to WRITE_STATUS_ITEM() below never fail because
* b->max_size is zero (unlimited), see para_printf(). However, clang
* is not smart enough to prove this and complains nevertheless.
- * Casting the return value to void silences solves this.
+ * Casting the return value to void silences clang.
*/
(void)WRITE_STATUS_ITEM(&b, SI_FILE_SIZE, "%zu\n", nmmd->size / 1024);
(void)WRITE_STATUS_ITEM(&b, SI_MTIME, "%s\n", mtime);
sender_info = para_strcat(sender_info, info);
free(info);
}
- ut = uptime_str();
+ ut = get_server_uptime_str(now);
ret = sc_send_va_buffer(scc, "version: " GIT_VERSION "\n"
"up: %s\nplayed: %u\n"
"server_pid: %d\n"
if (ret < 0)
goto net_err;
/* send Welcome message */
- ret = send_va_buffer(fd, "This is para_server, version "
+ ret = write_va_buffer(fd, "This is para_server, version "
PACKAGE_VERSION ".\n" );
if (ret < 0)
goto net_err;
ret = -E_AUTH_REQUEST;
goto net_err;
}
- numbytes = ret;
ret = -E_AUTH_REQUEST;
if (strncmp(buf, AUTH_REQUEST_MSG, strlen(AUTH_REQUEST_MSG)))
goto net_err;
p = buf + strlen(AUTH_REQUEST_MSG);
PARA_DEBUG_LOG("received auth request for user %s\n", p);
- ret = -E_BAD_USER;
u = lookup_user(p);
if (u) {
get_random_bytes_or_die(rand_buf, sizeof(rand_buf));
}
PARA_DEBUG_LOG("sending %u byte challenge + rc4 keys (%zu bytes)\n",
CHALLENGE_SIZE, numbytes);
- ret = send_bin_buffer(fd, buf, numbytes);
+ ret = write_all(fd, buf, numbytes);
if (ret < 0)
goto net_err;
/* recv challenge response */