mirror of
https://github.com/lxsang/ant-http
synced 2024-12-25 16:28: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 d = (dictionary)malloc(HASHSIZE*sizeof(association));
|
||||
for(int i=0; i< HASHSIZE;i++)
|
||||
dictionary d = (dictionary)malloc(DHASHSIZE*sizeof(association));
|
||||
for(int i=0; i< DHASHSIZE;i++)
|
||||
d[i] = NULL;
|
||||
return d;
|
||||
}
|
||||
@ -119,7 +119,7 @@ void free_association(association * asoc)
|
||||
}
|
||||
|
||||
void freedict(dictionary dic){
|
||||
for(int i = 0; i < HASHSIZE; i++)
|
||||
for(int i = 0; i < DHASHSIZE; i++)
|
||||
free_association(&(dic[i]));
|
||||
free(dic);
|
||||
|
||||
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
||||
|
||||
#include "utils.h"
|
||||
#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)
|
||||
|
||||
/**
|
||||
|
16
lib/handle.h
16
lib/handle.h
@ -40,9 +40,9 @@ typedef struct{
|
||||
int sock;
|
||||
void* ssl;
|
||||
char* ip;
|
||||
#ifdef USE_OPENSSL
|
||||
//#ifdef USE_OPENSSL
|
||||
int status;
|
||||
#endif
|
||||
//#endif
|
||||
time_t last_io;
|
||||
} antd_client_t;
|
||||
|
||||
@ -66,14 +66,14 @@ typedef struct {
|
||||
int connection;
|
||||
int n_workers;
|
||||
FILE* errorfp;
|
||||
#ifdef DEBUG
|
||||
// #ifdef DEBUG
|
||||
FILE* logfp;
|
||||
#endif
|
||||
#ifdef USE_OPENSSL
|
||||
// #endif
|
||||
// #ifdef USE_OPENSSL
|
||||
int usessl;
|
||||
char* sslcert;
|
||||
char* sslkey;
|
||||
#endif
|
||||
// #endif
|
||||
}config_t;
|
||||
|
||||
typedef struct {
|
||||
@ -83,9 +83,9 @@ typedef struct {
|
||||
char*pdir;
|
||||
int sport;
|
||||
int raw_body;
|
||||
#ifdef USE_OPENSSL
|
||||
//#ifdef USE_OPENSSL
|
||||
int usessl;
|
||||
#endif
|
||||
//#endif
|
||||
} plugin_header_t;
|
||||
|
||||
void set_nonblock(int socket);
|
||||
|
Loading…
Reference in New Issue
Block a user