Changeset 255 in Main for trunk/Server/server.c


Ignore:
Timestamp:
Oct 4, 2024, 1:08:58 PM (6 weeks ago)
Author:
Nishi
Message:

get listdir working [release 2.03E]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Server/server.c

    r253 r255  
    3434
    3535#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
    36 #ifndef NO_GETADDRINFO
     36#ifndef NO_GETNAMEINFO
    3737#include <ws2tcpip.h>
    3838#include <wspiapi.h>
     
    6464#include <netinet/tcp.h>
    6565#endif
    66 #ifndef NO_GETADDRINFO
     66#ifndef NO_GETNAMEINFO
    6767#include <netdb.h>
    6868#endif
     
    7878
    7979#ifndef S_ISDIR
    80 #define S_ISDIR(x) ((x) & _S_IFDIR)
     80#define S_ISDIR(x) ((x)&_S_IFDIR)
    8181#endif
    8282
     
    494494        struct tw_http_response res;
    495495        struct tw_tool tools;
    496 #ifndef NO_GETADDRINFO
     496        char* addrstr;
     497#ifndef NO_GETNAMEINFO
    497498        struct sockaddr* sa = (struct sockaddr*)&addr;
    498499        getnameinfo(sa, sizeof(addr), address, 512, NULL, 0, NI_NUMERICHOST);
    499500#endif
    500         address[0] = 0;
     501        addrstr = inet_ntoa(addr.sin_addr);
     502        strcpy(address, addrstr);
     503        address[strlen(addrstr)] = 0;
    501504#ifdef FREE_PTR
    502505        free(ptr);
     
    10501053                }
    10511054        }
    1052         for(i = 0; i < sockcount; i++){
     1055        for(i = 0; i < sockcount; i++) {
    10531056                close_socket(sockets[i]);
    10541057        }
Note: See TracChangeset for help on using the changeset viewer.