~ubuntu-branches/ubuntu/intrepid/ecl/intrepid

« back to all changes in this revision

Viewing changes to src/c/tcp.d

  • Committer: Bazaar Package Importer
  • Author(s): Peter Van Eynde
  • Date: 2006-06-21 09:21:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060621092121-txz1f21lj0wh0f67
Tags: 0.9h-20060617-1
* New upstream version
* Updated standards version without real changes. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
268
268
   cl_object stream;
269
269
 
270
270
   /* Ensure "host" is a string that we can pass to a C function */
271
 
   host = coerce_to_simple_string(host);
 
271
   host = si_copy_to_simple_base_string(host);
272
272
 
273
273
   /* The port number is not negative */
274
274
   p = fixnnint(port);
275
275
 
276
 
   if (host->string.fillp > BUFSIZ - 1)
 
276
   if (host->base_string.fillp > BUFSIZ - 1)
277
277
     FEerror("~S is a too long file name.", 1, host);
278
278
 
279
279
   start_critical_section();
280
 
   fd = connect_to_server(host->string.self, fix(port)); 
 
280
   fd = connect_to_server(host->base_string.self, fix(port)); 
281
281
   end_critical_section();
282
282
 
283
283
   if (fd == 0)
324
324
        cl_object stream;
325
325
        struct sockaddr_un addr;
326
326
 
327
 
        if (type_of(path) != t_string)
 
327
        if (type_of(path) != t_base_string)
328
328
                FEwrong_type_argument(@'string', path);
329
 
        if (path->string.fillp > UNIX_MAX_PATH-1)
 
329
        if (path->base_string.fillp > UNIX_MAX_PATH-1)
330
330
                FEerror("~S is a too long file name.", 1, path);
331
331
 
332
332
        fd = socket(PF_UNIX, SOCK_STREAM, 0);
335
335
                @(return Cnil)
336
336
        }
337
337
 
338
 
        memcpy(addr.sun_path, path->string.self, path->string.fillp);
339
 
        addr.sun_path[path->string.fillp] = 0;
 
338
        memcpy(addr.sun_path, path->base_string.self, path->base_string.fillp);
 
339
        addr.sun_path[path->base_string.fillp] = 0;
340
340
        addr.sun_family = AF_UNIX;
341
341
 
342
342
        if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
364
364
        INIT_TCP
365
365
 
366
366
        switch (type_of(host_or_address)) {
367
 
        case t_string:
368
 
                host_or_address = coerce_to_simple_string(host_or_address);
369
 
                he = gethostbyname(host_or_address->string.self);
 
367
        case t_base_string:
 
368
                host_or_address = si_copy_to_simple_base_string(host_or_address);
 
369
                he = gethostbyname(host_or_address->base_string.self);
370
370
                break;
371
371
        case t_fixnum:
372
372
                l = fix(host_or_address);
385
385
        }
386
386
        if (he == NULL)
387
387
                @(return Cnil Cnil Cnil)
388
 
        name = make_string_copy(he->h_name);
 
388
        name = make_base_string_copy(he->h_name);
389
389
        aliases = Cnil;
390
390
        for (i = 0; he->h_aliases[i] != 0; i++)
391
 
                aliases = CONS(make_string_copy(he->h_aliases[i]), aliases);
 
391
                aliases = CONS(make_base_string_copy(he->h_aliases[i]), aliases);
392
392
        addresses = Cnil;
393
393
        for (i = 0; he->h_addr_list[i]; i++) {
394
394
                unsigned long *s = (unsigned long*)(he->h_addr_list[i]);