mirror of
https://github.com/lxsang/ant-http
synced 2024-12-26 08:48:21 +01:00
fix dict size
This commit is contained in:
parent
fabe2e6e2a
commit
3f2af063aa
BIN
dist/antd-1.0.4b.tar.gz
vendored
BIN
dist/antd-1.0.4b.tar.gz
vendored
Binary file not shown.
@ -25,8 +25,8 @@ THE SOFTWARE.
|
|||||||
|
|
||||||
dictionary dict()
|
dictionary dict()
|
||||||
{
|
{
|
||||||
dictionary d = (dictionary)malloc(HASHSIZE*sizeof(association));
|
dictionary d = (dictionary)malloc(DHASHSIZE*sizeof(association));
|
||||||
for(int i=0; i< HASHSIZE;i++)
|
for(int i=0; i< DHASHSIZE;i++)
|
||||||
d[i] = NULL;
|
d[i] = NULL;
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
@ -119,7 +119,7 @@ void free_association(association * asoc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void freedict(dictionary dic){
|
void freedict(dictionary dic){
|
||||||
for(int i = 0; i < HASHSIZE; i++)
|
for(int i = 0; i < DHASHSIZE; i++)
|
||||||
free_association(&(dic[i]));
|
free_association(&(dic[i]));
|
||||||
free(dic);
|
free(dic);
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
|||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#define for_each_assoc(assoc, dic) \
|
#define for_each_assoc(assoc, dic) \
|
||||||
for(int i = 0; i < HASHSIZE; i++) \
|
for(int i = 0; i < DHASHSIZE; i++) \
|
||||||
for(assoc = dic[i];assoc!= NULL; assoc = assoc->next)
|
for(assoc = dic[i];assoc!= NULL; assoc = assoc->next)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
16
lib/handle.h
16
lib/handle.h
@ -40,9 +40,9 @@ typedef struct{
|
|||||||
int sock;
|
int sock;
|
||||||
void* ssl;
|
void* ssl;
|
||||||
char* ip;
|
char* ip;
|
||||||
#ifdef USE_OPENSSL
|
//#ifdef USE_OPENSSL
|
||||||
int status;
|
int status;
|
||||||
#endif
|
//#endif
|
||||||
time_t last_io;
|
time_t last_io;
|
||||||
} antd_client_t;
|
} antd_client_t;
|
||||||
|
|
||||||
@ -66,14 +66,14 @@ typedef struct {
|
|||||||
int connection;
|
int connection;
|
||||||
int n_workers;
|
int n_workers;
|
||||||
FILE* errorfp;
|
FILE* errorfp;
|
||||||
#ifdef DEBUG
|
// #ifdef DEBUG
|
||||||
FILE* logfp;
|
FILE* logfp;
|
||||||
#endif
|
// #endif
|
||||||
#ifdef USE_OPENSSL
|
// #ifdef USE_OPENSSL
|
||||||
int usessl;
|
int usessl;
|
||||||
char* sslcert;
|
char* sslcert;
|
||||||
char* sslkey;
|
char* sslkey;
|
||||||
#endif
|
// #endif
|
||||||
}config_t;
|
}config_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -83,9 +83,9 @@ typedef struct {
|
|||||||
char*pdir;
|
char*pdir;
|
||||||
int sport;
|
int sport;
|
||||||
int raw_body;
|
int raw_body;
|
||||||
#ifdef USE_OPENSSL
|
//#ifdef USE_OPENSSL
|
||||||
int usessl;
|
int usessl;
|
||||||
#endif
|
//#endif
|
||||||
} plugin_header_t;
|
} plugin_header_t;
|
||||||
|
|
||||||
void set_nonblock(int socket);
|
void set_nonblock(int socket);
|
||||||
|
Loading…
Reference in New Issue
Block a user