Show
Ignore:
Timestamp:
03/16/10 05:39:53 (2 years ago)
Author:
D.J. Capelis <dev@…>
Parents:
ca8ba0ad6cd45804e54a97be29c0616758a591a9
Children:
afa113a315cc3a8540fbd86ca2667b9be278dd0b
git-committer:
D.J. Capelis <dev@capelis.dj> / 2010-03-16T05:39:53Z-0700
Message:

Refactor: Less ugly, less broken and less painful. Cost: -40 lines.

I'm very pleased with this tradeoff. This refactor has been needed for
a long time. This should not only make services easier to write, but
should allow me to split out services into service modules now, which
has been a goal for awhile that this whole refactor needed to happen to
really do. Now we can just pass the socket structure to the modularized
services and for the most part most services will be able to do most of
what they need to do. There's going to still need to be some magic I
fear, but less.

Though given how simple things are, splitting these things out into
modules may not even be as necessary anymore.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main.h

    r7c12d6b rfc4ae5a  
    4040#define CUSTOM_SERVICE -1 
    4141 
     42#define chk_error(cond) if (cond) { goto err; } 
     43 
    4244/* Global Variables */ 
    4345extern int listen_queue;    //Queue size for listen() 
     
    6163{ 
    6264    int sock; 
    63     SSL * ssl;          //For TLS, holds sock's SSL connection 
    64     SSL_CTX * contxt;   //For TLS, holds OpenSSL's SSL context 
    65     int multiplex;      //For MULTIPLEX, to determine whether multiplex is on 
    66     char header[16];    //For MULTIPLEX, header formatting 
    67     unsigned int * ptr; //For MULTIPLEX, convenient pointer to header 
    68     char * user;        //For AUTH 
    69     char * host;        //For AUTH 
     65    SSL * ssl;               //For TLS, holds sock's SSL connection 
     66    SSL_CTX * contxt;        //For TLS, holds OpenSSL's SSL context 
     67    int multiplex;           //For MULTIPLEX, to determine whether multiplex is on 
     68    int multiplex_xtra;      //For MULTIPLEX, remaining data until next multiplexing header 
     69    char header[16];         //For MULTIPLEX, header formatting 
     70    unsigned int * ptr;      //For MULTIPLEX, convenient pointer to header 
     71    char * user;             //For AUTH 
     72    char * host;             //For AUTH 
    7073}; 
    7174