W3C home > Mailing lists > Public > www-lib@w3.org > October to December 1998

Problems in using libwww 5.1m1 on solaris2.5

From: Thibault Parmentier <thibault.parmentier@imag.fr>
Date: Fri, 30 Oct 1998 11:34:36 +0100
Message-ID: <3639963C.547577E0@imag.fr>
To: lib www <www-lib@w3.org>
As Henrik Frystyk Nielsen recommend me yesterday, I've use a gcc compiler to compile again the library and my example
file. But I've got the same problems with the headers file.
there is no problem during the library compilation but during the use :-(

I have attach the three header files that are supposed to generate problems.
This is my example compilation:
gcc -o toto -I/softs/IMAGENE/imagene_develop/src/libwww/Library/src
-L/softs/IMAGENE/imagene_develop/src/libwww/solaris2.5/Library/src/.libs/libwww.a test5.c
In file included from /softs/IMAGENE/imagene_develop/src/libwww/Library/src/HTNet.h:48,
                 from /softs/IMAGENE/imagene_develop/src/libwww/Library/src/HTReq.h:58,
                 from /softs/IMAGENE/imagene_develop/src/libwww/Library/src/WWWCore.h:51,
                 from /softs/IMAGENE/imagene_develop/src/libwww/Library/src/WWWLib.h:51,
                 from /softs/IMAGENE/imagene_develop/src/libwww/Library/src/HTProfil.h:34,
                 from /softs/IMAGENE/imagene_develop/src/libwww/Library/src/WWWInit.h:39,
                 from test5.c:4:
/softs/IMAGENE/imagene_develop/src/libwww/Library/src/HTDNS.h:46: warning: `struct hostent' declared inside parameter
/softs/IMAGENE/imagene_develop/src/libwww/Library/src/HTDNS.h:46: warning: its scope is only this definition or
/softs/IMAGENE/imagene_develop/src/libwww/Library/src/HTDNS.h:46: warning: which is probably not what you want.
In file included from /softs/IMAGENE/imagene_develop/src/libwww/Library/src/HTInet.h:20,
                 from /softs/IMAGENE/imagene_develop/src/libwww/Library/src/WWWCore.h:232,
                 from /softs/IMAGENE/imagene_develop/src/libwww/Library/src/WWWLib.h:51,
                 from /softs/IMAGENE/imagene_develop/src/libwww/Library/src/HTProfil.h:34,
                 from /softs/IMAGENE/imagene_develop/src/libwww/Library/src/WWWInit.h:39,
                 from test5.c:4:
/softs/IMAGENE/imagene_develop/src/libwww/Library/src/HTHstMan.h:82: field `sock_addr' has incomplete type
In file included from /softs/IMAGENE/imagene_develop/src/libwww/Library/src/WWWFile.h:51,
                 from /softs/IMAGENE/imagene_develop/src/libwww/Library/src/HTInit.h:42,
                 from /softs/IMAGENE/imagene_develop/src/libwww/Library/src/WWWInit.h:46,
                 from test5.c:4:
/softs/IMAGENE/imagene_develop/src/libwww/Library/src/HTMulti.h:43: warning: `struct stat' declared inside parameter

Thank you for any help,

Thibault Parmentier, Projet SHERPA - INRIA
OFFICE: (+33) 4 76 61 53 74     Fax: (+33) 4 76 61 52 07
HOME:   (+33) 4 76 86 24 04  ROWING: (+33) 4 76 42 77 86
OUAIB:  http://chooyu.inrialpes.fr:2000/
/*                                      W3C Sample Code Library libwww Private Hst Definition
**      (c) COPYRIGHT MIT 1995.
**      Please first read the full copyright statement in the file COPYRIGH.

   This is the private definition of the Host Class. Please look in the public Host Class
   for more documentation
   This module is implemented by HTHost.c, and it is a part of the W3C Sample Code
#ifndef HTHSTMAN_H
#define HTHSTMAN_H
#include "HTHost.h"
#include "HTDNS.h"
#include "HTEvent.h"
#include "HTProt.h"

#define PIPE_BUFFER_SIZE        8192

   The HTHost object is the core of the request queue management. This object contains
   information about the socket descriptor, the input read buffer etc. required to
   identify and service a request.
typedef enum _TCPState {
    TCP_ERROR           = -2,
    TCP_CONNECTED       = -1,
    TCP_BEGIN           = 0,
} TCPState;

struct _HTHost {
    int                 hash;

    /* Information about the otherend */
    char *              hostname;            /* name of host + optional port */
    u_short             u_port;
    time_t              ntime;                              /* Creation time */
    char *              type;                                   /* Peer type */
    int                 version;                             /* Peer version */
    HTMethod            methods;                /* Public methods (bit-flag) */
    char *              server;                               /* Server name */
    char *              user_agent;                            /* User Agent */
    char *              range_units;                                  /* ??? */

    /* When does this entry expire? */
    time_t              expires;          /* Persistent channel expires time */
    int                 reqsPerConnection;        /* from Keep-Alive: header */
    int                 reqsMade;                /* updated as they are sent */

    /* Queuing and connection modes */
    HTList *            pipeline;                /* Pipe line of net objects */
    HTList *            pending;              /* List of pending Net objects */
    HTNet *             doit;               /* Transfer from pending to pipe */
    HTNet *             lock;             /* This is a kludge! */
    BOOL                persistent;
    HTTransportMode     mode;                              /* Supported mode */
    HTTimer *           timer;         /* Timer for handling idle connection */
    BOOL                do_recover;         /* If we are supposed to recover */
    int                 recovered;        /* How many times had we recovered */
    BOOL                close_notification;        /* Got a hint about close */
    BOOL                broken_pipe;

    /* Support for transports */
    HTChannel *         channel;                             /* data channel */

    /* Connection dependent stuff */
    HTdns *             dns;                           /* Link to DNS object */
    TCPState            tcpstate;                     /* State in connection */
    SockA               sock_addr;           /* SockA is defined in wwwsys.h */
    int                 retry;               /* Counting attempts to connect */
    int                 home;                    /* Current home if multiple */
    ms_t                connecttime;       /* Time in ms on multihomed hosts */

    /* Event Management */
    HTEvent *           events[HTEvent_TYPES];/* reading and writing may differ */
    HTEventType         registeredFor;    /* Which actions are we blocked on */
    size_t              remainingRead;   /* Tells HostEvent to call next net */

    /* User specific stuff */
    ms_t                delay;                          /* Write delay in ms */
    void *              context;                /* Protocol Specific context */
    int                 forceWriteFlush;

#define HTHost_bytesRead(me)            ((me) ? (me)->bytes_read : -1)
#define HTHost_bytesWritten(me)         ((me) ? (me)->bytes_written : -1)

#define HTHost_setBytesRead(me,l)       ((me) ? (me->bytes_read=(l)) : -1)
#define HTHost_setBytesWritten(me,l)    ((me) ? (me->bytes_written=(l)) :-1)
#define HTHost_setDNS (host, dns)       ((me) ? (me->dns=(dns)) :-1)

#endif /* HTHSTMAN_H */


/*                                                   W3C Sample Code Library libwww DNS Class
**      (c) COPYRIGHT MIT 1995.
**      Please first read the full copyright statement in the file COPYRIGH.

   The DNS Class defines generic access to the DNS system. It maintains a cache of all
   visited hosts so that subsequent connects to the same host doesn't imply a new request
   to the DNS every time. Multihomed hosts are treated specially in that the time spend on
   every connect is measured and kept in the cache. On the next request to the same host,
   the IP-address with the lowest average connect time is chosen. If one IP-address fails
   completely, e.g. connection refused then it disabled and HTDoConnect tries one of the
   other IP-addresses to the same host.
   Every entry in the cache has its own time to live (TTL) and hence the cache manages its
   own automatic garbage collection. Currently the TTL is not bound to the DNS records
   which should be changed. You can set the DNS object TTL
   This module is implemented by HTDNS.c, and it is a part of the W3C Sample Code Library.
#ifndef HTDNS_H
#define HTDNS_H


typedef struct _HTdns HTdns;

   When to remove an entry in the cache. The default value is 12h.
extern void HTDNS_setTimeout (time_t timeout);
extern time_t HTDNS_timeout  (time_t timeout);

   Add an element to the cache of visited hosts. The homes variable indicates the number
   of IP addresses found when looking up the name. A host name must NOT contain a port
extern HTdns * HTDNS_add (HTList * list, struct hostent * element,
                          char * host, int * homes);

   This function flushes the DNS object from the cache and frees up memory
extern BOOL HTDNS_delete (const char * host);

   This function is called from HTLibTerminate. It can be called at any point in time if
   the DNS cache is going to be flushed.
extern BOOL HTDNS_deleteAll (void);

   On every connect to a multihomed host, the average connect time is updated
   exponentially for all the entries.
extern BOOL HTDNS_updateWeigths (HTdns *dns, int cur, ms_t deltatime);

   These are the functions that resolve a host name
   This function should have been called HTGetHostByAddr but for historical reasons this
   is not the case.
extern char * HTGetHostBySock (int soc);

   This function gets the address of the host and puts it in to the socket structure. It
   maintains its own cache of connections so that the communication to the Domain Name
   Server is minimized. Returns the number of homes or -1 if error.
extern int HTGetHostByName (HTHost * host, char *hostname, HTRequest * request);



/*                                         W3C Sample Code Library libwww Content Negotiation
**      (c) COPYRIGHT MIT 1995.
**      Please first read the full copyright statement in the file COPYRIGH.

   As part of the HTTP content negotiation, a server must be able to match the preferences
   sent by the client in an HTTP request with the possible set of documents that it has
   avaiable for this URL. For example , it may have an English and a Danish version in
   which case it looks at the Accept-Language header and sees what the client prefers. The
   Library has a simple "Match" algorithm for finding the best as specified by the HTTP
   specification. As the content algorithm is part of the File Interface then all file
   access regardless of whether it is from a server or a client application will be able
   to content negotiotion.
   This module is implemented by HTMulti.c, and it is a part of the W3C Sample Code
#ifndef HTMULTI_H
#define HTMULTI_H

#include "HTReq.h"

   This function is used when the best match among several possible documents is to be
   found as a function of the accept headers sent in the client request.
   Set default file name for welcome page on each directory.
extern void HTAddWelcome (char * welcome_name);

   This function looks for a set of bindings between a set of possible objects to be
   served on a request on the local file system.
extern char * HTMulti (HTRequest *      req,
                      char *            path,
                      struct stat *     stat_info);

#endif /* HTMULTI_H */

Received on Friday, 30 October 1998 05:34:44 EST

This archive was generated by hypermail pre-2.1.9 : Wednesday, 3 September 2003 17:59:20 EDT