~ubuntu-branches/ubuntu/intrepid/curl/intrepid

« back to all changes in this revision

Viewing changes to lib/dict.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-05-16 15:16:54 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20070516151654-jo48r81zempo1qav
Tags: 7.16.2-3ubuntu1
* Merge with Debian; remaining changes:
  - Drop the stunnel build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
 
8
 * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
9
9
 *
10
10
 * This software is licensed as described in the file COPYING, which
11
11
 * you should have received as part of this distribution. The terms
18
18
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
 * KIND, either express or implied.
20
20
 *
21
 
 * $Id: dict.c,v 1.41 2006-05-10 11:44:31 bagder Exp $
 
21
 * $Id: dict.c,v 1.49 2007-03-31 21:06:40 bagder Exp $
22
22
 ***************************************************************************/
23
23
 
24
24
#include "setup.h"
31
31
#include <stdarg.h>
32
32
#include <stdlib.h>
33
33
#include <ctype.h>
34
 
#ifdef HAVE_SYS_TYPES_H
35
 
#include <sys/types.h>
36
 
#endif
37
 
#ifdef HAVE_SYS_STAT_H
38
 
#include <sys/stat.h>
39
 
#endif
40
34
 
41
 
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
 
35
#ifdef WIN32
42
36
#include <time.h>
43
37
#include <io.h>
44
38
#else
46
40
#include <sys/socket.h>
47
41
#endif
48
42
#include <netinet/in.h>
 
43
#ifdef HAVE_SYS_TIME_H
49
44
#include <sys/time.h>
 
45
#endif
50
46
#ifdef HAVE_UNISTD_H
51
47
#include <unistd.h>
52
48
#endif
104
100
    /* According to RFC2229 section 2.2, these letters need to be escaped with
105
101
       \[letter] */
106
102
    for(ptr = newp;
107
 
        (byte = (unsigned char)*ptr);
 
103
        (byte = (unsigned char)*ptr) != 0;
108
104
        ptr++) {
109
105
      if ((byte <= 32) || (byte == 127) ||
110
106
          (byte == '\'') || (byte == '\"') || (byte == '\\')) {
132
128
  struct SessionHandle *data=conn->data;
133
129
  curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
134
130
 
135
 
  char *path = conn->path;
136
 
  curl_off_t *bytecount = &conn->bytecount;
 
131
  char *path = data->reqdata.path;
 
132
  curl_off_t *bytecount = &data->reqdata.keep.bytecount;
137
133
 
138
134
  *done = TRUE; /* unconditionally */
139
135
 
163
159
    }
164
160
 
165
161
    if ((word == NULL) || (*word == (char)0)) {
166
 
      failf(data, "lookup word is missing");
 
162
      infof(data, "lookup word is missing");
 
163
      word=(char *)"default";
167
164
    }
168
165
    if ((database == NULL) || (*database == (char)0)) {
169
166
      database = (char *)"!";
194
191
    if(result)
195
192
      failf(data, "Failed sending DICT request");
196
193
    else
197
 
      result = Curl_Transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
198
 
                             -1, NULL); /* no upload */
 
194
      result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
 
195
                                   -1, NULL); /* no upload */
199
196
    if(result)
200
197
      return result;
201
198
  }
217
214
    }
218
215
 
219
216
    if ((word == NULL) || (*word == (char)0)) {
220
 
      failf(data, "lookup word is missing");
 
217
      infof(data, "lookup word is missing");
 
218
      word=(char *)"default";
221
219
    }
222
220
    if ((database == NULL) || (*database == (char)0)) {
223
221
      database = (char *)"!";
241
239
    if(result)
242
240
      failf(data, "Failed sending DICT request");
243
241
    else
244
 
      result = Curl_Transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
245
 
                             -1, NULL); /* no upload */
 
242
      result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
 
243
                                   -1, NULL); /* no upload */
246
244
 
247
245
    if(result)
248
246
      return result;
266
264
      if(result)
267
265
        failf(data, "Failed sending DICT request");
268
266
      else
269
 
        result = Curl_Transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
270
 
                               -1, NULL);
 
267
        result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
 
268
                                     -1, NULL);
271
269
      if(result)
272
270
        return result;
273
271
    }