Atrinik Server 2.5
Functions | Variables
socket/updates.c File Reference
#include <global.h>
#include "zlib.h"

Go to the source code of this file.

Functions

static void updates_file_new (const char *filename, struct stat *sb)
static int updates_file_compare (const void *a, const void *b)
static update_file_structupdates_file_find (const char *filename)
static void updates_traverse (const char *path)
void updates_init ()
void cmd_request_update (char *buf, int len, socket_struct *ns)

Variables

static update_file_structupdate_files
static size_t update_files_num

Detailed Description

Handles file updates that the client may request.

Definition in file updates.c.


Function Documentation

void cmd_request_update ( char *  buf,
int  len,
socket_struct ns 
)

Client has requested us to send it the specified file.

Parameters:
bufData.
lenLength of 'buf'.
nsClient's socket.

Definition at line 230 of file updates.c.

static int updates_file_compare ( const void *  a,
const void *  b 
) [static]

Compare two entries of update_files.

Parameters:
aFirst entry to compare.
bSecond entry to compare.
Returns:
Return value of strcmp().

Definition at line 131 of file updates.c.

static update_file_struct* updates_file_find ( const char *  filename) [static]

Find an entry in update_files based on its filename.

Parameters:
filenameWhat to look for.
Returns:
The found entry, NULL if not found.

Definition at line 140 of file updates.c.

static void updates_file_new ( const char *  filename,
struct stat *  sb 
) [static]

Add a new file to update_files.

Parameters:
filenamePath to the file to add.
sbStat buffer.

Definition at line 44 of file updates.c.

void updates_init ( )

Initialize all the file updates, traversing the updates directory, creating the srv updates file, etc.

Definition at line 191 of file updates.c.

static void updates_traverse ( const char *  path) [static]

Recursively traverse through the updates directory.

Parameters:
pathPath we're traversing through.

Definition at line 151 of file updates.c.


Variable Documentation

All the files the client can request an update for, sorted using Quicksort..

Definition at line 36 of file updates.c.

size_t update_files_num [static]

Number of update_files.

Definition at line 38 of file updates.c.