~ubuntu-branches/ubuntu/oneiric/irssi/oneiric

« back to all changes in this revision

Viewing changes to src/irc/dcc/dcc-server.c

  • Committer: Bazaar Package Importer
  • Author(s): Andres Rodriguez
  • Date: 2009-05-05 15:50:50 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090505155050-aoqlnpes7che9rtd
Tags: 0.8.13-1ubuntu1
* Merge from debian unstable (LP: #372411), remaining changes:
  - debian/patches: 03firsttimer_text
    + Adapt it so it tells you about connecting to irc.ubuntu.com and
      joining #ubuntu instead of irc.debian.org and #debian.
  - debian/patches: 90irc-ubuntu-com
* Fixed debian/patches/90irc-ubuntu-com for new irssi.conf.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include "commands.h"
24
24
#include "network.h"
25
25
#include "net-sendbuffer.h"
26
 
#include "line-split.h"
27
26
#include "misc.h"
28
27
 
29
28
#include "irc-servers.h"
47
46
 
48
47
        if (dcc->sendbuf != NULL)
49
48
                net_sendbuffer_destroy(dcc->sendbuf, FALSE);
50
 
        line_split_free(dcc->readbuf);
51
49
}
52
50
 
53
51
/* Start listening for incoming connections */
65
63
/* input function: DCC SERVER received some data.. */
66
64
static void dcc_server_input(SERVER_DCC_REC *dcc)
67
65
{
68
 
        char tmpbuf[512], *str;
69
 
        int recvlen, ret;
 
66
        char *str;
 
67
        int ret;
70
68
 
71
69
        g_return_if_fail(IS_DCC_SERVER(dcc));
72
70
 
73
71
        do {
74
 
                recvlen = net_receive(dcc->handle, tmpbuf, sizeof(tmpbuf));
 
72
                ret = net_sendbuffer_receive_line(dcc->sendbuf, &str, 1);
75
73
 
76
 
                ret = line_split(tmpbuf, recvlen, &str, &dcc->readbuf);
77
74
                if (ret == -1) {
78
75
                        /* connection lost */
79
76
                        dcc_close(DCC(dcc));
199
196
        g_return_if_fail(msg != NULL);
200
197
 
201
198
        /* Check for CHAT protocol */
202
 
        if (g_strncasecmp(msg, "100 ", 4) == 0) {
 
199
        if (g_ascii_strncasecmp(msg, "100 ", 4) == 0) {
203
200
                msg += 4;
204
201
                /* Check if this server is accepting chat requests.*/
205
202
                if (dcc->accept_chat) {
227
224
        }
228
225
 
229
226
        /* Check for FSERVE protocol */
230
 
        if (g_strncasecmp(msg, "110 ", 4) == 0) {
 
227
        if (g_ascii_strncasecmp(msg, "110 ", 4) == 0) {
231
228
                msg += 4;
232
229
                /* Check if this server is accepting fserve requests.*/
233
230
                if (dcc->accept_fserve) {
236
233
        }
237
234
 
238
235
        /* Check for SEND protocol */
239
 
        if (g_strncasecmp(msg, "120 ", 4) == 0) {
 
236
        if (g_ascii_strncasecmp(msg, "120 ", 4) == 0) {
240
237
                msg += 4;
241
238
                /* Check if this server is accepting send requests.*/
242
239
                if (dcc->accept_send) {
368
365
 
369
366
        g_return_if_fail(data != NULL);
370
367
 
371
 
        if (g_strncasecmp(data, "SERVER ", 7) != 0 ||
 
368
        if (g_ascii_strncasecmp(data, "SERVER ", 7) != 0 ||
372
369
            !cmd_get_params(data, &free_arg, 2, NULL, &port_str)) {
373
370
                return;
374
371
        }