File src/dinoex_queue.c

* by Dirk Meyer (dinoex) * Copyright (C) 2004-2011 Dirk Meyer * * By using this file, you agree to the terms and conditions set * forth in the GNU General Public License. More information is * available in the LICENSE file. * * If you received this file without documentation, it can be * downloaded from http://iroffer.dinoex.net/ * * $Id: dinoex_queue.c,v 1.38 2011/07/17 20:14:43 cvs Exp $ *


Included Files

include the headers


Preprocessor definitions

#define _LONGLONG 1

Local Variables

send_queue_msg
static const char* send_queue_msg[]
Used in: send_from_queue()  

Global Function addtoidlequeue()

add a request to the idle queue

unsigned int addtoidlequeue ( const char** msg, char* tempstr, const char* nick, const char* hostname, xdcc* xd, unsigned int pack, unsigned int inq )

Prototyped in: src/dinoex_queue.h
Calls: get_user_nick() src/dinoex_irc.c
  irlist_add2() src/iroffer_utilities.c
  irlist_size() src/iroffer_utilities.c
  mystrdup2() src/dinoex_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  snprintf()
Called by: a_iqueue_sub() src/dinoex_admin.c
  addtomainqueue() src/dinoex_queue.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function addtomainqueue()

add a request to the main queue

unsigned int addtomainqueue ( const char** msg, char* tempstr, const char* nick, const char* hostname, unsigned int pack )

Prototyped in: src/dinoex_queue.h
Calls: addtoidlequeue() src/dinoex_queue.c
  get_xdcc_pack() src/dinoex_misc.c
  irlist_add2() src/iroffer_utilities.c
  irlist_size() src/iroffer_utilities.c
  mystrdup2() src/dinoex_utilities.c
  queue_count_host() src/dinoex_queue.c
  save_nick() src/dinoex_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  snprintf()
Called by: a_queue() src/dinoex_admin.c
  send_xdcc_file2() src/dinoex_user.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function check_idle_queue()

check idle queue and move one entry into the main queue

void check_idle_queue ( unsigned int pos )

Prototyped in: src/dinoex_queue.h
Calls: find_in_idle_queue() src/dinoex_queue.c
  irlist_add2() src/iroffer_utilities.c
  irlist_delete() src/iroffer_utilities.c
  irlist_get_nth() src/iroffer_utilities.c
  irlist_size() src/iroffer_utilities.c
  start_one_send() src/dinoex_queue.c
  updatecontext_f() src/iroffer_utilities.c
Called by: a_iqsend() src/dinoex_admin.c
  mainloop() src/iroffer_main.c
  send_from_queue() src/dinoex_queue.c
  start_main_queue() src/dinoex_queue.c
  t_perform() src/dinoex_transfer.c
References Variables: gdata src/dinoex_main.c

Global Function queue_all_remove()

remove all entries from this queue

void queue_all_remove ( irlist_t* list, const char* message )

Prototyped in: src/dinoex_queue.h
Calls: irlist_delete() src/iroffer_utilities.c
  irlist_get_head() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  notice_slow() src/iroffer_utilities.c
Called by: mainloop() src/iroffer_main.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function queue_count_host()

count number of entries in a queue for one user

unsigned int queue_count_host ( irlist_t* list, unsigned int* inq, unsigned int man, const char* nick, const char* hostname, xdcc* xd )

Prototyped in: src/dinoex_queue.h
Calls: irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  strcasecmp(), strcmp()
Called by: a_queue_found() src/dinoex_admin.c
  addtomainqueue() src/dinoex_queue.c
References Variables: gnetwork src/dinoex_main.c

Global Function queue_pack_limit()

remove a pack from the queue because the pack has now reached its download limit

void queue_pack_limit ( irlist_t* list, xdcc* xd )

Prototyped in: src/dinoex_queue.h
Calls: irlist_delete() src/iroffer_utilities.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  notice_slow() src/iroffer_utilities.c
Called by: t_flushed() src/iroffer_transfer.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function queue_pack_remove()

remove the pack in the queue because admin has removed it

void queue_pack_remove ( irlist_t* list, xdcc* xd )

Prototyped in: src/dinoex_queue.h
Calls: irlist_delete() src/iroffer_utilities.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  notice() src/iroffer_utilities.c
Called by: a_remove_pack2() src/dinoex_admin.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function queue_punish_abuse()

remove all packs a user has because he has abused the bot

void queue_punish_abuse ( const char* msg, unsigned int network, const char* nick )

Prototyped in: src/dinoex_queue.h
Calls: queue_punish_user() src/dinoex_queue.c
Called by: t_check_duplicateip() src/dinoex_transfer.c
  t_checkminspeed() src/iroffer_transfer.c
References Variables: gdata src/dinoex_main.c

Global Function queue_reverify_restrictsend()

check queue for users that have left and drop them

void queue_reverify_restrictsend ( irlist_t* list )

