You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(65) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(61) |
Feb
(111) |
Mar
(98) |
Apr
(33) |
May
(31) |
Jun
(64) |
Jul
(35) |
Aug
(50) |
Sep
(170) |
Oct
(89) |
Nov
(72) |
Dec
(214) |
2002 |
Jan
(74) |
Feb
(21) |
Mar
(5) |
Apr
(4) |
May
(61) |
Jun
(13) |
Jul
(3) |
Aug
(39) |
Sep
(14) |
Oct
(80) |
Nov
(22) |
Dec
(76) |
2003 |
Jan
(14) |
Feb
(59) |
Mar
(7) |
Apr
(5) |
May
|
Jun
(4) |
Jul
(6) |
Aug
(78) |
Sep
(68) |
Oct
(23) |
Nov
(25) |
Dec
(107) |
2004 |
Jan
(82) |
Feb
(75) |
Mar
(13) |
Apr
(9) |
May
(21) |
Jun
(2) |
Jul
(1) |
Aug
(52) |
Sep
(23) |
Oct
(15) |
Nov
(6) |
Dec
(60) |
2005 |
Jan
(125) |
Feb
(94) |
Mar
(32) |
Apr
(68) |
May
|
Jun
|
Jul
(11) |
Aug
(3) |
Sep
(15) |
Oct
(3) |
Nov
|
Dec
(58) |
2006 |
Jan
(46) |
Feb
(29) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(9) |
Dec
(9) |
2007 |
Jan
(62) |
Feb
(60) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(6) |
Aug
(3) |
Sep
(4) |
Oct
(2) |
Nov
(4) |
Dec
(46) |
2008 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
(10) |
Dec
(49) |
2009 |
Jan
(14) |
Feb
(12) |
Mar
(37) |
Apr
(8) |
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(25) |
Oct
(48) |
Nov
(7) |
Dec
(45) |
2010 |
Jan
(15) |
Feb
(14) |
Mar
(7) |
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(28) |
Nov
|
Dec
(44) |
2011 |
Jan
(22) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(70) |
2012 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(128) |
2013 |
Jan
(8) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(2) |
Dec
(150) |
2014 |
Jan
(70) |
Feb
(44) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Sebastian B. <sb...@us...> - 2014-02-22 09:41:35
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12462 Modified Files: index_external.c Log Message: Include support.h Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- index_external.c 22 Feb 2014 09:41:15 -0000 1.55 +++ index_external.c 22 Feb 2014 09:41:33 -0000 1.56 @@ -35,6 +35,7 @@ #include "debug.h" #include "lists.h" +#include "support.h" #include "index.h" #include "index_private.h" |
From: Sebastian B. <sb...@us...> - 2014-02-22 09:41:18
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12436/tests Modified Files: index_external_unittest.c Log Message: Debugging functions for the external index are optional now. Index: index_external_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/index_external_unittest.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- index_external_unittest.c 19 Jan 2014 18:54:09 -0000 1.9 +++ index_external_unittest.c 22 Feb 2014 09:41:15 -0000 1.10 @@ -22,6 +22,7 @@ #include <CUnit/Basic.h> +#define DEBUG_FUNCTIONS #include "index_external.c" /*******************************************************/ |
From: Sebastian B. <sb...@us...> - 2014-02-22 09:41:17
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12436 Modified Files: index_external.c Log Message: Debugging functions for the external index are optional now. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- index_external.c 22 Feb 2014 09:40:57 -0000 1.54 +++ index_external.c 22 Feb 2014 09:41:15 -0000 1.55 @@ -47,6 +47,9 @@ #include <varargs.h> #endif +/* Define this if some debug options should be compiled in */ +/*#define DEBUG_FUNCTIONS*/ + struct bnode_element { int str_offset; @@ -341,7 +344,9 @@ if (block == lchild && !tmp->leaf) { +#ifdef DEBUG_FUNCTIONS fprintf(stderr, "Endless loop detected!\n"); +#endif return 0; } @@ -372,6 +377,8 @@ memset(e, (idx->max_elements_per_node - start)*sizeof(struct bnode_element), 0); } +#ifdef DEBUG_FUNCTIONS + /** * Dump the children of the given nodes. */ @@ -566,6 +573,8 @@ return count; } +#endif + /** * Inserts the given string into the bnode tree. * @@ -602,8 +611,10 @@ if (!tmp->leaf && current_level == path.max_level) { +#ifdef DEBUG_FUNCTIONS fprintf(stderr, "Cannot insert into a non-leaf\n"); exit(1); +#endif } /* Recall that we allocate in our temps one more entry than it would fit in the block, so we surly can @@ -648,7 +659,9 @@ if (block == idx->root_node) { +#ifdef DEBUG_FUNCTIONS assert(current_level == 0); +#endif /* Create a new root block if the root was getting full */ tmp->num_elements = 1; @@ -943,10 +956,13 @@ if (num_substrings != 1) { +#ifdef DEBUG_FUNCTIONS fprintf(stderr, "Searching with only one sub string is supported for now.\n"); exit(-1); +#else + return 0; +#endif } - va_copy(substrings_copy,substrings); for (i=0;i<num_substrings;i++) |
From: Sebastian B. <sb...@us...> - 2014-02-22 09:40:59
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12393 Modified Files: imap.c index_external.c pop3.c Log Message: Improved SAS/C compability. Index: imap.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/imap.c,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- imap.c 21 Feb 2014 06:39:08 -0000 1.93 +++ imap.c 22 Feb 2014 09:40:57 -0000 1.94 @@ -1104,7 +1104,7 @@ for( ;server; server = (struct imap_server*)node_next(&server->node)) { struct connection *conn; - struct connect_options conn_opts = {}; + struct connect_options conn_opts = {0}; char head_buf[100]; SM_DEBUGF(10,("Synchronizing with server \"%s\"\n",server->name)); @@ -1221,7 +1221,7 @@ if (open_socket_lib()) { struct connection *conn; - struct connect_options conn_opts = {}; + struct connect_options conn_opts = {0}; char head_buf[100]; sprintf(head_buf,_("Reading folders of %s"),server->name); @@ -1302,7 +1302,7 @@ if (open_socket_lib()) { struct connection *conn; - struct connect_options conn_opts = {}; + struct connect_options conn_opts = {0}; char head_buf[100]; sm_snprintf(head_buf,sizeof(head_buf),_("Submitting subscribed folders to %s"),server->name); @@ -1864,7 +1864,7 @@ if (imap_server) { char status_buf[160]; - struct connect_options conn_opts = {}; + struct connect_options conn_opts = {0}; if (!imap_socket_lib_open) imap_socket_lib_open = open_socket_lib(); Index: pop3.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/pop3.c,v retrieving revision 1.107 retrieving revision 1.108 diff -u -d -r1.107 -r1.108 --- pop3.c 21 Feb 2014 06:39:08 -0000 1.107 +++ pop3.c 22 Feb 2014 09:40:57 -0000 1.108 @@ -941,7 +941,7 @@ for (;server; server = (struct pop3_server*)node_next(&server->node)) { struct connection *conn; - struct connect_options connect_options = {}; + struct connect_options connect_options = {0}; char head_buf[100]; rc = 0; @@ -1173,7 +1173,7 @@ if (open_socket_lib()) { struct connection *conn; - struct connect_options conn_opts = {}; + struct connect_options conn_opts = {0}; conn_opts.use_ssl = server->ssl && (!server->stls); Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- index_external.c 21 Feb 2014 06:31:22 -0000 1.53 +++ index_external.c 22 Feb 2014 09:40:57 -0000 1.54 @@ -512,7 +512,7 @@ bnode *tmp = bnode_create(idx); if (!bnode_read_block(idx, tmp, block)) - return; + return 0; if (!tmp->leaf) count += count_index(idx, tmp->lchild, level + 1); @@ -618,6 +618,8 @@ if (tmp->num_elements == idx->max_elements_per_node) { + int tmp3block; + /* Now we split the node into two nodes. We keep the median in but also * insert it as a separation value for the two nodes on the parent. */ @@ -637,7 +639,7 @@ idx->tmp3->sibling = tmp->sibling; memcpy(bnode_get_ith_element_of_node(idx, idx->tmp3, 0), bnode_get_ith_element_of_node(idx, tmp, start_of_2nd_node), idx->tmp3->num_elements * sizeof(struct bnode_element)); bnode_clear_elements(idx, idx->tmp3, idx->tmp3->num_elements); - int tmp3block = bnode_add_block(idx, idx->tmp3); + tmp3block = bnode_add_block(idx, idx->tmp3); /* This should be done as late as possible */ tmp->sibling = tmp3block; |
From: Sebastian B. <sb...@us...> - 2014-02-21 06:39:11
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25834 Modified Files: imap.c pop3.c tcp.c tcp.h Log Message: Introduced connection_options structure to simplyfy the development of further extensions. Index: imap.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/imap.c,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- imap.c 24 Dec 2013 10:34:00 -0000 1.92 +++ imap.c 21 Feb 2014 06:39:08 -0000 1.93 @@ -1104,6 +1104,7 @@ for( ;server; server = (struct imap_server*)node_next(&server->node)) { struct connection *conn; + struct connect_options conn_opts = {}; char head_buf[100]; SM_DEBUGF(10,("Synchronizing with server \"%s\"\n",server->name)); @@ -1140,8 +1141,10 @@ free(login); } + conn_opts.use_ssl = server->ssl; + SM_DEBUGF(10,("Connecting\n")); - if ((conn = tcp_connect(server->name, server->port, server->ssl))) + if ((conn = tcp_connect(server->name, server->port, &conn_opts))) { thread_call_parent_function_async(status_set_status,1,_("Waiting for login...")); SM_DEBUGF(10,("Waiting for login\n")); @@ -1218,6 +1221,7 @@ if (open_socket_lib()) { struct connection *conn; + struct connect_options conn_opts = {}; char head_buf[100]; sprintf(head_buf,_("Reading folders of %s"),server->name); @@ -1228,7 +1232,9 @@ thread_call_parent_function_async_string(status_set_title, 1, server->name); thread_call_parent_function_async_string(status_set_connect_to_server, 1, server->name); - if ((conn = tcp_connect(server->name, server->port, server->ssl))) + conn_opts.use_ssl = server->ssl; + + if ((conn = tcp_connect(server->name, server->port, &conn_opts))) { thread_call_parent_function_async(status_set_status,1,N_("Waiting for login...")); if (imap_wait_login(conn,server)) @@ -1296,9 +1302,10 @@ if (open_socket_lib()) { struct connection *conn; + struct connect_options conn_opts = {}; char head_buf[100]; - sprintf(head_buf,_("Submitting subscribed folders to %s"),server->name); + sm_snprintf(head_buf,sizeof(head_buf),_("Submitting subscribed folders to %s"),server->name); thread_call_parent_function_async_string(status_set_head, 1, head_buf); if (server->title) thread_call_parent_function_async_string(status_set_title_utf8, 1, server->title); @@ -1306,7 +1313,9 @@ thread_call_parent_function_async_string(status_set_title, 1, server->name); thread_call_parent_function_async_string(status_set_connect_to_server, 1, server->name); - if ((conn = tcp_connect(server->name, server->port, server->ssl))) + conn_opts.use_ssl = server->ssl; + + if ((conn = tcp_connect(server->name, server->port, &conn_opts))) { thread_call_parent_function_async(status_set_status,1,_("Waiting for login...")); if (imap_wait_login(conn,server)) @@ -1855,6 +1864,7 @@ if (imap_server) { char status_buf[160]; + struct connect_options conn_opts = {}; if (!imap_socket_lib_open) imap_socket_lib_open = open_socket_lib(); @@ -1896,7 +1906,9 @@ sm_snprintf(status_buf,sizeof(status_buf),"%s: %s",imap_server->name, _("Connecting...")); thread_call_parent_function_async_string(status_set_status,1,status_buf); - if ((imap_connection = tcp_connect(imap_server->name, imap_server->port, imap_server->ssl))) + conn_opts.use_ssl = imap_server->ssl; + + if ((imap_connection = tcp_connect(imap_server->name, imap_server->port, &conn_opts))) { SM_DEBUGF(20,("Connected to %s\n",imap_server->name)); Index: pop3.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/pop3.c,v retrieving revision 1.106 retrieving revision 1.107 diff -u -d -r1.106 -r1.107 --- pop3.c 14 Dec 2012 20:38:43 -0000 1.106 +++ pop3.c 21 Feb 2014 06:39:08 -0000 1.107 @@ -941,6 +941,7 @@ for (;server; server = (struct pop3_server*)node_next(&server->node)) { struct connection *conn; + struct connect_options connect_options = {}; char head_buf[100]; rc = 0; @@ -977,7 +978,9 @@ free(login); } - if ((conn = tcp_connect(server->name, server->port, server->ssl && (!server->stls)))) + connect_options.use_ssl = server->ssl && !server->stls; + + if ((conn = tcp_connect(server->name, server->port, &connect_options))) { char *timestamp; thread_call_parent_function_async(status_set_status,1,_("Waiting for login...")); @@ -997,7 +1000,7 @@ pop3_quit(conn,server); tcp_disconnect(conn); SM_DEBUGF(15,("Trying to connect again to the server\n")); - if ((conn = tcp_connect(server->name, server->port, server->ssl && (!server->stls)))) + if ((conn = tcp_connect(server->name, server->port, &connect_options))) { if (pop3_wait_login(conn,server,NULL)) { @@ -1170,8 +1173,11 @@ if (open_socket_lib()) { struct connection *conn; + struct connect_options conn_opts = {}; - if ((conn = tcp_connect(server->name, server->port,server->ssl && (!server->stls)))) + conn_opts.use_ssl = server->ssl && (!server->stls); + + if ((conn = tcp_connect(server->name, server->port, &conn_opts))) { char *timestamp; @@ -1188,7 +1194,7 @@ In such cases a reconnect should help. */ pop3_quit(conn,server); tcp_disconnect(conn); - if ((conn = tcp_connect(server->name, server->port, server->ssl && (!server->stls)))) + if ((conn = tcp_connect(server->name, server->port, &conn_opts))) { if (pop3_wait_login(conn,server,NULL)) { Index: tcp.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tcp.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- tcp.c 21 Feb 2014 06:38:32 -0000 1.52 +++ tcp.c 21 Feb 2014 06:39:08 -0000 1.53 @@ -107,17 +107,18 @@ * @param server defines the name of the server to which the connection * should be created. * @param port defines to which server port the connection should be established. - * @param use_ssl defines whether connection should be made secure. + * @param options defines additional connection should be made secure. * @return the connection or NULL on failure. Use tcp_error_code() for more information. * * @note TODO: Rework the error code handling. */ -struct connection *tcp_connect(char *server, unsigned int port, int use_ssl) +struct connection *tcp_connect(char *server, unsigned int port, struct connect_options *options) { int i,sd; struct sockaddr_in sockaddr; struct hostent *hostent; struct connection *conn = NULL; + int use_ssl = options?options->use_ssl:0; SM_ENTER; Index: tcp.h =================================================================== RCS file: /cvsroot/simplemail/simplemail/tcp.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- tcp.h 3 Nov 2004 01:26:37 -0000 1.17 +++ tcp.h 21 Feb 2014 06:39:08 -0000 1.18 @@ -40,6 +40,11 @@ #endif +struct connect_options +{ + int use_ssl; +}; + struct connection { long socket; @@ -60,7 +65,7 @@ int tcp_error_code(void); const char *tcp_strerror(int code); -struct connection *tcp_connect(char *server, unsigned int port, int use_ssl); +struct connection *tcp_connect(char *server, unsigned int port, struct connect_options *options); void tcp_disconnect(struct connection *conn); int tcp_make_secure(struct connection *conn); int tcp_secure(struct connection *conn); |
From: Sebastian B. <sb...@us...> - 2014-02-21 06:38:34
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25775 Modified Files: tcp.c Log Message: Forward more specifc error texts. Index: tcp.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tcp.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- tcp.c 21 Feb 2014 06:37:07 -0000 1.51 +++ tcp.c 21 Feb 2014 06:38:32 -0000 1.52 @@ -267,11 +267,29 @@ } else { int err = SSL_get_error(conn->ssl, rc); - char buf[64]; + char buf[128]; sm_snprintf(buf, sizeof(buf), "SSL_connect() failed with error %d", err); SM_DEBUGF(5,("%s\n", buf)); /* TODO: Implement and use proper error API */ tell_from_subtask(buf); + + switch (err) + { + case SSL_ERROR_SSL: + { + long err_code; + while ((err_code = ERR_get_error())) + { + char err_buf[120]; + + ERR_error_string_n(err_code, err_buf, sizeof(err_buf)); + + sm_snprintf(buf, sizeof(buf), "More specific error %d: %s", err_code, err_buf); + tell_from_subtask(buf); + } + } + break; + } } SSL_shutdown(conn->ssl); |
From: Sebastian B. <sb...@us...> - 2014-02-21 06:37:09
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25666 Modified Files: tcp.c Log Message: Log SSL_connect() error via logging API and user messages. Index: tcp.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tcp.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- tcp.c 21 Feb 2014 06:33:54 -0000 1.50 +++ tcp.c 21 Feb 2014 06:37:07 -0000 1.51 @@ -53,6 +53,8 @@ #include "smintl.h" #include "tcp.h" +#include "support.h" + #define MIN(a,b) (((a)<(b))?(a):(b)) /*#define DEBUG_OUTPUT*/ @@ -236,6 +238,7 @@ int tcp_make_secure(struct connection *conn) { #ifndef NO_SSL + int rc; if (!open_ssl_lib()) return 0; if (!(conn->ssl = SSL_new(ssl_context()))) @@ -250,7 +253,7 @@ SSL_set_fd(conn->ssl, conn->socket); SM_DEBUGF(10,("Establishing SSL connection\n")); - if (SSL_connect(conn->ssl) >= 0) + if ((rc = SSL_connect(conn->ssl)) >= 0) { X509 *server_cert; if ((server_cert = SSL_get_peer_certificate(conn->ssl))) @@ -261,6 +264,14 @@ SM_DEBUGF(5,("Connection is secure\n")); return 1; } + } else + { + int err = SSL_get_error(conn->ssl, rc); + char buf[64]; + sm_snprintf(buf, sizeof(buf), "SSL_connect() failed with error %d", err); + SM_DEBUGF(5,("%s\n", buf)); + /* TODO: Implement and use proper error API */ + tell_from_subtask(buf); } SSL_shutdown(conn->ssl); |
From: Sebastian B. <sb...@us...> - 2014-02-21 06:36:40
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25597/tests Modified Files: makefile Log Message: Moved the all target back on top. Index: makefile =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/makefile,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- makefile 21 Feb 2014 06:33:02 -0000 1.46 +++ makefile 21 Feb 2014 06:36:38 -0000 1.47 @@ -48,14 +48,14 @@ perl gen-stubs.pl <test-objs/$@error >$@stubs.c $(CC) $@stubs.c unittest_tmpl.c -DUNITTEST_TABLE=\"$@_table.c\" -DUNITTEST_FILE=\"$<\" $(CFLAGS) -lcunit -L. -l$(SIMPLEMAIL_LIB) $(SSL_LDFLAGS) $(GLIB_LDFLAGS) $(GTK_LDFLAGS) -o $@ +.PHONY: all +all: files $(TESTEXES) memleaks + of-human-bondage.txt: of-human-bondage.txt.gz gzip -c -d $< >$@ index_unittest: of-human-bondage.txt -.PHONY: all -all: files $(TESTEXES) memleaks - .PHONY: files files: test-profile.tar.bz2 tar xjf test-profile.tar.bz2 |
From: Sebastian B. <sb...@us...> - 2014-02-21 06:36:12
|
Update of /cvsroot/simplemail/simplemail/amiga-mui In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25535/amiga-mui Modified Files: tcpip.c Log Message: Moved the ssl context initialization into the newly created platform independend file. Index: tcpip.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/amiga-mui/tcpip.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- tcpip.c 21 Feb 2014 06:33:34 -0000 1.42 +++ tcpip.c 21 Feb 2014 06:36:10 -0000 1.43 @@ -61,6 +61,7 @@ #include <proto/amissl.h> #endif +#include "ssl.h" #include "tcpip.h" #include "subthreads_amiga.h" @@ -215,19 +216,13 @@ TAG_DONE)) { #endif - SSLeay_add_ssl_algorithms(); - SSL_load_error_strings(); - - if ((thread->ssl_ctx = SSL_CTX_new(SSLv23_client_method()))) + if ((thread->ssl_ctx = ssl_init())) { - if (SSL_CTX_set_default_verify_paths(ssl_context())) - { - /* Everything is ok */ - thread->ssllib_opencnt = 1; - SM_DEBUGF(10,("AmiSSL opened %ld times\n",thread->ssllib_opencnt)); - SM_RETURN(1,"%ld"); - return 1; - } + /* Everything is ok */ + thread->ssllib_opencnt = 1; + SM_DEBUGF(10,("AmiSSL opened %ld times\n",thread->ssllib_opencnt)); + SM_RETURN(1,"%ld"); + return 1; } #ifdef USE_AMISSL3 CleanupAmiSSL(TAG_DONE); |
From: Sebastian B. <sb...@us...> - 2014-02-21 06:34:32
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25339 Modified Files: common-sources.mk Added Files: ssl.c ssl.h Log Message: Added common ssl file. --- NEW FILE: ssl.h --- /*************************************************************************** SimpleMail - Copyright (C) 2000 Hynek Schlawack and Sebastian Bauer This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***************************************************************************/ /** * @file ssl.h */ #ifndef SM__SSL_H #define SM__SSL_H #endif /* SM__SSL_H */ --- NEW FILE: ssl.c --- /*************************************************************************** SimpleMail - Copyright (C) 2000 Hynek Schlawack and Sebastian Bauer This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***************************************************************************/ /** * @file ssl.c */ #include "ssl.h" Index: common-sources.mk =================================================================== RCS file: /cvsroot/simplemail/simplemail/common-sources.mk,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- common-sources.mk 19 Jan 2014 18:26:26 -0000 1.6 +++ common-sources.mk 21 Feb 2014 06:34:30 -0000 1.7 @@ -37,6 +37,7 @@ smintl.c \ smtp.c \ spam.c \ + ssl.c \ status.c \ support_indep.c \ taglines.c \ |
From: Sebastian B. <sb...@us...> - 2014-02-21 06:33:56
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25252 Modified Files: tcp.c Log Message: Enable verification of the certificates. Index: tcp.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tcp.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- tcp.c 10 Dec 2011 14:21:34 -0000 1.49 +++ tcp.c 21 Feb 2014 06:33:54 -0000 1.50 @@ -244,6 +244,8 @@ return 0; } + SSL_set_verify(conn->ssl, SSL_VERIFY_PEER, NULL); + /* Associate a socket with ssl structure */ SSL_set_fd(conn->ssl, conn->socket); |
From: Sebastian B. <sb...@us...> - 2014-02-21 06:33:36
|
Update of /cvsroot/simplemail/simplemail/amiga-mui In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25205/amiga-mui Modified Files: tcpip.c Log Message: Initialize the context with default verify paths. Index: tcpip.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/amiga-mui/tcpip.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- tcpip.c 10 Dec 2011 14:17:36 -0000 1.41 +++ tcpip.c 21 Feb 2014 06:33:34 -0000 1.42 @@ -220,11 +220,14 @@ if ((thread->ssl_ctx = SSL_CTX_new(SSLv23_client_method()))) { - /* Everything is ok */ - thread->ssllib_opencnt = 1; - SM_DEBUGF(10,("AmiSSL opened %ld times\n",thread->ssllib_opencnt)); - SM_RETURN(1,"%ld"); - return 1; + if (SSL_CTX_set_default_verify_paths(ssl_context())) + { + /* Everything is ok */ + thread->ssllib_opencnt = 1; + SM_DEBUGF(10,("AmiSSL opened %ld times\n",thread->ssllib_opencnt)); + SM_RETURN(1,"%ld"); + return 1; + } } #ifdef USE_AMISSL3 CleanupAmiSSL(TAG_DONE); |
From: Sebastian B. <sb...@us...> - 2014-02-21 06:33:05
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25138/tests Modified Files: makefile Log Message: Link against openssl. Index: makefile =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/makefile,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- makefile 21 Feb 2014 06:32:08 -0000 1.45 +++ makefile 21 Feb 2014 06:33:02 -0000 1.46 @@ -9,6 +9,7 @@ GLIB_CFLAGS := $(shell pkg-config glib-2.0 --cflags) GLIB_LDFLAGS := $(shell pkg-config glib-2.0 --libs) +SSL_LDFLAGS := $(shell pkg-config openssl --libs) GTK_CFLAGS := $(shell pkg-config gtk+-x11-2.0 --cflags) @@ -43,9 +44,9 @@ # General rule to compile the unit tests %_unittest: %_unittest.c lib$(SIMPLEMAIL_LIB).a perl gen-tests.pl <$< >$@_table.c - @-$(CC) unittest_tmpl.c -DUNITTEST_TABLE=\"$@_table.c\" -DUNITTEST_FILE=\"$<\" $(CFLAGS) -lcunit -L. -l$(SIMPLEMAIL_LIB) $(GLIB_LDFLAGS) $(GTK_LDFLAGS) 2>test-objs/$@error + @-$(CC) unittest_tmpl.c -DUNITTEST_TABLE=\"$@_table.c\" -DUNITTEST_FILE=\"$<\" $(CFLAGS) -lcunit -L. -l$(SIMPLEMAIL_LIB) $(SSL_LDFLAGS) $(GLIB_LDFLAGS) $(GTK_LDFLAGS) 2>test-objs/$@error perl gen-stubs.pl <test-objs/$@error >$@stubs.c - $(CC) $@stubs.c unittest_tmpl.c -DUNITTEST_TABLE=\"$@_table.c\" -DUNITTEST_FILE=\"$<\" $(CFLAGS) -lcunit -L. -l$(SIMPLEMAIL_LIB) $(GLIB_LDFLAGS) $(GTK_LDFLAGS) -o $@ + $(CC) $@stubs.c unittest_tmpl.c -DUNITTEST_TABLE=\"$@_table.c\" -DUNITTEST_FILE=\"$<\" $(CFLAGS) -lcunit -L. -l$(SIMPLEMAIL_LIB) $(SSL_LDFLAGS) $(GLIB_LDFLAGS) $(GTK_LDFLAGS) -o $@ of-human-bondage.txt: of-human-bondage.txt.gz gzip -c -d $< >$@ |
From: Sebastian B. <sb...@us...> - 2014-02-21 06:32:47
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25105/tests Modified Files: tcp_unittest.c Log Message: Create some ssl connection. Index: tcp_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/tcp_unittest.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tcp_unittest.c 21 Feb 2014 06:31:50 -0000 1.1 +++ tcp_unittest.c 21 Feb 2014 06:32:44 -0000 1.2 @@ -31,4 +31,9 @@ /* @Test */ void test_make_secure(void) { + struct connection *connect; + + connect = tcp_connect("localhost", 6252, 1); + CU_ASSERT(connect != NULL); + tcp_disconnect(connect); } |
From: Sebastian B. <sb...@us...> - 2014-02-21 06:32:29
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25067/tests Modified Files: imap2_unittest.c Log Message: Removed custom implementations of functions needed for tcp. Index: imap2_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/imap2_unittest.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- imap2_unittest.c 26 Dec 2013 18:37:28 -0000 1.21 +++ imap2_unittest.c 21 Feb 2014 06:32:26 -0000 1.22 @@ -33,25 +33,6 @@ /*************************************************************/ -int open_socket_lib(void) -{ - return 1; -} - -void close_socket_lib(void) -{ -} - -void myclosesocket(int fd) -{ - close(fd); -} - -long tcp_errno(void) -{ - return errno; -} - void main_set_progress(unsigned int max_work, unsigned int work) { } |
From: Sebastian B. <sb...@us...> - 2014-02-21 06:32:10
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25031/tests Modified Files: makefile Log Message: Added tcpip.c module. Index: makefile =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/makefile,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- makefile 21 Feb 2014 06:31:50 -0000 1.44 +++ makefile 21 Feb 2014 06:32:08 -0000 1.45 @@ -4,7 +4,7 @@ include ../common-sources.mk -SRCS = $(addprefix ../,$(NONARCHSRCS)) ../gtk/support.c ../gtk/subthreads.c +SRCS = $(addprefix ../,$(NONARCHSRCS)) ../gtk/support.c ../gtk/subthreads.c ../gtk/tcpip.c OBJS = $(SRCS:../%.c=test-objs/%.o) GLIB_CFLAGS := $(shell pkg-config glib-2.0 --cflags) |
From: Sebastian B. <sb...@us...> - 2014-02-21 06:31:53
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24979/tests Modified Files: makefile Added Files: tcp_unittest.c Log Message: Added framework for tcp unittest. Index: makefile =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/makefile,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- makefile 19 Jan 2014 18:48:29 -0000 1.43 +++ makefile 21 Feb 2014 06:31:50 -0000 1.44 @@ -30,7 +30,8 @@ imap2_unittest \ mail_unittest \ support_indep_unittest \ - text2html_unittest + text2html_unittest \ + tcp_unittest test-objs/%.o: ../%.c @mkdir -p $(@D) --- NEW FILE: tcp_unittest.c --- /*************************************************************************** SimpleMail - Copyright (C) 2000 Hynek Schlawack and Sebastian Bauer This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <time.h> #include <sys/time.h> #include <CUnit/Basic.h> #include "tcp.h" /********************************************************/ /* @Test */ void test_make_secure(void) { } |
From: Sebastian B. <sb...@us...> - 2014-02-21 06:31:24
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24932 Modified Files: index_external.c Log Message: Added an offset file that will keep track of the offsets and dids. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- index_external.c 19 Jan 2014 18:56:09 -0000 1.52 +++ index_external.c 21 Feb 2014 06:31:22 -0000 1.53 @@ -86,6 +86,7 @@ int number_of_blocks; FILE *string_file; + FILE *offset_file; FILE *index_file; /** Identifies the block for the root node. TODO: Make this persistent */ @@ -795,6 +796,7 @@ idx = (struct index_external*)index; + if (idx->offset_file) fclose(idx->offset_file); if (idx->string_file) fclose(idx->string_file); if (idx->index_file) fclose(idx->index_file); if (idx->tmp3) bnode_free(idx, idx->tmp3); @@ -833,6 +835,10 @@ if (!(idx->string_file = fopen(buf, "w+b"))) goto bailout; + sm_snprintf(buf, sizeof(buf), "%s.offsets", filename); + if (!(idx->offset_file = fopen(buf, "w+b"))) + goto bailout; + idx->tmp->leaf = 1; idx->root_node = bnode_add_block(idx, idx->tmp); idx->max_substring_len = 32; @@ -868,6 +874,33 @@ return 1; } +/** + * Structure representing an offset/did pair. + */ +struct offset_entry +{ + int offset; + int did; +}; + +/** + * Appends the given offset did pair to the offsets file. + */ +static int index_external_append_offset_did_pair(struct index_external *idx, int offset, int did) +{ + struct offset_entry entry; + + if (fseek(idx->offset_file, 0, SEEK_END) != 0) + return 0; + + entry.offset = offset; + entry.did = did; + + if (fwrite(&entry, 1, sizeof(entry), idx->offset_file) != sizeof(entry)) + return 0; + return 1; +} + int index_external_put_document(struct index *index, int did, const char *text) { struct index_external *idx; @@ -880,6 +913,9 @@ if (!index_external_append_string(idx, text, &offset)) return 0; + if (!index_external_append_offset_did_pair(idx, offset, did)) + return 0; + for (i=0; i < l; i++) { if (!(bnode_insert_string((struct index_external*)index, did, offset + i, text + i))) |
From: Nicolas S. <he...@us...> - 2014-02-20 21:37:21
|
Update of /cvsroot/simplemail/simplemail/amiga-mui In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20417 Modified Files: startup-morphos.c Log Message: Use as much *68k* stack as the 68k version. Index: startup-morphos.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/amiga-mui/startup-morphos.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- startup-morphos.c 2 Jan 2012 17:40:12 -0000 1.15 +++ startup-morphos.c 20 Feb 2014 21:37:19 -0000 1.16 @@ -53,7 +53,7 @@ static int init_io(void); static void deinit_io(void); -#define MIN68KSTACK 8192 /* MUI requirement legacy */ +#define MIN68KSTACK 40000 #define MINSTACK 60000 ULONG __abox__ = 1; |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:56:11
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25655 Modified Files: index_external.c Log Message: Introduced sepeate node types. Within the leaves, we do not need to store the gchild field and within the internal nodes, we do not need to store the document id, as we will always go to a leaf now. This saves some space. Note that will remove some further attributes in the future. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- index_external.c 19 Jan 2014 18:55:31 -0000 1.51 +++ index_external.c 19 Jan 2014 18:56:09 -0000 1.52 @@ -51,8 +51,19 @@ { int str_offset; int str_len; - int did; - int gchild; /* Child containing values that are greater */ + union + { + struct + { + int did; + } leaf; + + /** Child containing values that are all greater or equal */ + struct + { + int gchild; + } internal; + }; }; struct bnode_header @@ -317,13 +328,16 @@ if (!bnode_find_separation_slot(idx, tmp, text, &i, &direct_match)) return 0; - if (i == 0) lchild = tmp->lchild; - else lchild = bnode_get_ith_element_of_node(idx, tmp, i - 1)->gchild; - path->max_level = level; path->node[level].block = block; path->node[level].key_index = i; + if (tmp->leaf) + break; + + if (i == 0) lchild = tmp->lchild; + else lchild = bnode_get_ith_element_of_node(idx, tmp, i - 1)->internal.gchild; + if (block == lchild && !tmp->leaf) { fprintf(stderr, "Endless loop detected!\n"); @@ -366,7 +380,10 @@ printf("%s: ", prefix, node->lchild); for (i=0;i<node->num_elements;i++) { - printf("%d ",bnode_get_ith_element_of_node(idx, node, i)->gchild); + struct bnode_element *be; + be = bnode_get_ith_element_of_node(idx, node, i); + + printf("%d ", node->leaf?be->leaf.did:be->internal.gchild); } printf("\n"); } @@ -421,7 +438,7 @@ printf("\n"); } if (!tmp->leaf) - dump_index(idx, e->gchild, level + 1); + dump_index(idx, e->internal.gchild, level + 1); free(str); } @@ -468,7 +485,7 @@ if (!tmp->leaf) - verify_index(idx, e->gchild, level + 1); + verify_index(idx, e->internal.gchild, level + 1); free(str1); str1 = str2; @@ -506,7 +523,7 @@ e = bnode_get_ith_element_of_node(idx, tmp, i); if (!tmp->leaf) - count += count_index(idx, e->gchild, level + 1); + count += count_index(idx, e->internal.gchild, level + 1); count++; } @@ -539,7 +556,7 @@ e = bnode_get_ith_element_of_node(idx, tmp, i); if (!tmp->leaf) - count += count_index_leaves(idx, e->gchild, level + 1); + count += count_index_leaves(idx, e->internal.gchild, level + 1); else count++; } @@ -571,8 +588,7 @@ current_level = path.max_level; new_element.str_offset = offset; new_element.str_len = strlen(text); - new_element.did = did; - new_element.gchild = 0; + new_element.leaf.did = did; while (current_level >= 0) { @@ -615,7 +631,7 @@ /* Second node */ idx->tmp3->num_elements = idx->max_elements_per_node - start_of_2nd_node; - idx->tmp3->lchild = me->gchild; + idx->tmp3->lchild = me->internal.gchild; idx->tmp3->leaf = tmp->leaf; idx->tmp3->sibling = tmp->sibling; memcpy(bnode_get_ith_element_of_node(idx, idx->tmp3, 0), bnode_get_ith_element_of_node(idx, tmp, start_of_2nd_node), idx->tmp3->num_elements * sizeof(struct bnode_element)); @@ -636,7 +652,7 @@ tmp->lchild = idx->root_node; tmp->leaf = 0; tmp->sibling = -1; - me_copy.gchild = tmp3block; + me_copy.internal.gchild = tmp3block; *bnode_get_ith_element_of_node(idx, tmp, 0) = me_copy; bnode_clear_elements(idx, tmp, 1); idx->root_node = bnode_add_block(idx, tmp); @@ -644,7 +660,7 @@ } new_element = me_copy; - new_element.gchild = tmp3block; + new_element.internal.gchild = tmp3block; } else { /* There was enough space in the block */ @@ -742,7 +758,7 @@ goto done; if (cmp) goto done; iter->index = index; - iter->did = be->did; + iter->did = be->leaf.did; return iter; done: bnode_free(idx, iter->node); |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:55:52
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25608/gtk Modified Files: subthreads.c Log Message: Ignore deprecated declarations warning. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- subthreads.c 24 Dec 2013 09:34:35 -0000 1.61 +++ subthreads.c 19 Jan 2014 18:55:50 -0000 1.62 @@ -35,6 +35,8 @@ #include "support_indep.h" #include "subthreads.h" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + static GCond *thread_cond; static GMutex *thread_mutex; static int thread_parent_can_continue; |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:55:33
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25573 Modified Files: index_external.c Log Message: Reimplemented the callback function using the iterator function. The standard index_unittest.c test now mostly works. What is still missing is deletion. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- index_external.c 19 Jan 2014 18:55:10 -0000 1.50 +++ index_external.c 19 Jan 2014 18:55:31 -0000 1.51 @@ -657,55 +657,6 @@ } /** - * Tries to find the given string. - * - * @param idx - * @param text - * @return - */ -static int bnode_find_string(struct index_external *idx, const char *text, int (*callback)(int did, void *userdata), void *userdata) -{ - int i; - int block; - char *str; - bnode *tmp = idx->tmp; - struct bnode_element *be; - int text_len = strlen(text); - int nd = 0; - struct bnode_path path; - - if (!bnode_lookup(idx, text, &path)) - return 0; - - block = path.node[path.max_level].block; - i = path.node[path.max_level].key_index; - - if (!bnode_read_block(idx, tmp, block)) - return 0; - - if (text_len > idx->max_substring_len) - text_len = idx->max_substring_len; - - for (;i<tmp->num_elements;i++) - { - int cmp; - be = bnode_get_ith_element_of_node(idx, tmp, i); - str = bnode_read_string(idx, be); - if (!str) return 0; - cmp = strncmp(text, str, text_len); - free(str); - if (!cmp) - { - callback(be->did, userdata); - nd++; - } - else - break; - } - return nd; -} - -/** * The iterator data. */ struct bnode_string_iter_data @@ -799,6 +750,28 @@ return NULL; } +/** + * Tries to find the given string. + * + * @param idx + * @param text + * @return + */ +static int bnode_find_string(struct index_external *idx, const char *text, int (*callback)(int did, void *userdata), void *userdata) +{ + struct bnode_string_iter_data *iter = NULL; + int nd = 0; + + while ((iter = bnode_find_string_iter(idx, text, iter))) + { + callback(bnode_string_iter_data_get_did(iter), userdata); + nd++; + } + return nd; +} + + + static void index_external_dispose(struct index *index) { struct document_node *d; |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:55:12
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25520 Modified Files: index_external.c Log Message: Use bnode_compare_string() instead of manually reading and comparing the string. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- index_external.c 19 Jan 2014 18:54:47 -0000 1.49 +++ index_external.c 19 Jan 2014 18:55:10 -0000 1.50 @@ -745,7 +745,6 @@ int index; int text_len; struct bnode_element *be; - char *str; if (!iter) { @@ -786,11 +785,10 @@ index = 0; } + be = bnode_get_ith_element_of_node(idx, iter->node, index); - if (!(str = bnode_read_string(idx, be))) + if (!bnode_compare_string(idx, be, text, &cmp)) goto done; - - cmp = strncmp(text, str, text_len); if (cmp) goto done; iter->index = index; iter->did = be->did; |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:54:50
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25454 Modified Files: index_external.c Log Message: Use sibling to jump to next block if we are at a boundary. This fixes the index_external_unittest.c test. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- index_external.c 19 Jan 2014 18:54:28 -0000 1.48 +++ index_external.c 19 Jan 2014 18:54:47 -0000 1.49 @@ -777,7 +777,15 @@ text_len = strlen(text); if (index == iter->node->num_elements) - goto done; + { + if (iter->node->sibling == -1) + goto done; + + if (!bnode_read_block(idx, iter->node, iter->node->sibling)) + goto done; + + index = 0; + } be = bnode_get_ith_element_of_node(idx, iter->node, index); if (!(str = bnode_read_string(idx, be))) goto done; |
From: Sebastian B. <sb...@us...> - 2014-01-19 18:54:30
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25424 Modified Files: index_external.c Log Message: Maintain the siblings of each block. Index: index_external.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/index_external.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- index_external.c 19 Jan 2014 18:53:26 -0000 1.47 +++ index_external.c 19 Jan 2014 18:54:28 -0000 1.48 @@ -60,6 +60,7 @@ int leaf; int num_elements; /* Number of following bnode_elements */ int lchild; /* Child containing keys/strings that are all (lexicographical) smaller */ + int sibling; }; typedef struct bnode_header bnode; @@ -104,6 +105,7 @@ return NULL; memset(bnode, 0, idx->block_size + sizeof(struct bnode_element)); + bnode->sibling = -1; return bnode; } @@ -383,7 +385,7 @@ if (!bnode_read_block(idx, tmp, block)) return; - printf("dump_index(block=%d, level=%d, leaf=%d) elements=%d\n", block, level, tmp->leaf, tmp->num_elements); + printf("dump_index(block=%d, level=%d, leaf=%d, sibling=%d) elements=%d\n", block, level, tmp->leaf, tmp->sibling, tmp->num_elements); if (!tmp->leaf) dump_index(idx, tmp->lchild, level + 1); @@ -615,11 +617,13 @@ idx->tmp3->num_elements = idx->max_elements_per_node - start_of_2nd_node; idx->tmp3->lchild = me->gchild; idx->tmp3->leaf = tmp->leaf; + idx->tmp3->sibling = tmp->sibling; memcpy(bnode_get_ith_element_of_node(idx, idx->tmp3, 0), bnode_get_ith_element_of_node(idx, tmp, start_of_2nd_node), idx->tmp3->num_elements * sizeof(struct bnode_element)); bnode_clear_elements(idx, idx->tmp3, idx->tmp3->num_elements); int tmp3block = bnode_add_block(idx, idx->tmp3); /* This should be done as late as possible */ + tmp->sibling = tmp3block; bnode_clear_elements(idx, tmp, median); bnode_write_block(idx, tmp, block); @@ -631,6 +635,7 @@ tmp->num_elements = 1; tmp->lchild = idx->root_node; tmp->leaf = 0; + tmp->sibling = -1; me_copy.gchild = tmp3block; *bnode_get_ith_element_of_node(idx, tmp, 0) = me_copy; bnode_clear_elements(idx, tmp, 1); |