Prototyped in: src/dinoex_queue.h
Calls: get_restrictsend() src/dinoex_misc.c
  ioutput() src/iroffer_utilities.c
  irlist_delete() src/iroffer_utilities.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  isinmemberlist() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  notice() src/iroffer_utilities.c
  strcmp()
Called by: reverify_restrictsend() src/iroffer_misc.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function queue_update_nick()

change a nickname in a queue

void queue_update_nick ( irlist_t* list, const char* oldnick, const char* newnick )

Prototyped in: src/dinoex_queue.h
Calls: irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  mystrdup2() src/dinoex_utilities.c
  strcasecmp()
Called by: user_changed_nick() src/iroffer_misc.c

Global Function queue_xdcc_remove()

remove all packs a user has because he send us XDCC REMOVE

unsigned int queue_xdcc_remove ( irlist_t* list, unsigned int network, const char* nick, unsigned int number )

Prototyped in: src/dinoex_queue.h
Calls: irlist_delete() src/iroffer_utilities.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  notice() src/iroffer_utilities.c
  number_of_pack() src/dinoex_misc.c
  strcasecmp()
Called by: lost_nick() src/dinoex_user.c
  send_remove() src/dinoex_user.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function requeue()

put transfer back into queue

ir_pqueue* requeue ( transfer* tr, ir_pqueue* old )

Prototyped in: src/dinoex_queue.h
Calls: irlist_add2() src/iroffer_utilities.c
  irlist_insert_after() src/iroffer_utilities.c
  irlist_insert_head() src/iroffer_utilities.c
  irlist_remove() src/iroffer_utilities.c
  mystrdup2() src/dinoex_utilities.c
Called by: shutdowniroffer() src/iroffer_misc.c
References Variables: gdata src/dinoex_main.c

Global Function send_from_queue()

send the next item form the queue

void send_from_queue ( unsigned int type, unsigned int pos, char* lastnick )

Prototyped in: src/dinoex_queue.h
Calls: check_idle_queue() src/dinoex_queue.c
  create_transfer() src/dinoex_transfer.c
  init_xdcc_file() src/dinoex_misc.c
  ioutput() src/iroffer_utilities.c
  irlist_delete() src/iroffer_utilities.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  irlist_get_nth() src/iroffer_utilities.c
  irlist_size() src/iroffer_utilities.c
  look_for_file_changes() src/iroffer_misc.c
  mydelete2() src/iroffer_utilities.c
  number_of_pack() src/dinoex_misc.c
  send_from_queue() src/dinoex_queue.c
  t_notice_transfer() src/dinoex_transfer.c
  t_setup_dcc() src/dinoex_transfer.c
  t_unlmited() src/dinoex_transfer.c
  updatecontext_f() src/iroffer_utilities.c
  strcasecmp(), strcmp()
Called by: a_qsend() src/dinoex_admin.c
  mainloop() src/iroffer_main.c
  send_from_queue() src/dinoex_queue.c
  start_one_send() src/dinoex_queue.c
  t_perform() src/dinoex_transfer.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c
  send_queue_msg src/dinoex_queue.c

Global Function start_main_queue()

fill mainqueue with data from idle queue on start

void start_main_queue ( void )

Prototyped in: src/dinoex_queue.h
Calls: check_idle_queue() src/dinoex_queue.c
Called by: startupiroffer() src/iroffer_misc.c
References Variables: gdata src/dinoex_main.c

Global Function start_one_send()

start sending one queued pack

void start_one_send ( void )

Prototyped in: src/dinoex_queue.h
Calls: irlist_size() src/iroffer_utilities.c
  send_from_queue() src/dinoex_queue.c
Called by: a_iqueue() src/dinoex_admin.c
  a_queue() src/dinoex_admin.c
  check_idle_queue() src/dinoex_queue.c
  start_sends() src/dinoex_queue.c
References Variables: gdata src/dinoex_main.c

Global Function start_sends()

start sending the queued packs

void start_sends ( void )

Prototyped in: src/dinoex_queue.h
Calls: start_one_send() src/dinoex_queue.c
Called by: a_holdqueue() src/dinoex_admin.c
  ir_parseline2() src/dinoex_irc.c
  irc_perform() src/dinoex_irc.c
  u_rehash() src/iroffer_admin.c
References Variables: gdata src/dinoex_main.c

Local Function find_in_idle_queue()

static ir_pqueue* find_in_idle_queue ( void )
Calls: irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  strcasecmp(), strcmp()
Called by: check_idle_queue() src/dinoex_queue.c
References Variables: gdata src/dinoex_main.c

Local Function queue_punish_user()

remove all packs a user has

static void queue_punish_user ( irlist_t* list, const char* msg, unsigned int network, const char* nick )

Calls: irlist_delete() src/iroffer_utilities.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  notice() src/iroffer_utilities.c
  strcasecmp()
Called by: queue_punish_abuse() src/dinoex_queue.c
References Variables: gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c